Capture preprocessor-output lines and EOLs

This commit is contained in:
Josh Holtrop 2018-04-07 08:38:30 -04:00
parent 47bb3f5219
commit 7107699bc5

View File

@ -6,6 +6,8 @@
#include "parser.h"
#include "parser.tab.h"
#define YY_USER_ACTION yylloc->first_column += yyleng;
%}
%x str
@ -114,4 +116,13 @@ sizeof return TOK_SIZEOF;
[a-zA-Z_][a-zA-Z_0-9]* return TOK_IDENTIFIER;
^[ ]*#[ ]+[0-9]+[ ]+\".+\".*$ {
}
\n {
yylloc->first_line++;
yylloc->first_column = 0;
yylloc->last_line++;
yylloc->last_column = 0;
}
%%