aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-07-07 19:40:18 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitbfe252edac5e5c0de769cfee7dff4ce8b4ba4487 (patch)
treed77613b600b076cf8e93ec4e04bf197fa63ab8de
parent6636c9006bf9e274f6d7e85556f3426e4b3594df (diff)
downloadscummvm-rg350-bfe252edac5e5c0de769cfee7dff4ce8b4ba4487.tar.gz
scummvm-rg350-bfe252edac5e5c0de769cfee7dff4ce8b4ba4487.tar.bz2
scummvm-rg350-bfe252edac5e5c0de769cfee7dff4ce8b4ba4487.zip
DIRECTOR: Lingo: Fix multiline if statements
-rw-r--r--engines/director/director.cpp8
-rw-r--r--engines/director/lingo/lingo-gr.cpp281
-rw-r--r--engines/director/lingo/lingo-gr.y2
3 files changed, 147 insertions, 144 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 8dc9ca7f67..b41468dfd3 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -109,19 +109,19 @@ Common::Error DirectorEngine::run() {
_currentScore = nullptr;
_lingo->addCode("--\n\
- if x = 3 then exit\n\
- else if x = 4 then put 4\n\
- else put 10.0\n\
set x = 1\n\
if x = 5 then exit\n\
else put 10.0\n\
repeat with x = 1 to 5\n\
+ if x = 3 then put 30\n\
+ else if x = 4 then put 40\n\
+ else put 10.0\n\
if x = 1 then\n\
put 1\n\
else if x = 2 then\n\
put 2.1\n\
put 2.2\n\
- else if x = 3 then put 3\n\
+ else if x = 3 then put 3\n\
end if\n\
if x = 4 then put 4\n\
else put 5\n\
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index f295ea0bc3..eea173f3bc 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -432,7 +432,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 61
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 384
+#define YYLAST 392
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 57
@@ -441,7 +441,7 @@ union yyalloc
/* YYNRULES -- Number of rules. */
#define YYNRULES 96
/* YYNRULES -- Number of states. */
-#define YYNSTATES 205
+#define YYNSTATES 206
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -492,14 +492,14 @@ static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 7, 9, 11, 12, 14, 16, 18,
20, 22, 24, 29, 34, 39, 41, 43, 45, 47,
- 56, 68, 81, 90, 102, 114, 121, 132, 143, 144,
- 148, 151, 153, 160, 162, 168, 170, 174, 178, 181,
- 185, 187, 189, 190, 191, 192, 195, 198, 200, 202,
- 207, 212, 214, 216, 220, 224, 228, 232, 236, 240,
- 244, 248, 252, 255, 258, 262, 265, 268, 271, 273,
- 275, 278, 280, 284, 287, 290, 293, 296, 300, 303,
- 307, 310, 313, 315, 319, 322, 326, 327, 336, 337,
- 339, 343, 348, 349, 353, 354, 356
+ 56, 68, 81, 90, 102, 115, 122, 133, 144, 145,
+ 149, 152, 154, 161, 163, 169, 171, 175, 179, 182,
+ 186, 188, 190, 191, 192, 193, 196, 199, 201, 203,
+ 208, 213, 215, 217, 221, 225, 229, 233, 237, 241,
+ 245, 249, 253, 256, 259, 263, 266, 269, 272, 274,
+ 276, 279, 281, 285, 288, 291, 294, 297, 301, 304,
+ 308, 311, 314, 316, 320, 323, 327, 328, 337, 338,
+ 340, 344, 349, 350, 354, 355, 357
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -516,31 +516,32 @@ static const yytype_int8 yyrhs[] =
-1, 72, 69, 34, 59, 76, 75, 16, 21, -1,
72, 69, 34, 59, 76, 75, 14, 76, 75, 16,
21, -1, 72, 69, 34, 59, 76, 75, 74, 66,
- 75, 16, 21, -1, 72, 69, 34, 74, 62, 75,
- -1, 72, 69, 34, 74, 62, 75, 38, 74, 62,
- 75, -1, 72, 69, 34, 74, 62, 75, 67, 75,
- 65, 75, -1, -1, 38, 74, 62, -1, 66, 68,
- -1, 68, -1, 73, 69, 34, 74, 63, 75, -1,
- 67, -1, 73, 69, 34, 76, 75, -1, 77, -1,
- 77, 45, 77, -1, 52, 69, 53, -1, 32, 37,
- -1, 32, 36, 10, -1, 21, -1, 15, -1, -1,
- -1, -1, 76, 59, -1, 76, 63, -1, 7, -1,
- 8, -1, 9, 52, 88, 53, -1, 10, 52, 88,
- 53, -1, 10, -1, 61, -1, 77, 46, 77, -1,
- 77, 47, 77, -1, 77, 48, 77, -1, 77, 49,
- 77, -1, 77, 54, 77, -1, 77, 55, 77, -1,
- 77, 44, 77, -1, 77, 39, 77, -1, 77, 40,
- 77, -1, 46, 77, -1, 47, 77, -1, 52, 77,
- 53, -1, 25, 11, -1, 26, 10, -1, 31, 77,
- -1, 80, -1, 17, -1, 19, 79, -1, 10, -1,
- 79, 56, 10, -1, 20, 23, -1, 20, 28, -1,
- 20, 30, -1, 20, 81, -1, 20, 81, 82, -1,
- 20, 82, -1, 35, 18, 11, -1, 18, 11, -1,
- 35, 11, -1, 11, -1, 29, 27, 11, -1, 27,
- 11, -1, 35, 27, 11, -1, -1, 24, 10, 84,
- 74, 85, 59, 86, 76, -1, -1, 10, -1, 85,
- 56, 10, -1, 85, 59, 56, 10, -1, -1, 10,
- 74, 88, -1, -1, 77, -1, 88, 56, 77, -1
+ 75, 59, 16, 21, -1, 72, 69, 34, 74, 62,
+ 75, -1, 72, 69, 34, 74, 62, 75, 38, 74,
+ 62, 75, -1, 72, 69, 34, 74, 62, 75, 67,
+ 75, 65, 75, -1, -1, 38, 74, 62, -1, 66,
+ 68, -1, 68, -1, 73, 69, 34, 74, 63, 75,
+ -1, 67, -1, 73, 69, 34, 76, 75, -1, 77,
+ -1, 77, 45, 77, -1, 52, 69, 53, -1, 32,
+ 37, -1, 32, 36, 10, -1, 21, -1, 15, -1,
+ -1, -1, -1, 76, 59, -1, 76, 63, -1, 7,
+ -1, 8, -1, 9, 52, 88, 53, -1, 10, 52,
+ 88, 53, -1, 10, -1, 61, -1, 77, 46, 77,
+ -1, 77, 47, 77, -1, 77, 48, 77, -1, 77,
+ 49, 77, -1, 77, 54, 77, -1, 77, 55, 77,
+ -1, 77, 44, 77, -1, 77, 39, 77, -1, 77,
+ 40, 77, -1, 46, 77, -1, 47, 77, -1, 52,
+ 77, 53, -1, 25, 11, -1, 26, 10, -1, 31,
+ 77, -1, 80, -1, 17, -1, 19, 79, -1, 10,
+ -1, 79, 56, 10, -1, 20, 23, -1, 20, 28,
+ -1, 20, 30, -1, 20, 81, -1, 20, 81, 82,
+ -1, 20, 82, -1, 35, 18, 11, -1, 18, 11,
+ -1, 35, 11, -1, 11, -1, 29, 27, 11, -1,
+ 27, 11, -1, 35, 27, 11, -1, -1, 24, 10,
+ 84, 74, 85, 59, 86, 76, -1, -1, 10, -1,
+ 85, 56, 10, -1, 85, 59, 56, 10, -1, -1,
+ 10, 74, 88, -1, -1, 77, -1, 88, 56, 77,
+ -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
@@ -614,7 +615,7 @@ static const yytype_uint8 yyr2[] =
{
0, 2, 3, 1, 1, 0, 1, 1, 1, 1,
1, 1, 4, 4, 4, 1, 1, 1, 1, 8,
- 11, 12, 8, 11, 11, 6, 10, 10, 0, 3,
+ 11, 12, 8, 11, 12, 6, 10, 10, 0, 3,
2, 1, 6, 1, 5, 1, 3, 3, 2, 3,
1, 1, 0, 0, 0, 2, 2, 1, 1, 4,
4, 1, 1, 3, 3, 3, 3, 3, 3, 3,
@@ -648,8 +649,8 @@ static const yytype_uint8 yydefact[] =
43, 0, 91, 87, 19, 44, 43, 43, 22, 43,
33, 31, 0, 0, 28, 0, 43, 0, 0, 30,
0, 0, 43, 42, 43, 42, 0, 0, 0, 0,
- 42, 26, 0, 27, 0, 0, 20, 23, 24, 43,
- 29, 43, 21, 34, 32
+ 42, 26, 0, 27, 0, 0, 20, 23, 0, 43,
+ 29, 43, 21, 24, 34, 32
};
/* YYDEFGOTO[NTERM-NUM]. */
@@ -663,39 +664,39 @@ static const yytype_int16 yydefgoto[] =
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -124
+#define YYPACT_NINF -127
static const yytype_int16 yypact[] =
{
- 144, -124, -124, -124, -40, 329, -124, 23, 288, -124,
- 28, 29, 37, 173, 6, 42, 173, 173, 173, 7,
- -124, 9, -124, -124, -124, 5, 17, 219, 317, -124,
- -124, -124, -124, 173, 173, 173, -124, 8, -124, 50,
- -124, 57, -124, 53, -124, 12, -3, -124, -124, -124,
- -124, 38, 173, -124, 87, 71, -124, -14, 148, 148,
- 293, -124, -124, 144, 219, 173, 219, 55, 305, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 317, -12,
- -2, 35, 82, -124, -124, 84, -124, 91, 92, 66,
- -124, -124, 87, 88, -124, 173, 173, -124, -124, 51,
- 317, 54, 281, 59, 173, 317, 317, 317, 241, 241,
- 148, 148, 317, 317, -124, 173, -124, -124, -124, -124,
- -124, 96, -124, 317, 317, -124, 2, -124, -124, 267,
- 317, 317, -124, -43, 190, 77, 173, 190, -124, -124,
- 103, 63, -124, -124, 104, 173, 317, 13, -13, -124,
- 111, -124, 90, 317, -124, -124, 102, 110, -124, -124,
- -124, 219, -124, 190, -124, -124, 190, 190, -124, 110,
- -124, -124, 219, 267, 100, 94, 190, 113, 123, -124,
- 124, 114, -124, -124, -124, -124, 134, 125, 135, 137,
- -5, -124, 267, -124, 236, 127, -124, -124, -124, 190,
- -124, -124, -124, -124, -124
+ 164, -127, -127, -127, -18, -24, -127, 19, 308, -127,
+ 25, 54, 63, 123, -23, 73, 123, 123, 123, 8,
+ -127, 10, -127, -127, -127, 41, 39, 192, 337, -127,
+ -127, -127, -127, 123, 123, 123, -127, 42, -127, 99,
+ -127, 103, -127, 88, -127, 79, 33, -127, -127, -127,
+ -127, 65, 123, -127, -3, 109, -127, 13, 68, 68,
+ 313, -127, -127, 164, 192, 123, 192, 87, 325, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123, 337, 32,
+ 38, 70, 118, -127, -127, 124, -127, 125, 126, 102,
+ -127, -127, -3, 128, -127, 123, 123, -127, -127, 86,
+ 337, 91, 301, 94, 123, 337, 337, 337, 230, 230,
+ 68, 68, 337, 337, -127, 123, -127, -127, -127, -127,
+ -127, 136, -127, 337, 337, -127, -2, -127, -127, 287,
+ 337, 337, -127, -39, 210, 112, 123, 210, -127, -127,
+ 138, 93, -127, -127, 135, 123, 337, 89, 11, -127,
+ 142, -127, 121, 337, -127, -127, 137, 145, -127, -127,
+ -127, 192, -127, 210, -127, -127, 210, 210, -127, 145,
+ -127, -127, 192, 287, 129, 127, 210, 146, 152, -127,
+ 94, 144, -127, -127, -127, -127, 160, 148, 161, 170,
+ -9, -127, 287, -127, 256, 155, -127, -127, 171, 210,
+ -127, -127, -127, -127, -127, -127
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -124, -124, -15, 97, 16, -123, 0, -124, -124, -124,
- 18, 3, -61, -124, -124, -124, 19, -4, -52, -106,
- 1, 20, -124, -124, -124, 128, -124, -124, -124, -124,
- -124, 21
+ -127, -127, -17, 130, 4, -126, 0, -127, -127, -127,
+ 43, 29, -59, -127, -127, -127, 55, -4, -42, -101,
+ 5, 9, -127, -127, -127, 158, -127, -127, -127, -127,
+ -127, 21
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -705,88 +706,90 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -52
static const yytype_int16 yytable[] =
{
- 23, 35, 158, 99, 63, 101, 138, 61, 62, -9,
- -44, -44, 33, 140, 54, 135, 21, 58, 59, 60,
- 29, 95, 137, 86, 41, 159, 43, 155, 68, 156,
- 87, 96, 89, 36, 78, 78, 78, 136, 48, 88,
- 49, 114, 55, 56, 115, 163, -44, 50, 166, 167,
- 182, 116, 57, 92, 115, 80, 81, 64, 62, 176,
- -9, 83, 65, 23, 82, 68, 100, 102, 84, 200,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 21,
- 85, 94, 144, 29, 199, 147, 148, 121, 128, 103,
- 34, 115, 117, 88, 154, 118, 123, 124, 122, 129,
- 175, 165, 119, 120, 125, 130, 132, 127, 174, 93,
- 62, 181, 145, 149, 177, 178, 131, 180, 141, 150,
- 152, 162, 164, 168, 186, 158, 69, 70, 185, 187,
- 191, 71, 193, 72, 73, 74, 75, 146, 183, 188,
- 189, 76, 77, 157, -5, 1, 153, 203, 190, 204,
- 195, 2, 3, 4, 5, 173, 197, 196, 198, 202,
- 98, 6, 68, 7, 8, 9, 160, 161, 10, 11,
- 12, 0, 179, 68, 90, 13, 14, 15, 0, 192,
- 2, 3, 4, 51, 0, 0, 0, 69, 70, 0,
- 16, 17, 71, 0, 201, -5, 18, 2, 3, 4,
- 51, 0, 76, 77, 52, 0, 15, 6, 0, 7,
- 8, 9, 0, 0, 0, 11, 12, 0, 0, 16,
- 17, 13, 14, 15, 0, 18, 2, 3, 4, 51,
+ 23, 35, 63, 138, 21, 99, -44, 101, 61, 29,
+ -9, 135, 62, 55, 56, -51, -51, 140, 54, 93,
+ -51, 58, 59, 60, -51, -51, 158, 137, 34, 36,
+ -51, -51, 68, 136, 33, 48, 69, 70, 78, 78,
+ 78, 71, -44, 72, 73, 74, 75, 182, 95, 159,
+ 163, 76, 77, 166, 167, 80, 81, 92, 96, 62,
+ 41, -9, 43, 23, 176, 49, 200, 21, 89, 68,
+ 100, 102, 29, 50, 105, 106, 107, 108, 109, 110,
+ 111, 112, 113, 57, 65, 114, 128, 121, 115, 199,
+ 86, 116, 144, 64, 115, 147, 148, 87, 82, 129,
+ 123, 124, 175, 155, 154, 156, 88, 69, 70, 130,
+ 83, 165, 71, 181, 84, 85, 141, 34, 174, 94,
+ 131, 103, 76, 77, 177, 178, 115, 180, 117, 88,
+ 2, 3, 4, 51, 186, 118, 119, 120, 122, 125,
+ 191, 146, 193, 157, 127, 62, 132, 145, 149, 150,
+ 153, 152, 162, 164, 52, 173, 15, 204, 168, 205,
+ 158, 185, 187, 189, -5, 1, 68, 183, 188, 16,
+ 17, 2, 3, 4, 5, 18, 195, 68, 190, 192,
+ 196, 6, 197, 7, 8, 9, 198, 202, 10, 11,
+ 12, 160, 203, 98, 201, 13, 14, 15, 179, 2,
+ 3, 4, 51, 161, 90, 0, 0, 0, 0, 0,
+ 16, 17, 0, 0, 0, -5, 18, 2, 3, 4,
+ 51, 0, 0, 52, 0, 15, 0, 6, 0, 7,
+ 8, 9, 0, 0, 0, 11, 12, 0, 16, 17,
+ 0, 13, 14, 15, 66, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 16, 17, 0, 0,
- 0, 62, 18, 2, 3, 4, 51, 0, 0, 0,
- 52, 0, 15, 6, 0, 7, 8, 9, 0, 0,
- 0, 11, 12, 0, 0, 16, 17, 13, 14, 15,
- 0, 66, 0, 0, 2, 3, 4, 51, 0, 0,
- 69, 70, 16, 17, 6, 71, 7, 8, 18, 74,
- 75, 0, 11, 12, 0, 76, 77, 0, 13, 38,
+ 0, 62, 18, 2, 3, 4, 51, 0, 0, 69,
+ 70, 0, 0, 6, 71, 7, 8, 9, 74, 75,
+ 0, 11, 12, 0, 76, 77, 0, 13, 14, 15,
+ 0, 0, 0, 0, 2, 3, 4, 51, 0, 0,
+ 0, 0, 16, 17, 6, 0, 7, 8, 18, 0,
+ 0, 0, 11, 12, 0, 0, 0, 0, 13, 38,
15, 0, 0, 0, 0, 0, 39, 0, 0, 0,
0, 40, 0, 16, 17, 41, 42, 43, 44, 18,
69, 70, 0, 45, 0, 71, 104, 72, 73, 74,
75, 0, 69, 70, 97, 76, 77, 71, 0, 72,
73, 74, 75, 0, 69, 70, 97, 76, 77, 71,
104, 72, 73, 74, 75, 0, 69, 70, 0, 76,
- 77, 71, 0, 72, 73, 74, 75, 0, -51, -51,
- 0, 76, 77, -51, 0, 0, 0, -51, -51, 0,
- 0, 34, 0, -51, -51
+ 77, 71, 0, 72, 73, 74, 75, 0, 0, 0,
+ 0, 76, 77
};
static const yytype_int16 yycheck[] =
{
- 0, 5, 15, 64, 19, 66, 129, 0, 51, 0,
- 15, 16, 52, 56, 13, 13, 0, 16, 17, 18,
- 0, 35, 128, 11, 27, 38, 29, 14, 27, 16,
- 18, 45, 35, 10, 33, 34, 35, 35, 10, 27,
- 11, 53, 36, 37, 56, 151, 51, 10, 154, 155,
- 173, 53, 10, 52, 56, 34, 35, 52, 51, 165,
- 51, 11, 45, 63, 56, 64, 65, 66, 11, 192,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 63,
- 27, 10, 134, 63, 190, 137, 138, 91, 103, 34,
- 52, 56, 10, 27, 146, 11, 95, 96, 10, 103,
- 161, 153, 11, 11, 53, 104, 10, 53, 160, 22,
- 51, 172, 35, 10, 166, 167, 115, 169, 133, 56,
- 16, 10, 32, 21, 176, 15, 39, 40, 34, 16,
- 182, 44, 184, 46, 47, 48, 49, 136, 38, 16,
- 16, 54, 55, 147, 0, 1, 145, 199, 34, 201,
- 16, 7, 8, 9, 10, 159, 21, 32, 21, 32,
- 63, 17, 161, 19, 20, 21, 148, 148, 24, 25,
- 26, -1, 169, 172, 46, 31, 32, 33, -1, 183,
- 7, 8, 9, 10, -1, -1, -1, 39, 40, -1,
- 46, 47, 44, -1, 194, 51, 52, 7, 8, 9,
- 10, -1, 54, 55, 31, -1, 33, 17, -1, 19,
- 20, 21, -1, -1, -1, 25, 26, -1, -1, 46,
- 47, 31, 32, 33, -1, 52, 7, 8, 9, 10,
+ 0, 5, 19, 129, 0, 64, 15, 66, 0, 0,
+ 0, 13, 51, 36, 37, 39, 40, 56, 13, 22,
+ 44, 16, 17, 18, 48, 49, 15, 128, 52, 10,
+ 54, 55, 27, 35, 52, 10, 39, 40, 33, 34,
+ 35, 44, 51, 46, 47, 48, 49, 173, 35, 38,
+ 151, 54, 55, 154, 155, 34, 35, 52, 45, 51,
+ 27, 51, 29, 63, 165, 11, 192, 63, 35, 64,
+ 65, 66, 63, 10, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 10, 45, 53, 103, 91, 56, 190,
+ 11, 53, 134, 52, 56, 137, 138, 18, 56, 103,
+ 95, 96, 161, 14, 146, 16, 27, 39, 40, 104,
+ 11, 153, 44, 172, 11, 27, 133, 52, 160, 10,
+ 115, 34, 54, 55, 166, 167, 56, 169, 10, 27,
+ 7, 8, 9, 10, 176, 11, 11, 11, 10, 53,
+ 182, 136, 184, 147, 53, 51, 10, 35, 10, 56,
+ 145, 16, 10, 32, 31, 159, 33, 199, 21, 201,
+ 15, 34, 16, 180, 0, 1, 161, 38, 16, 46,
+ 47, 7, 8, 9, 10, 52, 16, 172, 34, 183,
+ 32, 17, 21, 19, 20, 21, 16, 32, 24, 25,
+ 26, 148, 21, 63, 194, 31, 32, 33, 169, 7,
+ 8, 9, 10, 148, 46, -1, -1, -1, -1, -1,
+ 46, 47, -1, -1, -1, 51, 52, 7, 8, 9,
+ 10, -1, -1, 31, -1, 33, -1, 17, -1, 19,
+ 20, 21, -1, -1, -1, 25, 26, -1, 46, 47,
+ -1, 31, 32, 33, 52, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 46, 47, -1, -1,
- -1, 51, 52, 7, 8, 9, 10, -1, -1, -1,
- 31, -1, 33, 17, -1, 19, 20, 21, -1, -1,
- -1, 25, 26, -1, -1, 46, 47, 31, 32, 33,
- -1, 52, -1, -1, 7, 8, 9, 10, -1, -1,
- 39, 40, 46, 47, 17, 44, 19, 20, 52, 48,
- 49, -1, 25, 26, -1, 54, 55, -1, 31, 11,
+ -1, 51, 52, 7, 8, 9, 10, -1, -1, 39,
+ 40, -1, -1, 17, 44, 19, 20, 21, 48, 49,
+ -1, 25, 26, -1, 54, 55, -1, 31, 32, 33,
+ -1, -1, -1, -1, 7, 8, 9, 10, -1, -1,
+ -1, -1, 46, 47, 17, -1, 19, 20, 52, -1,
+ -1, -1, 25, 26, -1, -1, -1, -1, 31, 11,
33, -1, -1, -1, -1, -1, 18, -1, -1, -1,
-1, 23, -1, 46, 47, 27, 28, 29, 30, 52,
39, 40, -1, 35, -1, 44, 45, 46, 47, 48,
49, -1, 39, 40, 53, 54, 55, 44, -1, 46,
47, 48, 49, -1, 39, 40, 53, 54, 55, 44,
45, 46, 47, 48, 49, -1, 39, 40, -1, 54,
- 55, 44, -1, 46, 47, 48, 49, -1, 39, 40,
- -1, 54, 55, 44, -1, -1, -1, 48, 49, -1,
- -1, 52, -1, 54, 55
+ 55, 44, -1, 46, 47, 48, 49, -1, -1, -1,
+ -1, 54, 55
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -811,9 +814,9 @@ static const yytype_uint8 yystos[] =
56, 86, 16, 77, 75, 14, 16, 74, 15, 38,
67, 73, 10, 76, 32, 75, 76, 76, 21, 66,
67, 68, 73, 74, 75, 69, 76, 75, 75, 68,
- 75, 69, 62, 38, 65, 34, 75, 16, 16, 16,
- 34, 75, 74, 75, 74, 16, 32, 21, 21, 76,
- 62, 63, 32, 75, 75
+ 75, 69, 62, 38, 65, 34, 75, 16, 16, 59,
+ 34, 75, 74, 75, 74, 16, 32, 21, 16, 76,
+ 62, 63, 32, 21, 75, 75
};
#define yyerrok (yyerrstatus = 0)
@@ -1750,13 +1753,13 @@ yyreduce:
#line 196 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
- WRITE_UINT32(&else1, (yyvsp[(7) - (11)].code));
- WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, (yyvsp[(9) - (11)].code)); ;}
+ WRITE_UINT32(&then, (yyvsp[(5) - (12)].code));
+ WRITE_UINT32(&else1, (yyvsp[(7) - (12)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (12)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 3] = end; /* end, if cond fails */
+ g_lingo->processIf(0, (yyvsp[(9) - (12)].code)); ;}
break;
case 25:
@@ -2169,7 +2172,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
-#line 2173 "engines/director/lingo/lingo-gr.cpp"
+#line 2176 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index e5d5e72f2b..76532165c7 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -193,7 +193,7 @@ ifstmt: if cond tTHEN nl stmtlist end tEND tIF {
(*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
g_lingo->processIf(0, 0); }
- | if cond tTHEN nl stmtlist end begin elseifstmt end tEND tIF {
+ | if cond tTHEN nl stmtlist end begin elseifstmt end nl tEND tIF {
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, $5);
WRITE_UINT32(&else1, $7);