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:
20
Zend/tests/warning_during_heredoc_scan_ahead.phpt
Normal file
20
Zend/tests/warning_during_heredoc_scan_ahead.phpt
Normal 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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user