summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_parser.y
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2014-10-26 16:58:45 -0700
committerRasmus Lerdorf <rasmus@php.net>2014-10-26 16:58:45 -0700
commit8d84b1f67adb71bdb2394b62faad04b22f6226f3 (patch)
tree0c1c1ed2aaef8eee971575eb5e336631295f4951 /sapi/phpdbg/phpdbg_parser.y
parentfb85d0322d39d49f37e32df6f68c9769f2cce0e4 (diff)
parent09da8952d0434b53e740ffaca66a8051cd39cf93 (diff)
downloadphp-git-8d84b1f67adb71bdb2394b62faad04b22f6226f3.tar.gz
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (240 commits) Do not execute anything after quit or clean command Fix last commit, and do not output unnecessary information Stabilize execution, always run destructors and extended file breakpoints Fix nullptr dereference in clean without exec context remove dodgy param parser, bring userland breakpoint api inline with PHP7 disable output buffering by default Add question to reset execution in run/exec/clean - Updated to version 2014.9 (2014i) actually remove this disable output buffering, better breakpoint api for userland, remove hand parsing of params Fix phpdbg output when outputting via php with active output handlers Fixed Closure::call() NEWS/UPGRADING Set engine back to initial state after fatal-ed ev command Fix eventual stack overflow after clean cmd Fix listing of files with no absolute path updated libmagic.patch in master updated libmagic.patch in 5.6 updated libmagic.patch in 5.5 NEWS NEWS ...
Diffstat (limited to 'sapi/phpdbg/phpdbg_parser.y')
-rw-r--r--sapi/phpdbg/phpdbg_parser.y29
1 files changed, 18 insertions, 11 deletions
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index 702bf78455..e4353976f3 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -59,6 +59,7 @@ typedef void* yyscan_t;
%token T_ID "identifier (command or function name)"
%token T_INPUT "input (input string or data)"
%token T_UNEXPECTED "input"
+%token T_REQ_ID "request id (-r %d)"
%% /* Rules */
@@ -71,6 +72,7 @@ input
parameters
: parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$1); }
| parameters parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$2); }
+ | parameters req_id { $$ = $1; }
;
parameter
@@ -135,32 +137,37 @@ parameter
| T_ID { $$ = $1; }
;
+req_id
+ : T_REQ_ID { PHPDBG_G(req_id) = $1.num; }
+ | /* empty */
+;
+
full_expression
- : T_EVAL T_INPUT {
+ : T_EVAL req_id T_INPUT {
$$.type = EVAL_PARAM;
- $$.str = $2.str;
- $$.len = $2.len;
+ $$.str = $3.str;
+ $$.len = $3.len;
}
- | T_SHELL T_INPUT {
+ | T_SHELL req_id T_INPUT {
$$.type = SHELL_PARAM;
- $$.str = $2.str;
- $$.len = $2.len;
+ $$.str = $3.str;
+ $$.len = $3.len;
}
- | T_RUN {
+ | T_RUN req_id {
$$.type = RUN_PARAM;
$$.len = 0;
}
- | T_RUN T_INPUT {
+ | T_RUN req_id T_INPUT {
$$.type = RUN_PARAM;
- $$.str = $2.str;
- $$.len = $2.len;
+ $$.str = $3.str;
+ $$.len = $3.len;
}
;
%%
static int yyerror(void ***tsrm_ls, const char *msg) {
- phpdbg_error("Parse Error: %s", msg);
+ phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg);
{
const phpdbg_param_t *top = PHPDBG_G(parser_stack);