Skip to content

Commit

Permalink
DIRECTOR: LINGO: Fix macro calls as part of statement lists
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 2, 2019
1 parent ede9fcf commit 5740a2a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 45 deletions.
86 changes: 43 additions & 43 deletions engines/director/lingo/lingo-gr.cpp
Expand Up @@ -604,8 +604,8 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 7, 9, 12, 14, 16, 18, 20,
22, 23, 25, 27, 29, 34, 39, 44, 49, 54,
59, 65, 70, 75, 81, 83, 85, 87, 89, 95,
22, 23, 25, 27, 32, 37, 42, 47, 52, 57,
63, 68, 73, 79, 81, 83, 85, 87, 89, 95,
106, 118, 122, 129, 134, 141, 151, 161, 171, 182,
193, 200, 201, 205, 208, 210, 213, 215, 222, 224,
231, 238, 241, 242, 245, 249, 251, 253, 254, 255,
Expand All @@ -628,12 +628,12 @@ static const yytype_int16 yyrhs[] =
{
107, 0, -1, 107, 108, 113, -1, 113, -1, 1,
108, -1, 98, -1, 53, -1, 58, -1, 36, -1,
52, -1, -1, 145, -1, 152, -1, 116, -1, 49,
134, 42, 28, -1, 49, 134, 42, 135, -1, 49,
134, 75, 134, -1, 49, 134, 76, 134, -1, 51,
28, 91, 134, -1, 51, 13, 91, 134, -1, 51,
14, 134, 91, 134, -1, 51, 28, 54, 134, -1,
51, 13, 54, 134, -1, 51, 14, 134, 54, 134,
52, -1, -1, 145, -1, 116, -1, 49, 134, 42,
28, -1, 49, 134, 42, 135, -1, 49, 134, 75,
134, -1, 49, 134, 76, 134, -1, 51, 28, 91,
134, -1, 51, 13, 91, 134, -1, 51, 14, 134,
91, 134, -1, 51, 28, 54, 134, -1, 51, 13,
54, 134, -1, 51, 14, 134, 54, 134, -1, 152,
-1, 134, -1, 136, -1, 115, -1, 117, -1, 125,
123, 131, 130, 32, -1, 126, 91, 134, 130, 54,
134, 130, 131, 130, 32, -1, 126, 91, 134, 130,
Expand Down Expand Up @@ -698,8 +698,8 @@ static const yytype_int16 yyrhs[] =
static const yytype_uint16 yyrline[] =
{
0, 121, 121, 122, 123, 126, 133, 140, 147, 154,
157, 158, 159, 160, 163, 169, 172, 173, 174, 180,
187, 193, 199, 206, 214, 215, 218, 219, 224, 237,
157, 158, 159, 162, 168, 171, 172, 173, 179, 186,
192, 198, 205, 213, 214, 215, 218, 219, 224, 237,
255, 269, 274, 277, 282, 292, 304, 316, 326, 336,
346, 358, 359, 362, 363, 366, 367, 370, 378, 379,
385, 393, 396, 399, 402, 409, 416, 424, 427, 430,
Expand Down Expand Up @@ -773,8 +773,8 @@ static const yytype_uint16 yytoknum[] =
static const yytype_uint8 yyr1[] =
{
0, 106, 107, 107, 107, 108, 109, 110, 111, 112,
113, 113, 113, 113, 114, 114, 114, 114, 114, 114,
114, 114, 114, 114, 115, 115, 116, 116, 116, 116,
113, 113, 113, 114, 114, 114, 114, 114, 114, 114,
114, 114, 114, 115, 115, 115, 116, 116, 116, 116,
116, 116, 116, 116, 117, 117, 117, 117, 117, 117,
117, 118, 118, 119, 119, 120, 120, 121, 122, 122,
122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
Expand All @@ -796,8 +796,8 @@ static const yytype_uint8 yyr1[] =
static const yytype_uint8 yyr2[] =
{
0, 2, 3, 1, 2, 1, 1, 1, 1, 1,
0, 1, 1, 1, 4, 4, 4, 4, 4, 4,
5, 4, 4, 5, 1, 1, 1, 1, 5, 10,
0, 1, 1, 4, 4, 4, 4, 4, 4, 5,
4, 4, 5, 1, 1, 1, 1, 1, 5, 10,
11, 3, 6, 4, 6, 9, 9, 9, 10, 10,
6, 0, 3, 2, 1, 2, 1, 6, 1, 6,
6, 2, 0, 2, 3, 1, 1, 0, 0, 1,
Expand Down Expand Up @@ -825,8 +825,8 @@ static const yytype_uint8 yydefact[] =
0, 0, 55, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
0, 0, 0, 0, 0, 0, 169, 0, 3, 77,
26, 13, 27, 52, 0, 52, 0, 0, 24, 68,
25, 112, 113, 11, 57, 12, 5, 4, 74, 0,
26, 12, 27, 52, 0, 52, 0, 0, 24, 68,
25, 112, 113, 11, 57, 23, 5, 4, 74, 0,
76, 121, 120, 0, 172, 123, 169, 70, 0, 71,
110, 169, 168, 169, 114, 130, 116, 0, 136, 0,
137, 0, 138, 143, 139, 141, 152, 111, 0, 53,
Expand All @@ -843,11 +843,11 @@ static const yytype_uint8 yydefact[] =
59, 58, 51, 58, 6, 57, 57, 31, 0, 57,
87, 88, 85, 86, 89, 90, 82, 93, 94, 95,
92, 78, 79, 80, 81, 83, 84, 161, 0, 124,
173, 72, 73, 131, 144, 160, 14, 15, 16, 17,
22, 19, 0, 0, 21, 18, 160, 127, 135, 102,
173, 72, 73, 131, 144, 160, 13, 14, 15, 16,
21, 18, 0, 0, 20, 17, 160, 127, 135, 102,
0, 104, 0, 106, 0, 108, 0, 100, 101, 133,
125, 169, 171, 60, 61, 0, 0, 58, 0, 33,
58, 0, 167, 0, 23, 20, 0, 0, 0, 0,
58, 0, 167, 0, 22, 19, 0, 0, 0, 0,
0, 0, 28, 0, 0, 57, 58, 0, 162, 0,
57, 167, 167, 103, 105, 107, 109, 126, 0, 58,
34, 7, 57, 0, 40, 32, 163, 158, 57, 57,
Expand Down Expand Up @@ -986,7 +986,7 @@ static const yytype_int16 yytable[] =
36, 37, 38, 0, 0, 39, 40, 41, 42, 0,
0, 43, 44, 0, 0, 0, 0, 45, 0, 0,
0, 46, 2, 3, 4, 5, 0, 6, 7, 8,
9, 10, 0, 11, 12, 13, 0, 14, 68, 16,
9, 10, 0, 11, 12, 13, 0, 14, 15, 16,
0, 17, 324, 18, 0, 0, 0, 19, 0, 20,
21, 22, 0, 0, 0, 0, 0, 0, 0, 24,
25, 26, 0, 0, 0, 27, 0, 0, 0, 0,
Expand All @@ -996,7 +996,7 @@ static const yytype_int16 yytable[] =
42, 0, 0, 43, 44, 0, 0, 0, 66, 45,
0, 0, 0, 46, 2, 3, 4, 5, 0, 6,
7, 8, 9, 10, 0, 11, 12, 13, 0, 14,
68, 16, 0, 17, 0, 18, 0, 0, 0, 19,
15, 16, 0, 17, 0, 18, 0, 0, 0, 19,
0, 20, 21, 22, 0, 0, 0, 0, 0, 0,
0, 24, 25, 26, 0, 0, 0, 27, 0, 0,
0, 0, 0, 30, 31, 0, 32, 0, 0, 0,
Expand All @@ -1005,7 +1005,7 @@ static const yytype_int16 yytable[] =
40, 0, 42, 0, 0, 43, 44, 0, 0, 0,
66, 45, 0, 0, 0, 46, 2, 3, 4, 5,
0, 6, 7, 8, 9, 10, 0, 11, 12, 13,
0, 14, 68, 16, 0, 17, 0, 18, 0, 0,
0, 14, 15, 16, 0, 17, 0, 18, 0, 0,
0, 19, 0, 20, 21, 22, 0, 0, 0, 0,
0, 0, 0, 24, 25, 26, 0, 0, 0, 27,
0, 0, 0, 0, 0, 30, 31, 0, 32, 0,
Expand All @@ -1014,7 +1014,7 @@ static const yytype_int16 yytable[] =
0, 39, 40, 0, 42, 0, 0, 43, 44, 0,
0, 0, 0, 45, 0, 0, 0, 46, 2, 3,
4, 5, 0, 6, 7, 8, 9, 10, 0, 11,
12, 13, 0, 14, 68, 16, 208, 17, 0, 18,
12, 13, 0, 14, 15, 16, 208, 17, 0, 18,
0, 0, 0, 19, 0, 20, 21, 135, 136, 0,
0, 137, 138, 139, 140, 24, 141, 26, 0, 142,
143, 144, 0, 0, 0, 0, 0, 30, 31, 0,
Expand Down Expand Up @@ -2188,8 +2188,8 @@ yyparse ()
{ g_lingo->_inCond = false; ;}
break;

case 14:
#line 163 "engines/director/lingo/lingo-gr.y"
case 13:
#line 162 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str());
Expand All @@ -2198,25 +2198,25 @@ yyparse ()
delete (yyvsp[(4) - (4)].s); ;}
break;

case 15:
#line 169 "engines/director/lingo/lingo-gr.y"
case 14:
#line 168 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_assign);
(yyval.code) = (yyvsp[(2) - (4)].code); ;}
break;

case 16:
#line 172 "engines/director/lingo/lingo-gr.y"
case 15:
#line 171 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->code1(g_lingo->c_after); ;}
break;

case 17:
#line 173 "engines/director/lingo/lingo-gr.y"
case 16:
#line 172 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->code1(g_lingo->c_before); ;}
break;

case 18:
#line 174 "engines/director/lingo/lingo-gr.y"
case 17:
#line 173 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
Expand All @@ -2225,8 +2225,8 @@ yyparse ()
delete (yyvsp[(2) - (4)].s); ;}
break;

case 19:
#line 180 "engines/director/lingo/lingo-gr.y"
case 18:
#line 179 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_intpush);
g_lingo->codeInt(0); // Put dummy id
Expand All @@ -2236,8 +2236,8 @@ yyparse ()
(yyval.code) = (yyvsp[(4) - (4)].code); ;}
break;

