summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-21 18:30:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-21 18:30:13 -0700
commit47cd15b970892e2dae29e825fadaf31c6d84835d (patch)
treeed34c519095f6cc351d90b91c90887c1c491c9a4 /parser.c
parent969b24f06ad615f56f452c87cf2735b5978c754f (diff)
downloadtxr-47cd15b970892e2dae29e825fadaf31c6d84835d.tar.gz
txr-47cd15b970892e2dae29e825fadaf31c6d84835d.tar.bz2
txr-47cd15b970892e2dae29e825fadaf31c6d84835d.zip
compiler: tighter code for quasiliterals.
Give the sys:fmt-simple function argument defaulting so the generated code doesn't have to call it with all five arguments present, four of them nil being much of the time. * eval.c (fmt_simple): Default all but the first four arguments. (eval_init): Re-register sys:fmt-simple as having only one required argument. * parser.c (read_file_common): Load version 1 or 2 files. We are bumping the object file version to 2 because now when we compile files, they won't work with older TXR in which all five arguments to sys:fmt-simple are required. * share/txr/stdlib/compiler.tl (expand-quasi-mods): Generate the sys:fmt-simple call with just enough arguments to express the modifiers that were decoded. (sexpand-quasi-args): Reduce the trivial modifier-less sys:fmt-simple calls to just one argument. (%tlo-ver%): Bump major version to 2.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index 14bad41e..1649fc05 100644
--- a/parser.c
+++ b/parser.c
@@ -629,9 +629,9 @@ static val read_file_common(val stream, val error_stream, val compiled)
if (compiled && first) {
val major = car(form);
- if (neq(major, one))
+ if (lt(major, one) || gt(major, two))
uw_throwf(error_s,
- lit("cannot load ~s; version number mismatch"),
+ lit("cannot load ~s: version number mismatch"),
stream, nao);
big_endian = caddr(form);
first = nil;