summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_lexer.l
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-10-24 19:29:50 +0200
committerBob Weinand <bobwei9@hotmail.com>2014-10-24 19:29:50 +0200
commit2bcac53bca8ea82d661f057b6d9ff3c7c84f05a7 (patch)
tree681b32fe3d9d342c0461c2641b2d651f095b06f8 /sapi/phpdbg/phpdbg_lexer.l
parent53560ca06b333b71883269091f7d74c0a25e087b (diff)
parentc03ac47bafd0ea55055a2f3d4de0bc6bb4d98d8d (diff)
downloadphp-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.l27
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);