Browse Source

Fix little problem on a rule

develop-theo
Sebeck10 2 years ago
parent
commit
58ca592c31
4 changed files with 8 additions and 13 deletions
  1. +5
    -5
      ccmeta.leg
  2. +1
    -1
      tests-parsimony/002.c
  3. +1
    -6
      tests-parsimony/004.c
  4. +1
    -1
      tests-parsimony/007.c

+ 5
- 5
ccmeta.leg View File

@ -1460,7 +1460,7 @@ sCharSequence = ( escapeSequence | !EOL [^\"\\] )* #"
primaryExpression = stringLiteral | constant | id primaryExpression = stringLiteral | constant | id
| META_AT ( META_LCB x:mstmts | 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:expression r:RPAREN { $$= new_C_subexpr(l, x, r) }
| l:LPAREN x:compoundStatement r:RPAREN &{gnu} { $$= 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))) } 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() } ) { $$ = listEnd() }
mstmts = { listBegin() } ( s:meta_stmt { eval(globals, s) } )* mstmts = { listBegin() } ( s:meta_stmt { eval(globals, s) } )*

+ 1
- 1
tests-parsimony/002.c View File

@ -5,7 +5,7 @@
@@.append(`declaration char *test = "foo";); @@.append(`declaration char *test = "foo";);
@@; @@;
} }
@(print("6 outputs : \n"))
@{print("6 outputs : \n");}
@{a = `constant 10;} @{a = `constant 10;}
char t = @(`constant '@a'); char t = @(`constant '@a');
int i = @cons; int i = @cons;

+ 1
- 6
tests-parsimony/004.c View File

@ -1,11 +1,8 @@
@{ @{
num = `integer 21; num = `integer 21;
// print(num.text);
// print("\n");
test = `initializer 2 * 10; test = `initializer 2 * 10;
} }
int x = @{ int x = @{
@@.append(`initializer 2 * @num); @@.append(`initializer 2 * @num);
@@; @@;
@ -14,13 +11,11 @@ int x = @{
int main() { int main() {
int i = @(`initializer 2 * @num); int i = @(`initializer 2 * @num);
int y = @test; int y = @test;
int a = @{ int a = @{
num = `integer 21; num = `integer 21;
test = 2; test = 2;
@@.append(`initializer @num); @@.append(`initializer @num);
@@; @@;
}; };
return 0; return 0;
}
}

+ 1
- 1
tests-parsimony/007.c View File

@ -11,4 +11,4 @@
}; };
@a; @a;
@(`declaration int d = 12;);

Loading…
Cancel
Save