From e131e81e72f37d29bd237d0052bb9f6febd7ffd0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 6 Sep 2017 22:26:31 -0700 Subject: txr -i honored despite parse-time exception. If an error is thrown while parsing a .txr file or while reading and evaluating the forms of a .tl file. * parser.y (parse_once, parse): Wording change in message when exception is caught. Only exceptions derived from error are caught. * txr.c (parse_once_noerr, read_eval_stream_noerr): New static functions. (txr_main): Use parse_once_noerr and read_eval_stream_noerr instead of parse_once and read_eval_stream. Don't exit if a TXR file has parser errors; in that situation, exit only if interactive mode is not requested, otherwise go interactive. Make sure *self-path* is registered to the name of the input source in this case also. * unwind.h (ignerr_func_body): New macro. --- parser.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parser.y') diff --git a/parser.y b/parser.y index 265e4e30..a29403f0 100644 --- a/parser.y +++ b/parser.y @@ -1839,7 +1839,7 @@ int parse_once(val stream, val name, parser_t *parser) parser_resolve_circ(parser); uw_catch(esym, eobj) { - yyerrorf(parser->scanner, lit("exception during parse"), nao); + yyerrorf(parser->scanner, lit("error exception during parse"), nao); uw_throw(esym, eobj); } @@ -1878,7 +1878,7 @@ int parse(parser_t *parser, val name, enum prime_parser prim) parser_resolve_circ(parser); uw_catch(esym, eobj) { - yyerrorf(parser->scanner, lit("exception during parse"), nao); + yyerrorf(parser->scanner, lit("error exception during parse"), nao); uw_throw(esym, eobj); } -- cgit v1.2.3