summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-21 06:07:57 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-21 06:07:57 -0800
commit563b6367a572bc50f8fbec2aeff255c258407862 (patch)
treedc907e344c6e3526f1215a1cd5ab2b018b32d74d /parser.l
parent3f93ddf1acc8b6d3647dec31e7329987d452daa5 (diff)
downloadtxr-563b6367a572bc50f8fbec2aeff255c258407862.tar.gz
txr-563b6367a572bc50f8fbec2aeff255c258407862.tar.bz2
txr-563b6367a572bc50f8fbec2aeff255c258407862.zip
Improved error reporting, particularly for macro expansion.
* eval.c (last_form_expanded): New variable. (do_expand): New static function; contains previous expand function. (expand): Becomes a wrapper for do_expand, with re-entry counting. (eval_init): GC-protect last_form_expanded. * eval.h (last_form_expanded): Declared. * parser.l (regex_parse, lisp_parse): Just use a simple word for the name of the regex or string parse location, not the entire expression itself. * unwind.c (uw_throw): Check whether expansion was going on when the unhandled exception was thrown and print additional information.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l6
1 files changed, 2 insertions, 4 deletions
diff --git a/parser.l b/parser.l
index 6d47078b..0c3ba64e 100644
--- a/parser.l
+++ b/parser.l
@@ -985,9 +985,7 @@ val regex_parse(val string, val error_stream)
{
int gc = gc_state(0);
- val name = if3(std_error != std_null,
- format(nil, lit("regex --> ~a"), string, nao),
- lit(""));
+ val name = if3(std_error != std_null, lit("regex"), lit(""));
parse(stream, name, &parser);
gc_state(gc);
}
@@ -1004,7 +1002,7 @@ val lisp_parse(val source_in, val error_stream, val error_return_val)
or2(source, std_input));
val secret_token_stream = make_string_byte_input_stream(lit("@\x01" "E"));
val name = if3(stringp(source),
- format(nil, lit("expr --> ~a"), source, nao),
+ lit("string"),
stream_get_prop(input_stream, name_k));
val stream = make_catenated_stream(list(secret_token_stream, input_stream, nao));
val saved_dyn = dyn_env;