diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-26 15:37:00 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-26 15:37:00 (GMT) |
commit | cbabbaed700536b3a1f513fd5a07d25382cb137f (patch) | |
tree | 17478b52e8e8205709c6862b605caf6762445dfa /src/parser.y | |
parent | 312a25f2708fcef22e300f7bd2c1aaed61d3095d (diff) | |
parent | 4ff2d1af446c1f276c644b12e6ec4cc6db0b6d65 (diff) |
Merge branch 'master' into boost_filesystem
Conflicts:
openscad.pro
src/module.h
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/parser.y b/src/parser.y index b8da50d..df652f5 100644 --- a/src/parser.y +++ b/src/parser.y @@ -144,7 +144,7 @@ statement: '{' inner_input '}' | module_instantiation { if ($1) { - module->children.push_back($1); + module->addChild($1); } else { delete $1; } @@ -191,10 +191,8 @@ statement: children_instantiation: module_instantiation { $$ = new ModuleInstantiation(); - if ($1) { + if ($1) { $$->children.push_back($1); - } else { - delete $1; } } | '{' module_instantiation_list '}' { @@ -204,7 +202,6 @@ children_instantiation: if_statement: TOK_IF '(' expr ')' children_instantiation { $$ = new IfElseModuleInstantiation(); - $$->modname = "if"; $$->argnames.push_back(""); $$->argexpr.push_back($3); @@ -260,8 +257,7 @@ module_instantiation_list: module_instantiation_list module_instantiation { $$ = $1; if ($$) { - if ($2) - $$->children.push_back($2); + if ($2) $$->children.push_back($2); } else { delete $2; } @@ -269,19 +265,12 @@ module_instantiation_list: single_module_instantiation: TOK_ID '(' arguments_call ')' { - $$ = new ModuleInstantiation(); - $$->modname = $1; + $$ = new ModuleInstantiation($1); $$->argnames = $3->argnames; $$->argexpr = $3->argexpr; free($1); delete $3; } | - TOK_ID ':' single_module_instantiation { - $$ = $3; - if ($$) - $$->label = $1; - free($1); - } | '!' single_module_instantiation { $$ = $2; if ($$) |