mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Honor a semicolon on the same line as an ending token of a heredoc
This commit is contained in:
parent
0a6e9ddd7f
commit
43c0e94ac9
@ -1010,8 +1010,9 @@ TLS_VARS;
|
||||
}
|
||||
|
||||
|
||||
<HEREDOC>^{LABEL}("\r")?"\n" {
|
||||
<HEREDOC>^{LABEL}(";")?("\r")?"\n" {
|
||||
int label_len;
|
||||
unsigned char unput_semicolon;
|
||||
|
||||
if (yytext[yyleng-2]=='\r') {
|
||||
label_len = yyleng-2;
|
||||
@ -1019,7 +1020,17 @@ TLS_VARS;
|
||||
label_len = yyleng-1;
|
||||
}
|
||||
|
||||
if (yytext[label_len-1]==';') {
|
||||
label_len--;
|
||||
unput_semicolon=1;
|
||||
} else{
|
||||
unput_semicolon=0;
|
||||
}
|
||||
|
||||
if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) {
|
||||
if (unput_semicolon) {
|
||||
unput(';');
|
||||
}
|
||||
efree(CG(heredoc));
|
||||
CG(heredoc)=NULL;
|
||||
CG(heredoc_len)=0;
|
||||
|
Loading…
Reference in New Issue
Block a user