diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-06 08:59:06 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-06 08:59:06 -0800 |
commit | 56f9944a1c2b84deb555c41a5edb287c0e6f419f (patch) | |
tree | 4076f711d28a5d72ebaa0c86a8f8e0d052c6cc53 | |
parent | eae5fe0959092f282ed41e333562ff649c6e0eb9 (diff) | |
download | txr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.tar.gz txr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.tar.bz2 txr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.zip |
* parser.l (end_of_regex): Fix start condition stack underflow
during regex_parse.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parser.l | 8 |
2 files changed, 10 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2013-12-06 Kaz Kylheku <kaz@kylheku.com> + * parser.l (end_of_regex): Fix start condition stack underflow + during regex_parse. + +2013-12-06 Kaz Kylheku <kaz@kylheku.com> + * parser.l (regex_parse): Match the simplified grammar now expected in the parser, with no slashes around the regex. Change prefix for diagnostic message. @@ -778,9 +778,11 @@ void end_of_regex(void) internal_error("end_of_regex called in wrong scanner state"); yy_pop_state(); - if (yy_top_state() == INITIAL - || yy_top_state() == QSILIT) - yy_pop_state(); + + if (YYSTATE != INITIAL) { + if (yy_top_state() == INITIAL || yy_top_state() == QSILIT) + yy_pop_state(); + } } void end_of_char(void) |