Skip to content

Commit 16ae792

Browse files
committed
Fix issue krakjoe/phpdbg#98
break if does not seem to work
1 parent ef77d84 commit 16ae792

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

phpdbg_parser.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ union yyalloc
436436
/* YYFINAL -- State number of the termination state. */
437437
#define YYFINAL 25
438438
/* YYLAST -- Last index in YYTABLE. */
439-
#define YYLAST 41
439+
#define YYLAST 42
440440

441441
/* YYNTOKENS -- Number of terminals. */
442442
#define YYNTOKENS 21
@@ -493,8 +493,8 @@ static const yytype_uint8 yytranslate[] =
493493
static const yytype_uint8 yyprhs[] =
494494
{
495495
0, 0, 3, 5, 7, 8, 10, 13, 17, 22,
496-
27, 33, 37, 43, 47, 49, 51, 53, 55, 57,
497-
59, 61, 64, 67, 70, 72
496+
27, 33, 37, 43, 47, 50, 52, 54, 56, 58,
497+
60, 62, 64, 67, 70, 72
498498
};
499499

500500
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -504,18 +504,18 @@ static const yytype_int8 yyrhs[] =
504504
23, 24, -1, 18, 10, 14, -1, 18, 10, 12,
505505
14, -1, 13, 18, 10, 14, -1, 13, 18, 10,
506506
12, 14, -1, 18, 11, 18, -1, 18, 11, 18,
507-
12, 14, -1, 18, 12, 14, -1, 17, -1, 16,
508-
-1, 15, -1, 7, -1, 8, -1, 14, -1, 18,
509-
-1, 6, 19, -1, 3, 19, -1, 5, 19, -1,
507+
12, 14, -1, 18, 12, 14, -1, 6, 19, -1,
508+
17, -1, 16, -1, 15, -1, 7, -1, 8, -1,
509+
14, -1, 18, -1, 3, 19, -1, 5, 19, -1,
510510
4, -1, 4, 19, -1
511511
};
512512

513513
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
514514
static const yytype_uint8 yyrline[] =
515515
{
516516
0, 66, 66, 67, 68, 72, 73, 77, 82, 87,
517-
97, 107, 112, 118, 124, 125, 126, 127, 128, 129,
518-
130, 134, 139, 144, 149, 153
517+
97, 107, 112, 118, 124, 129, 130, 131, 132, 133,
518+
134, 135, 139, 144, 149, 153
519519
};
520520
#endif
521521

@@ -552,25 +552,25 @@ static const yytype_uint8 yyr1[] =
552552
{
553553
0, 21, 22, 22, 22, 23, 23, 24, 24, 24,
554554
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
555-
24, 25, 25, 25, 25, 25
555+
24, 24, 25, 25, 25, 25
556556
};
557557

558558
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
559559
static const yytype_uint8 yyr2[] =
560560
{
561561
0, 2, 1, 1, 0, 1, 2, 3, 4, 4,
562-
5, 3, 5, 3, 1, 1, 1, 1, 1, 1,
563-
1, 2, 2, 2, 1, 2
562+
5, 3, 5, 3, 2, 1, 1, 1, 1, 1,
563+
1, 1, 2, 2, 1, 2
564564
};
565565

566566
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
567567
Performed when YYTABLE doesn't specify something else to do. Zero
568568
means the default is an error. */
569569
static const yytype_uint8 yydefact[] =
570570
{
571-
4, 0, 24, 0, 0, 17, 18, 0, 19, 16,
572-
15, 14, 20, 0, 2, 5, 3, 22, 25, 23,
573-
21, 0, 0, 0, 0, 1, 6, 0, 0, 7,
571+
4, 0, 24, 0, 0, 18, 19, 0, 20, 17,
572+
16, 15, 21, 0, 2, 5, 3, 22, 25, 23,
573+
14, 0, 0, 0, 0, 1, 6, 0, 0, 7,
574574
11, 13, 0, 9, 8, 0, 10, 12
575575
};
576576

@@ -585,16 +585,16 @@ static const yytype_int8 yydefgoto[] =
585585
#define YYPACT_NINF -11
586586
static const yytype_int8 yypact[] =
587587
{
588-
-3, -10, 10, 11, 12, -11, -11, 14, -11, -11,
589-
-11, -11, -4, 28, 9, -11, -11, -11, -11, -11,
590-
-11, 23, 6, 16, 21, -11, -11, 7, 22, -11,
591-
25, -11, 24, -11, -11, 26, -11, -11
588+
-3, -10, 11, 12, 13, -11, -11, 15, -11, -11,
589+
-11, -11, -4, 29, 10, -11, -11, -11, -11, -11,
590+
-11, 24, 7, 17, 22, -11, -11, 8, 23, -11,
591+
26, -11, 25, -11, -11, 27, -11, -11
592592
};
593593

594594
/* YYPGOTO[NTERM-NUM]. */
595595
static const yytype_int8 yypgoto[] =
596596
{
597-
-11, -11, -11, 27, -11
597+
-11, -11, -11, 28, -11
598598
};
599599

