summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-07-26 19:51:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-07-26 19:51:48 -0700
commit87456836e1bd7d1e35a92d55a830e1c1f1f7ccff (patch)
treef4bf2622ea505b80c53e7238cda2dadf6dd4d48f /parser.y
parent517d3674bc06b2c7f7b7a5cdedd0d5d995ca8f86 (diff)
downloadtxr-87456836e1bd7d1e35a92d55a830e1c1f1f7ccff.tar.gz
txr-87456836e1bd7d1e35a92d55a830e1c1f1f7ccff.tar.bz2
txr-87456836e1bd7d1e35a92d55a830e1c1f1f7ccff.zip
parser: give start of a bad forms even if line 1.
* parser.y (parse): Emit the "while parsing form starting at line N" even if N is 1. I think the idea here was supposed to be to suppress this additional message for parses that don't advance from the starting line, so I'm fixing it that way.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.y b/parser.y
index c2d809c9..78cdf9a0 100644
--- a/parser.y
+++ b/parser.y
@@ -1908,9 +1908,12 @@ int parse(parser_t *parser, val name, enum prime_parser prim)
uw_catch_end;
- if (parser->errors && parser->syntax_tree == nil && start_line != 1)
+ if (parser->errors && parser->syntax_tree == nil &&
+ parser->lineno != start_line)
+ {
yyerrorf(parser->scanner, lit("while parsing form starting at line ~a"),
num(start_line), nao);
+ }
return res;
}