diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-11-20 13:12:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-11-20 13:12:48 -0800 |
commit | c65963309bf98d455d525a149259024d24a98f22 (patch) | |
tree | 92306d72ab1adf22e3459ec1db0e6564c94c6b7d /parser.y | |
parent | 71cacde9c896a1532247a349a298e68fd20500a8 (diff) | |
download | txr-c65963309bf98d455d525a149259024d24a98f22.tar.gz txr-c65963309bf98d455d525a149259024d24a98f22.tar.bz2 txr-c65963309bf98d455d525a149259024d24a98f22.zip |
Bug #34630
* parser.y (repeat_clause, rep_elem): Allow empty body.
(yybadtoken): Handle unexpected newline with different message.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -451,7 +451,7 @@ out_clause : repeat_clause { $$ = cons($1, nil); } ; repeat_clause : REPEAT newl - out_clauses + out_clauses_opt repeat_parts_opt END newl { $$ = repeat_rep_helper(repeat_s, $3, $4); rl($$, num($1)); } @@ -508,7 +508,7 @@ o_elem : TEXT { $$ = string_own($1); | rep_elem { $$ = $1; } ; -rep_elem : REP o_elems +rep_elem : REP o_elems_opt rep_parts_opt END { $$ = repeat_rep_helper(rep_s, o_elems_transform($2), $3); @@ -951,6 +951,8 @@ void yybadtoken(int tok, val context) if (context) if (tok == YYEOF || tok == YYEMPTY) yyerrorf(lit("unterminated ~a"), context, nao); + else if (tok == '\n') + yyerrorf(lit("newline in ~a"), context, nao); else yyerrorf(lit("misplaced character ~a in ~a"), chr(tok), context, nao); else |