parser: Allow element names to begin with digits

This commit is contained in:
David Schleef 2011-04-13 09:20:13 -07:00
parent e9afe72710
commit 0b6430f6e8
2 changed files with 15 additions and 1 deletions

View file

@ -35,7 +35,7 @@ PRINT (const char *format, ...)
%} %}
_operator [(){}.!,;=] _operator [(){}.!,;=]
_identifier [[:alpha:]][[:alnum:]\-_%:]* _identifier [[:alnum:]_][[:alnum:]\-_%:]*
_char ("\\".)|([^[:space:]]) _char ("\\".)|([^[:space:]])
_string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'") _string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'")

View file

@ -99,6 +99,8 @@ static const gchar *test_lines[] = {
"fakesrc ! video/raw, format=(fourcc)YUY2; video/raw, format=(fourcc)YV12 ! fakesink silent=true", "fakesrc ! video/raw, format=(fourcc)YUY2; video/raw, format=(fourcc)YV12 ! fakesink silent=true",
"fakesrc ! audio/x-raw-int, width=[16, 32], depth={16, 24, 32}, signed=TRUE ! fakesink silent=true", "fakesrc ! audio/x-raw-int, width=[16, 32], depth={16, 24, 32}, signed=TRUE ! fakesink silent=true",
"fakesrc ! identity silent=true ! identity silent=true ! identity silent=true ! fakesink silent=true", "fakesrc ! identity silent=true ! identity silent=true ! identity silent=true ! fakesink silent=true",
"fakesrc name=100 fakesink name=101 silent=true 100. ! 101.",
"fakesrc ! 1dentity ! fakesink silent=true",
NULL NULL
}; };
@ -106,6 +108,18 @@ GST_START_TEST (test_launch_lines)
{ {
GstElement *pipeline; GstElement *pipeline;
const gchar **s; const gchar **s;
GType type;
GstElementFactory *efac;
efac = gst_element_factory_find ("identity");
fail_unless (efac != NULL);
efac =
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE (efac)));
fail_unless (efac != NULL);
type = gst_element_factory_get_element_type (efac);
fail_unless (type != 0);
g_object_unref (efac);
fail_unless (gst_element_register (NULL, "1dentity", GST_RANK_NONE, type));
for (s = test_lines; *s != NULL; s++) { for (s = test_lines; *s != NULL; s++) {
pipeline = setup_pipeline (*s); pipeline = setup_pipeline (*s);