From 07912e6dd718e22b318eaa7d7c3793f6c86ea40d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 28 Dec 2023 06:41:51 -0800 Subject: 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. --- parser.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'parser.c') 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; } -- cgit v1.2.3