edje_cc: fix parsing error when some keywords are used as part name 70/87270/4
authorJee-Yong Um <jc9.um@samsung.com>
Tue, 29 Mar 2016 08:35:04 +0000 (17:35 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 7 Sep 2016 12:55:47 +0000 (05:55 -0700)
Summary:
Some keywords cause parsing error when they are used as part name.
For example,
   group { "some_group";
      parts {
         box { "box";
         }
      }
   }
The part name "box" should be processed by wildcard handler,
but this is pushed into stack. (collections.group.parts.part.box ...)
This patch pushes token into stack only when it doesn't have quotes.

@fix

Reviewers: cedric, raster, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3841

Change-Id: I9efad97139ccab6361c5d420b274f86be67b5e74

src/bin/edje/edje_cc_parse.c

index 4fa97eb..dfc0e74 100644 (file)
@@ -179,14 +179,17 @@ static void
 new_object(void)
 {
    const char *id;
-   New_Object_Handler *oh;
+   New_Object_Handler *oh = NULL;
    New_Statement_Handler *sh;
 
    fill_object_statement_hashes();
    id = stack_id();
-   oh = eina_hash_find(_new_object_hash, id);
-   if (!oh)
-     oh = eina_hash_find(_new_object_short_hash, id);
+   if (!had_quote)
+     {
+        oh = eina_hash_find(_new_object_hash, id);
+        if (!oh)
+          oh = eina_hash_find(_new_object_short_hash, id);
+     }
    if (oh)
      {
         if (oh->func) oh->func();