summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_lexer.l
diff options
context:
space:
mode:
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);