diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-12-28 06:41:51 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-12-28 06:41:51 -0800 |
commit | 07912e6dd718e22b318eaa7d7c3793f6c86ea40d (patch) | |
tree | 0f7dce81d69c8e885c271e8ed589910cd37b6872 | |
parent | e0dfdb601d2ef16ea97bea1eebbf7e81ba240263 (diff) | |
download | txr-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.
-rw-r--r-- | parser.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; } |