From 11076590cd9927694bccd96456ab149a3a7bb432 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 27 Aug 2012 18:26:11 -0700 Subject: [PATCH] Fix eval 'q;;' The parser expects a semicolon at the end of every statement, so the lexer provides one. It was not doing so for evals ending with a semicolon, even if that semicolon was not a statement-terminating semicolon. --- t/base/lex.t | 5 ++++- toke.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/t/base/lex.t b/t/base/lex.t index 75529d8..4c4981d 100644 --- a/t/base/lex.t +++ b/t/base/lex.t @@ -1,6 +1,6 @@ #!./perl -print "1..65\n"; +print "1..66\n"; $x = 'x'; @@ -323,3 +323,6 @@ eval '/(?{print <linestr = flags & LEX_START_COPIED ? SvREFCNT_inc_simple_NN(line) : newSVpvn_flags(s, len, SvUTF8(line)); - if (!len || s[len-1] != ';') - sv_catpvs(parser->linestr, "\n;"); + sv_catpvs(parser->linestr, "\n;"); } else { parser->linestr = newSVpvs("\n;"); } -- 2.7.4