Преглед изворни кода

variable "lang" removed from file and comments updated to avoid conflicts

develop-theo
Theo Souchon пре 2 година
родитељ
комит
df08508ca5
3 измењених фајлова са 19 додато и 24 уклоњено
  1. +12
    -17
      ccmeta.leg
  2. +4
    -4
      tests-parsimony/002.c
  3. +3
    -3
      tests-parsimony/004.c

+ 12
- 17
ccmeta.leg Прегледај датотеку

@ -1293,7 +1293,7 @@ typedef enum {
C = 1, C = 1,
} language; } language;
language lang = C, printLang = C;
language printLang = C;
int getProtoNumber(oop obj) { int getProtoNumber(oop obj) {
return get(map_get(map_get(obj, __proto___symbol), __name___symbol), Symbol, prototype); return get(map_get(map_get(obj, __proto___symbol), __name___symbol), Symbol, prototype);
@ -1445,9 +1445,8 @@ sCharSequence = ( escapeSequence | !EOL [^\"\\] )* #"
primaryExpression = stringLiteral | constant | id primaryExpression = stringLiteral | constant | id
| META_AT ( META_LCB x:mstmts { $$ = eval(globals, x) } | META_AT ( META_LCB x:mstmts { $$ = eval(globals, x) }
| META_OPERATORS META_LPAREN x:mexp { $$ = eval(globals, x) }
| META_LPAREN x:mexp { $$ = eval(globals, x) }
| META_COMMA x:mcomma { $$ = eval(globals, x) }
| META_OPERATORS META_LPAREN x:mvalue { $$ = eval(globals, x) }
| x:mvalue { $$ = eval(globals, x) }
) )
| 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) }
@ -2158,22 +2157,18 @@ _FLOAT128 = '_Float128' !IDREST &{gnu} { $$= newToken("_Float1
# the semicolon has to be explicit with no space eaten afterwards to prevent the # the semicolon has to be explicit with no space eaten afterwards to prevent the
# input buffer from moving past it before redirecting input from the imported file # input buffer from moving past it before redirecting input from the imported file
metaCatch = META_AT @{ lang= META } ( META_OPERATORS META_LPAREN m:mexp { eval(globals, m) }
| META_LPAREN m:mexp { eval(globals, m) }
| META_LCB m:mstmts
| META_IMPORT s:META_STRING ";" { inputStackPush(get(s, String, value)) }
)
metaCatch = META_AT ( META_OPERATORS META_LPAREN m:mvalue { eval(globals, m) }
| META_LPAREN m:mvalue { eval(globals, m) }
| META_LCB m:mstmts
| META_IMPORT s:META_STRING ";" { inputStackPush(get(s, String, value)) }
)
mexp = @{ lang = META } s:meta_exp META_RPAREN @{ lang = C } { $$= s }
| @{ lang = C } &{ 0 }
mcomma = @{ lang = META } s:meta_exp @{ lang = C } { $$= s }
| @{ lang = C } &{ 0 }
mvalue = i:META_IDENT { $$ = newGetVariable(i) }
| META_LPAREN ( i:meta_block | i:meta_exp ) META_RPAREN { $$ = i }
mstmts = @{ lang = META } -- ( s:meta_stmt { eval(globals, s) })* META_RCB { lang = C }
| @{ lang = C } &{ 0 }
mstmts = ( s:meta_stmt { eval(globals, s) })* META_RCB
| &{ 0 }
meta_stmt = s:meta_block { $$ = s } meta_stmt = s:meta_block { $$ = s }
| META_SEMICOLON { $$ = null } | META_SEMICOLON { $$ = null }

+ 4
- 4
tests-parsimony/002.c Прегледај датотеку

@ -4,11 +4,11 @@
two = `integer 2; two = `integer 2;
} }
@(a = `constant 10)
@{a = `constant 10;}
char t = @(`constant 't'); char t = @(`constant 't');
int i = @(cons);
int i = @cons;
int q = @(`constant 10); int q = @(`constant 10);
int k = @(`initializer (1,2,"stringy thingy",21<<1)); int k = @(`initializer (1,2,"stringy thingy",21<<1));
int i = @(saved);
int w = @(a);
int i = @saved;
int w = @a;

+ 3
- 3
tests-parsimony/004.c Прегледај датотеку

@ -6,11 +6,11 @@
} }
int x = @{`initializer 2 * @,num;};
int x = @{`initializer 2 * @(num);};
int main() { int main() {
int i = @(`initializer 2 * @,num);
int y = @,test;
int i = @(`initializer 2 * @num);
int y = @test;
int a = @{ int a = @{
num = `integer 21; num = `integer 21;

Loading…
Откажи
Сачувај