1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Don't throw warnings during heredoc scan-ahead

Otherwise these warnings will turn up twice (or more...)
This commit is contained in:
Nikita Popov
2019-09-28 17:15:36 +02:00
parent 66c48e8694
commit 7df50ef147
4 changed files with 207 additions and 181 deletions

View File

@@ -0,0 +1,20 @@
--TEST--
No warnings should be thrown during heredoc scan-ahead
--FILE--
<?php
<<<TEST
${x}
\400
${/*}
TEST;
?>
--EXPECTF--
Warning: Unexpected character in input: '' (ASCII=1) state=0 in %s on line %d
Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d
Warning: Unterminated comment starting line %d in %s on line %d
Parse error: syntax error, unexpected end of file in %s on line %d

File diff suppressed because it is too large Load Diff

View File

@@ -2098,7 +2098,7 @@ inline_char_handler:
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
} else {
} else if (!SCNG(heredoc_scan_ahead)) {
zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
}
@@ -2752,7 +2752,9 @@ nowdoc_scan_done:
RETURN_TOKEN(END);
}
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
if (!SCNG(heredoc_scan_ahead)) {
zend_error(E_COMPILE_WARNING, "Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
}
goto restart;
}

View File

@@ -1,4 +1,4 @@
/* Generated by re2c 1.1.1 */
/* Generated by re2c 1.0.1 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {