diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-06 22:50:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-06 22:50:52 -0700 |
commit | dcc75348c720acd6c2a0587bca34f7851e6c1283 (patch) | |
tree | 2eb725ccba3e27da07ad81344113ce2219377ebd /parser.h | |
parent | a17db859170976269eb79ddb0bbcbd5afabd45d7 (diff) | |
download | txr-dcc75348c720acd6c2a0587bca34f7851e6c1283.tar.gz txr-dcc75348c720acd6c2a0587bca34f7851e6c1283.tar.bz2 txr-dcc75348c720acd6c2a0587bca34f7851e6c1283.zip |
Reset flex scanner if exception thrown during read.
We must tear down and rebuild the Flex scanner, otherwise
it is left in a bad state causing it to abort.
* parser.c (parser_cleanup): After destroying scanner,
null out the pointer.
(parser_reset): Destroy the Flex scanner, and
instantiate a new one in its place.
(lisp_parse): Set up an unwind catch which will
reset the parser if it was aborted by an exception.
* parser.h (parser_reset): Declared.
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -86,6 +86,7 @@ int parse(parser_t *parser, val name, enum prime_parser); val source_loc(val form); val source_loc_str(val form, val alt); val rlset(val form, val info); +void parser_reset(parser_t *); INLINE val rlcp(val to, val from) { return rlset(to, source_loc(from)); |