diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-10-24 19:29:50 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-10-24 19:29:50 +0200 |
commit | 2bcac53bca8ea82d661f057b6d9ff3c7c84f05a7 (patch) | |
tree | 681b32fe3d9d342c0461c2641b2d651f095b06f8 /sapi/phpdbg/phpdbg_lexer.l | |
parent | 53560ca06b333b71883269091f7d74c0a25e087b (diff) | |
parent | c03ac47bafd0ea55055a2f3d4de0bc6bb4d98d8d (diff) | |
download | php-git-2bcac53bca8ea82d661f057b6d9ff3c7c84f05a7.tar.gz |
Made phpdbg compatible with new engine
Diffstat (limited to 'sapi/phpdbg/phpdbg_lexer.l')
-rw-r--r-- | sapi/phpdbg/phpdbg_lexer.l | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 7b3ce38c47..0c27fc22ac 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -21,8 +21,9 @@ #define YYFILL(n) #define NORMAL 0 -#define RAW 1 -#define INITIAL 2 +#define PRE_RAW 1 +#define RAW 2 +#define INITIAL 3 ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -65,10 +66,17 @@ INPUT [^\n\000]+ <!*> := yyleng = (size_t) YYCURSOR - (size_t) yytext; -<*>[\n\000] { +<*>{WS}?[\n\000] { return 0; } +<PRE_RAW, NORMAL>[-][r]{WS}?{DIGITS} { + char *text = yytext + 2; + while (*++text < '0'); + yylval->num = atoi(text); + return T_REQ_ID; +} + <NORMAL>{T_IF}{WS} { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); @@ -143,21 +151,28 @@ INPUT [^\n\000]+ } <INITIAL>{T_EVAL}{WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } <INITIAL>{T_SHELL}{WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } <INITIAL>({T_RUN}|{T_RUN_SHORT}){WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; } +<PRE_RAW>. { + YYSETCONDITION(RAW); + + YYCURSOR = LEX(text); + goto restart; +} + <INITIAL>. { YYSETCONDITION(NORMAL); |