diff options
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; |