From 5424ff2a0969b31f84690cd19bea4e363d32e63a Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 24 Sep 2012 14:26:41 +0300 Subject: Implement loops and variables * lib/forlan.c: Implement loops and variables. * lib/forlangrm.y: Likewise. * lib/forlanlex.l: Likewise. * lib/forlan.h (forlan_parse): Change return type. (forlan_type): New types. (forlan_dump_tree): Change signature. (forlan_value_type) : New type. * tests/tforlan.c: Update. --- lib/forlanlex.l | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/forlanlex.l') diff --git a/lib/forlanlex.l b/lib/forlanlex.l index 99966ed..e3f9f26 100644 --- a/lib/forlanlex.l +++ b/lib/forlanlex.l @@ -66,6 +66,11 @@ IDC [a-zA-Z_0-9-] if return IF; else return ELSE; last return LAST; +for return FOR; +let return LET; +in return IN; +break return BREAK; +continue return CONTINUE; ! return NOT; "&&" return AND; "||" return OR; @@ -98,7 +103,7 @@ last return LAST; /* Other tokens */ {WS} ; \n { grecs_locus_point_advance_line(grecs_current_locus_point); } -[.,;{}()\[\]] return yytext[0]; +[.,;{}()\[\]=\*%] return yytext[0]; . { if (isascii(yytext[0]) && isprint(yytext[0])) grecs_error(&yylloc, 0, _("stray character %c"), yytext[0]); -- cgit v1.2.1