diff --git a/ccmeta.leg b/ccmeta.leg index a4c70f0..9b994eb 100644 --- a/ccmeta.leg +++ b/ccmeta.leg @@ -1460,7 +1460,7 @@ sCharSequence = ( escapeSequence | !EOL [^\"\\] )* #" primaryExpression = stringLiteral | constant | id | META_AT ( META_LCB x:mstmts - | x:mvalue #{ $$ = eval(globals, x) } + | x:mvalue ) | l:LPAREN x:expression r:RPAREN { $$= new_C_subexpr(l, x, r) } | l:LPAREN x:compoundStatement r:RPAREN &{gnu} { $$= new_C_subexpr(l, x, r) } @@ -2177,10 +2177,10 @@ metaCatch = META_AT ( m:mvalue { map_ mvalue = { listBegin() } ( i:META_IDENT { listAppend(eval(globals, newGetVariable(i))) } - | META_LPAREN ( i:MO_OPERATION - i:meta_block - i:meta_exp - ) META_RPAREN { listAppend(eval(globals, i)) } + | META_LPAREN ( i:MO_OPERATION + | i:meta_block + | i:meta_exp + ) META_RPAREN { listAppend(eval(globals, i)) } ) { $$ = listEnd() } mstmts = { listBegin() } ( s:meta_stmt { eval(globals, s) } )* diff --git a/tests-parsimony/002.c b/tests-parsimony/002.c index 8fae184..cbb212c 100644 --- a/tests-parsimony/002.c +++ b/tests-parsimony/002.c @@ -5,7 +5,7 @@ @@.append(`declaration char *test = "foo";); @@; } -@(print("6 outputs : \n")) +@{print("6 outputs : \n");} @{a = `constant 10;} char t = @(`constant '@a'); int i = @cons; diff --git a/tests-parsimony/004.c b/tests-parsimony/004.c index 126917a..621d272 100644 --- a/tests-parsimony/004.c +++ b/tests-parsimony/004.c @@ -1,11 +1,8 @@ @{ num = `integer 21; - // print(num.text); - // print("\n"); test = `initializer 2 * 10; } - int x = @{ @@.append(`initializer 2 * @num); @@; @@ -14,13 +11,11 @@ int x = @{ int main() { int i = @(`initializer 2 * @num); int y = @test; - int a = @{ num = `integer 21; test = 2; @@.append(`initializer @num); @@; }; - return 0; -} \ No newline at end of file +} diff --git a/tests-parsimony/007.c b/tests-parsimony/007.c index c040c8e..e9c32ff 100644 --- a/tests-parsimony/007.c +++ b/tests-parsimony/007.c @@ -11,4 +11,4 @@ }; @a; -@(`declaration int d = 12;); \ No newline at end of file +