diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2015-09-17 22:52:55 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2015-09-17 22:53:10 +0200 |
| commit | adcabcc125094dae8fe1b62dca267e3fa302907d (patch) | |
| tree | 28a53d475349c3b57b8d2fd2d26afec350b17d9b /sapi/phpdbg/phpdbg_lexer.l | |
| parent | 8fe171a3e046717ec0109297bcd765bdee3e939c (diff) | |
| download | php-git-adcabcc125094dae8fe1b62dca267e3fa302907d.tar.gz | |
Add # delimiter to phpdbg commands
Diffstat (limited to 'sapi/phpdbg/phpdbg_lexer.l')
| -rw-r--r-- | sapi/phpdbg/phpdbg_lexer.l | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 197773e2c6..0509c521ec 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -63,7 +63,7 @@ ID [^ \r\n\t:#\000]+ GENERIC_ID ([^ \r\n\t:#\000]|":\\")+ ADDR [0][x][a-fA-F0-9]+ OPCODE (ZEND_|zend_)([A-Za-z])+ -INPUT [^\n\000]+ +INPUT [^\n\000#]+ <!*> := yyleng = (size_t) YYCURSOR - (size_t) yytext; @@ -84,12 +84,19 @@ INPUT [^\n\000]+ return T_IF; } -<NORMAL>"#" { +<NORMAL>"#"/{DIGITS} { return T_POUND; } + +<*>"#" { + YYSETCONDITION(INITIAL); + return T_SEPARATOR; +} + <NORMAL>"::" { return T_DCOLON; } + <NORMAL>":"/[^\\] { return T_COLON; } @@ -157,25 +164,27 @@ INPUT [^\n\000]+ phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } + <INITIAL>{T_SHELL}{WS} { YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } + <INITIAL>({T_RUN}|{T_RUN_SHORT}){WS} { YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; } -<PRE_RAW>. { +<PRE_RAW>[^ ] { YYSETCONDITION(RAW); YYCURSOR = LEX(text); goto restart; } -<INITIAL>. { +<INITIAL>[^ ] { YYSETCONDITION(NORMAL); YYCURSOR = LEX(text); |
