From: krakjoe Date: Sat, 15 Feb 2014 20:05:44 +0000 (+0000) Subject: barf on unexpected input X-Git-Tag: php-5.6.0beta2~1^2~37^2~20^2~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdf1dcc497e890119d03024ee097b687a9b785f8;p=php barf on unexpected input --- diff --git a/phpdbg_lexer.l b/phpdbg_lexer.l index 73998c3d99..6915ab62e0 100644 --- a/phpdbg_lexer.l +++ b/phpdbg_lexer.l @@ -41,7 +41,6 @@ LITERAL \"(\\.|[^\\"])*\" WS [ \r\n\t]+ INPUT [^\n]+ %% -{WS} { } { {C_YES}|{C_ON}|{C_ENABLED}|{C_TRUE} { @@ -104,7 +103,6 @@ INPUT [^\n]+ BEGIN(INITIAL); return T_INPUT; } -. { - /** command detection here **/ -} +{WS} { /* ignore whitespace */ } +. { return T_UNEXPECTED; } %% diff --git a/phpdbg_parser.y b/phpdbg_parser.y index fa53e7956f..9b87847ebc 100644 --- a/phpdbg_parser.y +++ b/phpdbg_parser.y @@ -104,6 +104,7 @@ typedef void* yyscan_t; %token T_FILE "file (T_FILE)" %token T_ID "identifier (T_ID)" %token T_INPUT "input (input string or data)" +%token T_UNEXPECTED "unexpected input (input string or data)" %% input