summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-21 11:12:20 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-21 11:12:20 -0800
commit4a1556a848c5bfb527cecb2b823a750ba63e6f80 (patch)
treebe9378666222056692e4770a8f0eb79b45ef8993 /stream.c
parent00f823aee439ed8c2cdd71dfbb89385dc68eae7b (diff)
downloadtxr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.tar.gz
txr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.tar.bz2
txr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.zip
Introducing symbol packages. Internal symbols are now in
a system package instead of being hacked with the $ prefix. Keyword symbols are provided. In the matcher, evaluation is tightened up. Keywords, nil and t are not bindeable, and errors are thrown if attempts are made to bind them. Destructuring in dest_bind is strict in the number of items. String streams are exploited to print bindings to objects that are not strings or characters. Numerous bugfixes.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/stream.c b/stream.c
index b7945e42..b57a57b1 100644
--- a/stream.c
+++ b/stream.c
@@ -775,7 +775,12 @@ val vformat(val stream, val fmtstr, va_list vl)
} else {
width = digits;
}
- state = (ch == ',') ? vf_precision : vf_spec;
+ if (ch == ',') {
+ state = vf_precision;
+ } else {
+ state = vf_spec;
+ --fmt;
+ }
continue;
case vf_precision:
precision = digits;
@@ -827,7 +832,7 @@ val vformat(val stream, val fmtstr, va_list vl)
if (nump(obj)) {
value = c_num(obj);
sprintf(num_buf, "%ld", value);
- if (vformat_num(stream, num_buf, 0, 0, 0, 0))
+ if (!vformat_num(stream, num_buf, 0, 0, 0, 0))
return nil;
continue;
}