case 20:
#line 187 "engines/director/lingo/lingo-gr.y"
case 19:
#line 186 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_swap);
g_lingo->code1(g_lingo->c_theentityassign);
Expand All @@ -2246,8 +2246,8 @@ yyparse ()
(yyval.code) = (yyvsp[(5) - (5)].code); ;}
break;

case 21:
#line 193 "engines/director/lingo/lingo-gr.y"
case 20:
#line 192 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
Expand All @@ -2256,8 +2256,8 @@ yyparse ()
delete (yyvsp[(2) - (4)].s); ;}
break;

case 22:
#line 199 "engines/director/lingo/lingo-gr.y"
case 21:
#line 198 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_intpush);
g_lingo->codeInt(0); // Put dummy id
Expand All @@ -2267,8 +2267,8 @@ yyparse ()
(yyval.code) = (yyvsp[(4) - (4)].code); ;}
break;

case 23:
#line 206 "engines/director/lingo/lingo-gr.y"
case 22:
#line 205 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_swap);
g_lingo->code1(g_lingo->c_theentityassign);
Expand Down
4 changes: 2 additions & 2 deletions engines/director/lingo/lingo-gr.y
Expand Up @@ -156,7 +156,6 @@ then: tTHEN { g_lingo->_inCond = false; }

programline: /* empty */
| defn
| macro
| stmt
;

Expand Down Expand Up @@ -211,7 +210,8 @@ asgn: tPUT expr tINTO ID {
$$ = $5; }
;

stmtoneliner: expr
stmtoneliner: macro
| expr
| proc
;

Expand Down
1 change: 1 addition & 0 deletions engines/director/lingo/tests/macros.lingo
Expand Up @@ -21,6 +21,7 @@ exit
end if
if x >1 then
put x
check x, 5
exit
end if

Expand Down

0 comments on commit 5740a2a

Please sign in to comment.