diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-10-24 19:22:45 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-10-24 19:22:45 +0200 |
| commit | 9b4d9ac6c7fbc6a53aee6c9b199046556e5fef13 (patch) | |
| tree | d6e968764930a4cc3ac99b39cc235c1fec50f4f5 /sapi/phpdbg/phpdbg_lexer.l | |
| parent | 411984c0e9402a4e7c2d2d0cf23069f9eef60860 (diff) | |
| parent | 36399428919ef518bcd744e120e48c00610a8b86 (diff) | |
| download | php-git-9b4d9ac6c7fbc6a53aee6c9b199046556e5fef13.tar.gz | |
Merge phpdbg into PHP-5.6
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); |
