From 7515303c46d2e4e0b18544d1fe5acd942163ef42 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 21 Dec 2011 06:38:05 -0800 Subject: Bug #35139 * parser.y (yybadtoken): The current token (yychar) is 0 on byacc rather than YYEOF or YYEMPTY, so we have to handle that. --- ChangeLog | 7 +++++++ parser.y | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 598436d1..9e9e79c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-12-21 Kaz Kylheku + + Bug #35139 + + * parser.y (yybadtoken): The current token (yychar) is 0 on byacc + rather than YYEOF or YYEMPTY, so we have to handle that. + 2011-12-21 Kaz Kylheku * Makefile (distclean): use rm -rf on mpi directory. diff --git a/parser.y b/parser.y index 08fe1c96..d28acd69 100644 --- a/parser.y +++ b/parser.y @@ -1012,8 +1012,8 @@ void yybadtoken(int tok, val context) else yyerrorf(lit("unexpected ~a"), problem, nao); else - if (context) - if (tok == YYEOF || tok == YYEMPTY) + if (context) /* Byacc sets yychar to 0 */ + if (tok == YYEOF || tok == YYEMPTY || tok == 0) yyerrorf(lit("unterminated ~a"), context, nao); else if (tok == '\n') yyerrorf(lit("newline in ~a"), context, nao); @@ -1022,7 +1022,7 @@ void yybadtoken(int tok, val context) else if (tok == YYEOF) yyerrorf(lit("unexpected end of input"), nao); - else if (tok == YYEMPTY) + else if (tok == YYEMPTY || tok == 0) return; else yyerrorf(lit("unexpected ~s"), chr(tok), nao); -- cgit v1.2.3