Browse Source

Honor a semicolon on the same line as an ending token of a heredoc

migration/INITIAL
Zeev Suraski 28 years ago
parent
commit
43c0e94ac9
  1. 13
      Zend/zend-scanner.l

13
Zend/zend-scanner.l

@ -1010,16 +1010,27 @@ 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;
} else {
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…
Cancel
Save