summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-12-28 06:41:51 -0800
committerKaz Kylheku <kaz@kylheku.com>2023-12-28 06:41:51 -0800
commit07912e6dd718e22b318eaa7d7c3793f6c86ea40d (patch)
tree0f7dce81d69c8e885c271e8ed589910cd37b6872 /parser.c
parente0dfdb601d2ef16ea97bea1eebbf7e81ba240263 (diff)
downloadtxr-07912e6dd718e22b318eaa7d7c3793f6c86ea40d.tar.gz
txr-07912e6dd718e22b318eaa7d7c3793f6c86ea40d.tar.bz2
txr-07912e6dd718e22b318eaa7d7c3793f6c86ea40d.zip
read-objects: clean up working, but odd code.
This was prompted by a misleading indentation warning. * parser.c (read_objects_common): The indented statment "return error_return_val;" belongs with the if. This works anyway because if lisp_parse_impl returned unique_s, it means that either pi->syntax_tree is nao, or pi->errors is positive. So, let's take advantage of that and don't bother checking for pi->syntax_tree == nao. If unique_s was returned and there are no errors, we hit EOF and so break out of the loop.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index a5b3724e..8eb82e31 100644
--- a/parser.c
+++ b/parser.c
@@ -910,13 +910,12 @@ static val read_objects_common(val stream, val error_stream_in,
error_stream, unique_s, name, colon_k);
if (form == unique_s) {
- if (pi->syntax_tree == nao)
- break;
- if (pi->errors)
+ if (pi->errors) {
if (missingp(error_return_val))
uw_throwf(syntax_error_s, lit("read: ~a: errors encountered"),
name, nao);
return error_return_val;
+ }
break;
}