.. is concatenation
This commit is contained in:
parent
5886dcd8ff
commit
caabe8eb52
1
lexer.l
1
lexer.l
@ -42,6 +42,7 @@ elif return ELIF;
|
||||
{letter}({letter}|{digit}|[?.-])* yylval.sym = yytext; return ID;
|
||||
"<-" return GETS;
|
||||
"->" return MAPS;
|
||||
".." return CAT;
|
||||
[(){}.,*/+-] return yytext[0];
|
||||
[\t ] // Eat whitespace not first on a line
|
||||
"/"\n // Eat newlines ending in /
|
||||
|
2
parser.y
2
parser.y
@ -19,6 +19,7 @@ int yyerror(const char* p) { fprintf(stderr, p); }
|
||||
%token IF ELIF ELSE
|
||||
|
||||
%right GETS
|
||||
%left CAT
|
||||
%left '+' '-'
|
||||
%left '/' '*'
|
||||
%left MAPS
|
||||
@ -34,6 +35,7 @@ assignments: assignments assignment STOP | // null production;
|
||||
expr: funcdef
|
||||
| funcall
|
||||
| objdef
|
||||
| expr CAT expr
|
||||
| expr '+' expr
|
||||
| expr '-' expr
|
||||
| expr '*' expr
|
||||
|
Loading…
Reference in New Issue
Block a user