.. is concatenation

This commit is contained in:
Dane Johnson 2021-11-26 11:20:56 -06:00
parent 5886dcd8ff
commit caabe8eb52
2 changed files with 3 additions and 0 deletions

View File

@ -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 /

View File

@ -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