From cdf1dcc497e890119d03024ee097b687a9b785f8 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sat, 15 Feb 2014 20:05:44 +0000 Subject: [PATCH] barf on unexpected input --- phpdbg_lexer.l | 6 ++---- phpdbg_parser.y | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/phpdbg_lexer.l b/phpdbg_lexer.l index 73998c3d994..6915ab62e04 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 fa53e7956f7..9b87847ebc9 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