com php-src: barf on unexpected input: phpdbg_lexer.l php dbg_parser.y
| From: | Bob Weinand | Date: | Sat, 15 Feb 2014 20:05:44 +0000 |
| Subject: | com php-src: barf on unexpected input: phpdbg_lexer.l php dbg_parser.y | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77077@lists.php.net to get a copy of this message | ||
Commit: cdf1dcc497e890119d03024ee097b687a9b785f8
Author: krakjoe <joe.watkins@live.co.uk> Sat, 15 Feb 2014 20:05:44 +0000
Parents: a01853de7890a3058a79666d1359b63b729d586a
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cdf1dcc497e890119d03024ee097b687a9b785f8
Log:
barf on unexpected input
Changed paths:
M phpdbg_lexer.l
M phpdbg_parser.y
Diff:
diff --git a/phpdbg_lexer.l b/phpdbg_lexer.l
index 73998c3..6915ab6 100644
--- a/phpdbg_lexer.l
+++ b/phpdbg_lexer.l
@@ -41,7 +41,6 @@ LITERAL \"(\\.|[^\\"])*\"
WS [ \r\n\t]+
INPUT [^\n]+
%%
-{WS} { }
<INITIAL>
{
{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 fa53e79..9b87847 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