.. 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;
|
{letter}({letter}|{digit}|[?.-])* yylval.sym = yytext; return ID;
|
||||||
"<-" return GETS;
|
"<-" return GETS;
|
||||||
"->" return MAPS;
|
"->" return MAPS;
|
||||||
|
".." return CAT;
|
||||||
[(){}.,*/+-] return yytext[0];
|
[(){}.,*/+-] return yytext[0];
|
||||||
[\t ] // Eat whitespace not first on a line
|
[\t ] // Eat whitespace not first on a line
|
||||||
"/"\n // Eat newlines ending in /
|
"/"\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
|
%token IF ELIF ELSE
|
||||||
|
|
||||||
%right GETS
|
%right GETS
|
||||||
|
%left CAT
|
||||||
%left '+' '-'
|
%left '+' '-'
|
||||||
%left '/' '*'
|
%left '/' '*'
|
||||||
%left MAPS
|
%left MAPS
|
||||||
@ -34,6 +35,7 @@ assignments: assignments assignment STOP | // null production;
|
|||||||
expr: funcdef
|
expr: funcdef
|
||||||
| funcall
|
| funcall
|
||||||
| objdef
|
| objdef
|
||||||
|
| expr CAT expr
|
||||||
| expr '+' expr
|
| expr '+' expr
|
||||||
| expr '-' expr
|
| expr '-' expr
|
||||||
| expr '*' expr
|
| expr '*' expr
|
||||||
|
Loading…
Reference in New Issue
Block a user