restored missing GREATER token (whoops), added column tracking to lexer

git-svn-id: svn://anubis/fart/trunk@346 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2010-10-06 20:54:36 +00:00
parent c4fc36bb5c
commit 5dbe3c6d8f

View File

@ -8,6 +8,8 @@
#include "parser.h"
#include "parser.tab.hh"
#define YY_USER_ACTION yylloc->first_column += yyleng;
%}
%%
@ -39,6 +41,7 @@
\) return RPAREN;
\< return LESS;
\<= return LESSEQ;
\> return GREATER;
\>= return GREATEREQ;
[0-9]+ *yylval = new NumberNode(atof(yytext)); return REAL_NUMBER;
@ -102,8 +105,14 @@ local return LOCAL;
return VARREF;
}
#.*\n yylloc->first_line++; yylloc->last_line++;
\n yylloc->first_line++; yylloc->last_line++;
#.*\n {
yylloc->first_line++; yylloc->last_line++;
yylloc->first_column = yylloc->last_column = 0;
}
\n {
yylloc->first_line++; yylloc->last_line++;
yylloc->first_column = yylloc->last_column = 0;
}
[ \t\v] /* ignore whitespace */
. return yytext[0];