From: David Schleef Date: Wed, 13 Apr 2011 16:20:13 +0000 (-0700) Subject: parser: Allow element names to begin with digits X-Git-Tag: RELEASE-0.10.33~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b6430f6e816cc5bed2b73ed93a9163035dd7cc6;p=platform%2Fupstream%2Fgstreamer.git parser: Allow element names to begin with digits --- diff --git a/gst/parse/parse.l b/gst/parse/parse.l index b9162c2..bcd6527 100644 --- a/gst/parse/parse.l +++ b/gst/parse/parse.l @@ -35,7 +35,7 @@ PRINT (const char *format, ...) %} _operator [(){}.!,;=] -_identifier [[:alpha:]][[:alnum:]\-_%:]* +_identifier [[:alnum:]_][[:alnum:]\-_%:]* _char ("\\".)|([^[:space:]]) _string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'") diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index 0f02b67..3c7fdf9 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -99,6 +99,8 @@ static const gchar *test_lines[] = { "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 ! 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 }; @@ -106,6 +108,18 @@ GST_START_TEST (test_launch_lines) { GstElement *pipeline; 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++) { pipeline = setup_pipeline (*s);