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.
#!./perl
-print "1..65\n";
+print "1..66\n";
$x = 'x';
ok 65 - here-doc in re-eval in string eval
END
})/';
+
+eval 'print qq ;ok 66 - eval ending with semicolon\n;'
+ or print "not ok 66 - eval ending with semicolon\n";
parser->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;");
}