summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-04 08:41:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-04 08:41:58 -0700
commit0abbda4a698bc0f3eb531c6578469c3dff65ad57 (patch)
tree10f2e64bc96c6d06452c710aa311e5c99fad05d3 /match.c
parent4ecca7c0b2ac3d61658d749f51dc1e7fbc408ed8 (diff)
downloadtxr-0abbda4a698bc0f3eb531c6578469c3dff65ad57.tar.gz
txr-0abbda4a698bc0f3eb531c6578469c3dff65ad57.tar.bz2
txr-0abbda4a698bc0f3eb531c6578469c3dff65ad57.zip
* eval.c (force): Default the new second argument of source_loc_str.
(eval_error): Derive location of error from the last_form_evaled, if form doesn't have it. (eval_init): Re-register source-loc-str as binary with an optional arg. * match.c (debuglf, sem_error, file_err, typed_error): Default new argument of source_loc_str. * parser.h (source_loc_str): Declaration updated. * parser.l (source_loc_str): Take second argument which specifies alternative value if the source loc info is not found. * unwind.c (uw_throw): Simplify code thanks to source_loc_str default argument. * txr.1: Document new argument of source-loc-str.
Diffstat (limited to 'match.c')
-rw-r--r--match.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/match.c b/match.c
index eeb0d079..26efcc6c 100644
--- a/match.c
+++ b/match.c
@@ -75,7 +75,8 @@ static void debuglf(val form, val fmt, ...)
if (opt_loglevel >= 2) {
va_list vl;
va_start (vl, fmt);
- format(std_error, lit("~a: (~a) "), prog_string, source_loc_str(form), nao);
+ format(std_error, lit("~a: (~a) "), prog_string,
+ source_loc_str(form, colon_k), nao);
vformat(std_error, fmt, vl);
put_char(chr('\n'), std_error);
va_end (vl);
@@ -89,7 +90,7 @@ static void sem_error(val form, val fmt, ...)
va_start (vl, fmt);
if (form)
- format(stream, lit("(~a) "), source_loc_str(form), nao);
+ format(stream, lit("(~a) "), source_loc_str(form, colon_k), nao);
(void) vformat(stream, fmt, vl);
va_end (vl);
@@ -104,7 +105,7 @@ static void file_err(val form, val fmt, ...)
va_start (vl, fmt);
if (form)
- format(stream, lit("(~a) "), source_loc_str(form), nao);
+ format(stream, lit("(~a) "), source_loc_str(form, colon_k), nao);
(void) vformat(stream, fmt, vl);
va_end (vl);
@@ -119,7 +120,7 @@ static void typed_error(val type, val form, val fmt, ...)
va_start (vl, fmt);
if (form)
- format(stream, lit("(~a) "), source_loc_str(form), nao);
+ format(stream, lit("(~a) "), source_loc_str(form, colon_k), nao);
(void) vformat(stream, fmt, vl);
va_end (vl);