600600
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -604,10 +604,10 @@ static const yytype_int8 yypgoto[] =
604604
static const yytype_uint8 yytable[] =
605605
{
606606
1, 2, 3, 4, 5, 6, 22, 23, 24, 17,
607-
7, 8, 9, 10, 11, 12, 5, 6, 28, 32,
608-
29, 33, 7, 8, 9, 10, 11, 12, 25, 18,
609-
19, 20, 21, 27, 30, 31, 34, 35, 36, 0,
610-
37, 26
607+
7, 8, 9, 10, 11, 12, 4, 5, 6, 28,
608+
32, 29, 33, 7, 8, 9, 10, 11, 12, 25,
609+
18, 19, 20, 21, 27, 30, 31, 34, 35, 36,
610+
0, 37, 26
611611
};
612612

613613
#define yypact_value_is_default(yystate) \
@@ -619,10 +619,10 @@ static const yytype_uint8 yytable[] =
619619
static const yytype_int8 yycheck[] =
620620
{
621621
3, 4, 5, 6, 7, 8, 10, 11, 12, 19,
622-
13, 14, 15, 16, 17, 18, 7, 8, 12, 12,
623-
14, 14, 13, 14, 15, 16, 17, 18, 0, 19,
624-
19, 19, 18, 10, 18, 14, 14, 12, 14, -1,
625-
14, 14
622+
13, 14, 15, 16, 17, 18, 6, 7, 8, 12,
623+
12, 14, 14, 13, 14, 15, 16, 17, 18, 0,
624+
19, 19, 19, 18, 10, 18, 14, 14, 12, 14,
625+
-1, 14, 14
626626
};
627627

628628
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1563,53 +1563,53 @@ YYSTYPE yylval;
15631563
case 14:
15641564
/* Line 1802 of yacc.c */
15651565
#line 124 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1566-
{ (yyval) = (yyvsp[(1) - (1)]); }
1566+
{
1567+
(yyval).type = COND_PARAM;
1568+
(yyval).str = (yyvsp[(2) - (2)]).str;
1569+
(yyval).len = (yyvsp[(2) - (2)]).len;
1570+
}
15671571
break;
15681572

15691573
case 15:
15701574
/* Line 1802 of yacc.c */
1571-
#line 125 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1575+
#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
15721576
{ (yyval) = (yyvsp[(1) - (1)]); }
15731577
break;
15741578

15751579
case 16:
15761580
/* Line 1802 of yacc.c */
1577-
#line 126 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1581+
#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
15781582
{ (yyval) = (yyvsp[(1) - (1)]); }
15791583
break;
15801584

15811585
case 17:
15821586
/* Line 1802 of yacc.c */
1583-
#line 127 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1587+
#line 131 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
15841588
{ (yyval) = (yyvsp[(1) - (1)]); }
15851589
break;
15861590

15871591
case 18:
15881592
/* Line 1802 of yacc.c */
1589-
#line 128 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1593+
#line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
15901594
{ (yyval) = (yyvsp[(1) - (1)]); }
15911595
break;
15921596

15931597
case 19:
15941598
/* Line 1802 of yacc.c */
1595-
#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1599+
#line 133 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
15961600
{ (yyval) = (yyvsp[(1) - (1)]); }
15971601
break;
15981602

15991603
case 20:
16001604
/* Line 1802 of yacc.c */
1601-
#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1605+
#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
16021606
{ (yyval) = (yyvsp[(1) - (1)]); }
16031607
break;
16041608

16051609
case 21:
16061610
/* Line 1802 of yacc.c */
1607-
#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1608-
{
1609-
(yyval).type = COND_PARAM;
1610-
(yyval).str = (yyvsp[(2) - (2)]).str;
1611-
(yyval).len = (yyvsp[(2) - (2)]).len;
1612-
}
1611+
#line 135 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y"
1612+
{ (yyval) = (yyvsp[(1) - (1)]); }
16131613
break;
16141614

16151615
case 22:

phpdbg_parser.y

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ parameter
121121
$$.len = $1.len;
122122
$$.num = $3.num;
123123
}
124+
| T_IF T_INPUT {
125+
$$.type = COND_PARAM;
126+
$$.str = $2.str;
127+
$$.len = $2.len;
128+
}
124129
| T_OPCODE { $$ = $1; }
125130
| T_ADDR { $$ = $1; }
126131
| T_LITERAL { $$ = $1; }
@@ -131,12 +136,7 @@ parameter
131136
;
132137

133138
full_expression
134-
: T_IF T_INPUT {
135-
$$.type = COND_PARAM;
136-
$$.str = $2.str;
137-
$$.len = $2.len;
138-
}
139-
| T_EVAL T_INPUT {
139+
: T_EVAL T_INPUT {
140140
$$.type = EVAL_PARAM;
141141
$$.str = $2.str;
142142
$$.len = $2.len;

0 commit comments

Comments
 (0)