diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-01-28 02:42:20 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-01-28 02:42:20 (GMT) |
commit | 1e64dddf1ea30282c89de7f35854a68614234652 (patch) | |
tree | 165d37c1c66f6ff79d48c74794238b3f0bed09da /src/parser.y | |
parent | 5c779159c208ca3d88c88479ab29f9cd66574859 (diff) | |
parent | d0856efe6da545693f9c50a8a2514a9f999ab5ef (diff) |
Merge branch 'master' of github.com:openscad/openscad into issue159
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/parser.y b/src/parser.y index b36c41b..3e485ff 100644 --- a/src/parser.y +++ b/src/parser.y @@ -233,6 +233,22 @@ ifelse_statement: } ; module_instantiation: + '!' module_instantiation { + $$ = $2; + if ($$) $$->tag_root = true; + } | + '#' module_instantiation { + $$ = $2; + if ($$) $$->tag_highlight = true; + } | + '%' module_instantiation { + $$ = $2; + if ($$) $$->tag_background = true; + } | + '*' module_instantiation { + delete $2; + $$ = NULL; + } | single_module_instantiation ';' { $$ = $1; } | @@ -271,26 +287,7 @@ single_module_instantiation: $$->argexpr = $3->argexpr; free($1); delete $3; - } | - '!' single_module_instantiation { - $$ = $2; - if ($$) - $$->tag_root = true; - } | - '#' single_module_instantiation { - $$ = $2; - if ($$) - $$->tag_highlight = true; - } | - '%' single_module_instantiation { - $$ = $2; - if ($$) - $$->tag_background = true; - } | - '*' single_module_instantiation { - delete $2; - $$ = NULL; - }; + } expr: TOK_TRUE { @@ -566,11 +563,11 @@ Module *parse(const char *text, const char *path, int debug) // PRINTB_NOCACHE("New module: %s %p", "root" % rootmodule); parserdebug = debug; - parserparse(); + int parserretval = parserparse(); lexerdestroy(); lexerlex_destroy(); - if (!rootmodule) return NULL; + if (parserretval != 0) return NULL; parser_error_pos = -1; return rootmodule; |