summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-13 19:49:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-13 19:49:58 -0800
commit0455b347c64dd177036fc79544f3cfb5b3f3118a (patch)
tree6516ad1eae40df9aa2f197ddec2f3447b757dd77 /txr.c
parent2e4dc6906a37a2506379fc2abac5508851b7fa16 (diff)
downloadtxr-0455b347c64dd177036fc79544f3cfb5b3f3118a.tar.gz
txr-0455b347c64dd177036fc79544f3cfb5b3f3118a.tar.bz2
txr-0455b347c64dd177036fc79544f3cfb5b3f3118a.zip
Deferred warnings.
Warnings about undefined functions and variables are now deferred during loading, so forward references do not generate nuisance diagnostics. * eval.c (load_recursive_s): New symbol variable. (eval_defr_warn): New static function. (op_defvarl, op_defun): Purge any deferred warning about the given function or variable not being defined. (load): Rebind the sys:*load-recursive* special var to true around the load. After the load, dump deferred warnings if the prior binding of sys:*load-recursive* is false. Discard deferred warnings in the case of termination by a nonlocal control transfer. (do_expand): Treat unbound vars and functions as deferrable warnings, specially tagged for individual purging frkm the deferred list. (eval_init): Intern sys:*load-recursive* and initialize load_recursive_s variable. * eval.h (load_recursive_s): Declared. * parse.c (repl_warning): Accept variable arguments. Check whether we are loading and if so, defer deferrable (repl): Adjustment for altered signature of repl_warning. warnings. * txr.c (txr_main): dump deferred warnings after evaluating Lisp stream. * unwind.c (deferred_warnings): New static variable. (uw_throw): When a deferrable warning is caught, suppress the usual message and add it to the deferred_warnings list. (uw_defer_warning, uw_dump_deferred_warnings, uw_dump_deferred_warnings, uw_purge_deferred_warnings): New functions. (uw_late_init): gc-protect deferred_warnings. * unwind.h (uw_defer_warning, uw_dump_deferred_warnings, uw_dump_deferred_warnings, uw_purge_deferred_warnings): New functions declared.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/txr.c b/txr.c
index c69def68..d339589a 100644
--- a/txr.c
+++ b/txr.c
@@ -1012,6 +1012,8 @@ int txr_main(int argc, char **argv)
close_stream(parse_stream, nil);
+ uw_dump_deferred_warnings(std_error);
+
if (!enter_repl)
return result ? 0 : EXIT_FAILURE;
}