Reset flex's internal buffer (depends on new pybison version).

parent 9874fec0
pybison @ 0a49121e
Subproject commit 91979192cf3f03df25e88fadfabe893321eb1d9c Subproject commit 0a49121e413712be4d0d27ca7142f16ff95de4df
...@@ -115,6 +115,8 @@ class Parser(BisonParser): ...@@ -115,6 +115,8 @@ class Parser(BisonParser):
self.reset() self.reset()
def reset(self): def reset(self):
super(Parser, self).reset()
self.read_buffer = '' self.read_buffer = ''
self.read_queue = Queue.Queue() self.read_queue = Queue.Queue()
...@@ -687,6 +689,13 @@ class Parser(BisonParser): ...@@ -687,6 +689,13 @@ class Parser(BisonParser):
int yycolumn = 0; int yycolumn = 0;
void reset_flex_buffer(void) {
yycolumn = 0;
yylineno = 0;
YY_FLUSH_BUFFER;
BEGIN(0);
}
#define YY_USER_ACTION \ #define YY_USER_ACTION \
yylloc.first_line = yylloc.last_line = yylineno; \ yylloc.first_line = yylloc.last_line = yylineno; \
yylloc.first_column = yycolumn; \ yylloc.first_column = yycolumn; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment