diff options
author | Eugene Sandulenko | 2016-07-11 00:29:19 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | d86b95b3070bad2e99a2a1130fc0687d8f3fe426 (patch) | |
tree | 72d306c25bec979612b97a66fb8679a137b96a93 /engines/director | |
parent | 7f87a90179d87d95a09bc48b11ccf9ac9065699c (diff) | |
download | scummvm-rg350-d86b95b3070bad2e99a2a1130fc0687d8f3fe426.tar.gz scummvm-rg350-d86b95b3070bad2e99a2a1130fc0687d8f3fe426.tar.bz2 scummvm-rg350-d86b95b3070bad2e99a2a1130fc0687d8f3fe426.zip |
DIRECTOR: Lingo: Fix compilation for scripts with no leading spaces
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 218 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 4 |
2 files changed, 112 insertions, 110 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index b419574cfc..f3d80d6ddf 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -379,18 +379,18 @@ static yyconst flex_int16_t yy_accept[152] = 42, 42, 41, 42, 42, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 2, 2, 3, 43, 0, 0, 43, 0, - 44, 38, 1, 40, 41, 37, 35, 36, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 15, 7, 39, - 39, 39, 39, 39, 39, 39, 24, 25, 39, 39, - 39, 39, 39, 39, 32, 39, 39, 2, 2, 0, - 1, 40, 4, 39, 39, 39, 11, 39, 39, 39, - 39, 39, 39, 19, 39, 39, 23, 39, 27, 39, - - 29, 39, 39, 39, 39, 0, 39, 6, 10, 12, - 39, 39, 16, 17, 39, 39, 39, 22, 39, 39, - 39, 31, 39, 33, 0, 39, 13, 39, 18, 39, - 21, 39, 39, 39, 34, 9, 39, 14, 39, 39, - 28, 30, 0, 39, 20, 39, 0, 5, 26, 8, + 0, 44, 38, 1, 40, 41, 37, 35, 36, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 15, 7, + 39, 39, 39, 39, 39, 39, 39, 24, 25, 39, + 39, 39, 39, 39, 39, 32, 39, 39, 2, 2, + 0, 1, 40, 4, 39, 39, 39, 11, 39, 39, + 39, 39, 39, 39, 19, 39, 39, 23, 39, 27, + + 39, 29, 39, 39, 39, 39, 0, 39, 6, 10, + 12, 39, 39, 16, 17, 39, 39, 39, 22, 39, + 39, 39, 31, 39, 33, 9, 39, 13, 39, 18, + 39, 21, 39, 39, 39, 34, 0, 39, 14, 39, + 39, 28, 30, 0, 39, 20, 39, 8, 5, 26, 0 } ; @@ -438,23 +438,23 @@ static yyconst flex_int32_t yy_meta[58] = static yyconst flex_int16_t yy_base[155] = { 0, - 0, 56, 186, 352, 60, 64, 68, 72, 173, 352, - 143, 141, 49, 65, 132, 53, 0, 53, 54, 58, - 54, 61, 70, 59, 83, 95, 79, 62, 98, 105, - 103, 104, 138, 151, 157, 125, 161, 165, 169, 132, - 352, 352, 0, 108, 123, 352, 352, 352, 0, 117, - 141, 134, 144, 158, 154, 163, 152, 0, 0, 149, - 154, 166, 162, 153, 152, 159, 0, 0, 173, 162, - 166, 165, 189, 191, 0, 188, 181, 217, 225, 192, - 0, 85, 0, 191, 197, 206, 0, 199, 209, 220, - 211, 211, 211, 207, 214, 211, 0, 212, 0, 229, - - 0, 220, 224, 228, 232, 226, 240, 0, 0, 0, - 246, 251, 0, 0, 240, 254, 254, 0, 252, 264, - 249, 0, 263, 0, 264, 261, 0, 261, 0, 267, - 0, 264, 261, 263, 0, 86, 269, 0, 266, 266, - 0, 0, 298, 277, 0, 278, 290, 0, 0, 352, - 352, 343, 89, 347 + 0, 56, 187, 354, 60, 64, 68, 72, 146, 354, + 142, 127, 49, 65, 121, 53, 0, 53, 54, 64, + 55, 65, 77, 58, 98, 89, 98, 90, 75, 110, + 111, 109, 154, 162, 166, 92, 170, 143, 174, 97, + 121, 354, 354, 0, 81, 88, 354, 354, 354, 0, + 106, 134, 145, 150, 165, 162, 171, 160, 0, 0, + 157, 162, 174, 169, 161, 160, 165, 0, 0, 179, + 168, 174, 172, 191, 193, 0, 196, 190, 227, 233, + 192, 0, 77, 0, 194, 200, 214, 0, 207, 214, + 226, 217, 217, 219, 215, 228, 221, 0, 220, 0, + + 237, 0, 228, 232, 237, 241, 246, 253, 0, 0, + 0, 250, 257, 0, 0, 248, 262, 262, 0, 259, + 269, 254, 0, 269, 0, 287, 270, 0, 270, 0, + 273, 0, 270, 268, 270, 0, 300, 281, 0, 277, + 278, 0, 0, 292, 283, 0, 286, 354, 0, 0, + 354, 345, 80, 349 } ; static yyconst flex_int16_t yy_def[155] = @@ -462,72 +462,73 @@ static yyconst flex_int16_t yy_def[155] = 151, 1, 151, 151, 151, 151, 151, 151, 152, 151, 151, 151, 151, 151, 151, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 151, 151, 151, 151, 151, 151, 151, 152, - 151, 151, 154, 151, 151, 151, 151, 151, 153, 153, + 153, 153, 151, 151, 151, 151, 151, 151, 151, 151, + 152, 151, 151, 154, 151, 151, 151, 151, 151, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 151, 151, 151, - 154, 151, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 151, 151, + 151, 154, 151, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 151, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 151, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 151, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 151, 153, 153, 153, 153, - 153, 153, 151, 153, 153, 153, 151, 153, 153, 151, + 153, 153, 153, 153, 153, 153, 151, 153, 153, 153, + 153, 153, 153, 151, 153, 153, 153, 151, 153, 153, 0, 151, 151, 151 } ; -static yyconst flex_int16_t yy_nxt[410] = +static yyconst flex_int16_t yy_nxt[412] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 13, 14, 10, 15, 16, 17, 18, 19, 20, 21, 22, 17, 23, 17, 24, 25, 26, 27, 28, 29, 30, 31, 17, 17, 32, 17, 16, 17, 18, 19, 20, 21, 22, 17, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 17, 17, 32, 17, 33, 44, 45, + 29, 30, 31, 17, 17, 32, 17, 33, 45, 46, 34, 35, 36, 36, 37, 38, 39, 39, 38, 38, - 39, 39, 38, 37, 36, 36, 37, 46, 47, 50, - 51, 52, 53, 56, 54, 57, 61, 143, 58, 59, - 143, 69, 49, 55, 70, 82, 60, 62, 67, 63, - - 50, 51, 52, 53, 56, 54, 57, 61, 68, 58, - 64, 59, 69, 65, 55, 70, 71, 60, 82, 62, - 67, 63, 66, 72, 74, 76, 77, 36, 36, 68, - 75, 64, 44, 45, 83, 65, 73, 41, 71, 78, - 36, 36, 79, 66, 48, 72, 74, 76, 77, 43, - 42, 75, 79, 36, 36, 79, 83, 73, 35, 36, - 36, 37, 37, 36, 36, 37, 38, 84, 85, 38, - 38, 39, 39, 38, 86, 87, 88, 89, 41, 90, - 91, 92, 93, 80, 94, 151, 95, 96, 84, 85, - 97, 98, 151, 99, 100, 86, 101, 87, 88, 89, - - 90, 91, 92, 102, 93, 80, 94, 95, 96, 103, - 104, 97, 105, 98, 99, 100, 106, 101, 78, 36, - 36, 79, 107, 108, 109, 102, 79, 36, 36, 79, - 110, 103, 104, 105, 111, 112, 117, 106, 113, 114, - 115, 116, 118, 107, 108, 119, 109, 120, 151, 121, - 122, 110, 123, 124, 126, 111, 125, 112, 117, 113, - 114, 115, 116, 118, 127, 128, 119, 129, 130, 120, - 121, 122, 131, 123, 132, 124, 126, 125, 133, 151, - 134, 135, 136, 137, 151, 138, 127, 128, 129, 139, - 130, 140, 141, 142, 131, 144, 132, 145, 146, 143, - - 133, 134, 143, 135, 136, 137, 138, 148, 149, 150, - 151, 139, 140, 141, 142, 151, 144, 151, 145, 146, - 147, 151, 151, 151, 151, 151, 151, 151, 148, 149, - 151, 150, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 147, 40, 151, 40, 40, 81, 151, 151, - 81, 3, 151, 151, 151, 151, 151, 151, 151, 151, + 39, 39, 38, 37, 36, 36, 37, 47, 48, 51, + 52, 53, 40, 50, 57, 62, 40, 83, 54, 58, + 55, 83, 59, 72, 36, 36, 60, 45, 46, 56, + + 51, 52, 53, 61, 40, 57, 62, 66, 40, 54, + 58, 55, 63, 59, 64, 72, 67, 68, 60, 70, + 56, 81, 71, 84, 61, 65, 42, 69, 73, 66, + 77, 78, 75, 49, 63, 44, 64, 67, 76, 68, + 70, 74, 81, 71, 38, 84, 65, 38, 69, 43, + 73, 42, 77, 78, 75, 79, 36, 36, 80, 76, + 85, 40, 74, 80, 36, 36, 80, 35, 36, 36, + 37, 37, 36, 36, 37, 38, 39, 39, 38, 86, + 87, 85, 88, 40, 89, 90, 151, 91, 92, 93, + 94, 95, 40, 151, 96, 97, 98, 99, 151, 100, + + 86, 87, 101, 102, 88, 103, 89, 90, 91, 92, + 93, 104, 94, 95, 40, 96, 97, 98, 105, 99, + 100, 106, 107, 101, 102, 108, 109, 103, 79, 36, + 36, 80, 110, 104, 80, 36, 36, 80, 111, 112, + 105, 113, 106, 107, 114, 115, 108, 109, 116, 117, + 118, 151, 119, 120, 110, 121, 151, 122, 123, 111, + 112, 124, 125, 113, 126, 114, 115, 127, 128, 116, + 117, 129, 118, 119, 120, 130, 131, 121, 122, 123, + 132, 133, 124, 134, 125, 135, 126, 136, 137, 127, + 128, 137, 138, 129, 139, 140, 130, 141, 131, 142, + + 143, 137, 132, 133, 137, 134, 135, 145, 146, 136, + 147, 148, 151, 149, 138, 139, 150, 140, 141, 151, + 142, 143, 144, 151, 151, 151, 151, 151, 145, 146, + 151, 147, 151, 148, 149, 151, 151, 150, 151, 151, + 151, 151, 151, 151, 144, 41, 151, 41, 41, 82, + 151, 151, 82, 3, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151 + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151 } ; -static yyconst flex_int16_t yy_chk[410] = +static yyconst flex_int16_t yy_chk[412] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -537,43 +538,44 @@ static yyconst flex_int16_t yy_chk[410] = 1, 1, 1, 1, 1, 1, 1, 2, 13, 13, 2, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 14, 14, 16, - 18, 19, 20, 21, 20, 22, 24, 136, 22, 23, - 136, 28, 153, 20, 28, 82, 23, 25, 27, 25, - - 16, 18, 19, 20, 21, 20, 22, 24, 27, 22, - 25, 23, 28, 26, 20, 28, 29, 23, 44, 25, - 27, 25, 26, 30, 31, 32, 32, 36, 36, 27, - 31, 25, 45, 45, 50, 26, 30, 40, 29, 33, - 33, 33, 33, 26, 15, 30, 31, 32, 32, 12, - 11, 31, 34, 34, 34, 34, 50, 30, 35, 35, - 35, 35, 37, 37, 37, 37, 38, 51, 52, 38, - 39, 39, 39, 39, 53, 54, 55, 56, 9, 57, - 60, 61, 62, 38, 63, 3, 64, 65, 51, 52, - 66, 69, 0, 70, 71, 53, 72, 54, 55, 56, - - 57, 60, 61, 73, 62, 38, 63, 64, 65, 74, - 76, 66, 77, 69, 70, 71, 80, 72, 78, 78, - 78, 78, 84, 85, 86, 73, 79, 79, 79, 79, - 88, 74, 76, 77, 89, 90, 95, 80, 91, 92, - 93, 94, 96, 84, 85, 98, 86, 100, 0, 102, - 103, 88, 104, 105, 107, 89, 106, 90, 95, 91, - 92, 93, 94, 96, 111, 112, 98, 115, 116, 100, - 102, 103, 117, 104, 119, 105, 107, 106, 120, 0, - 121, 123, 125, 126, 0, 128, 111, 112, 115, 130, - 116, 132, 133, 134, 117, 137, 119, 139, 140, 143, - - 120, 121, 143, 123, 125, 126, 128, 144, 146, 147, - 0, 130, 132, 133, 134, 0, 137, 0, 139, 140, - 143, 0, 0, 0, 0, 0, 0, 0, 144, 146, - 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 143, 152, 0, 152, 152, 154, 0, 0, - 154, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 18, 19, 6, 153, 21, 24, 7, 83, 20, 22, + 20, 45, 22, 29, 36, 36, 23, 46, 46, 20, + + 16, 18, 19, 23, 6, 21, 24, 26, 7, 20, + 22, 20, 25, 22, 25, 29, 26, 27, 23, 28, + 20, 40, 28, 51, 23, 25, 41, 27, 30, 26, + 32, 32, 31, 15, 25, 12, 25, 26, 31, 27, + 28, 30, 40, 28, 38, 51, 25, 38, 27, 11, + 30, 9, 32, 32, 31, 33, 33, 33, 33, 31, + 52, 38, 30, 34, 34, 34, 34, 35, 35, 35, + 35, 37, 37, 37, 37, 39, 39, 39, 39, 53, + 54, 52, 55, 38, 56, 57, 3, 58, 61, 62, + 63, 64, 39, 0, 65, 66, 67, 70, 0, 71, + + 53, 54, 72, 73, 55, 74, 56, 57, 58, 61, + 62, 75, 63, 64, 39, 65, 66, 67, 77, 70, + 71, 78, 81, 72, 73, 85, 86, 74, 79, 79, + 79, 79, 87, 75, 80, 80, 80, 80, 89, 90, + 77, 91, 78, 81, 92, 93, 85, 86, 94, 95, + 96, 0, 97, 99, 87, 101, 0, 103, 104, 89, + 90, 105, 106, 91, 107, 92, 93, 108, 112, 94, + 95, 113, 96, 97, 99, 116, 117, 101, 103, 104, + 118, 120, 105, 121, 106, 122, 107, 124, 126, 108, + 112, 126, 127, 113, 129, 131, 116, 133, 117, 134, + + 135, 137, 118, 120, 137, 121, 122, 138, 140, 124, + 141, 144, 0, 145, 127, 129, 147, 131, 133, 0, + 134, 135, 137, 0, 0, 0, 0, 0, 138, 140, + 0, 141, 0, 144, 145, 0, 0, 147, 0, 0, + 0, 0, 0, 0, 137, 152, 0, 152, 152, 154, + 0, 0, 154, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151 + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151 } ; static yy_state_type yy_last_accepting_state; @@ -636,7 +638,7 @@ static void countnl() { Director::g_lingo->_colnumber = strlen(p); } -#line 640 "engines/director/lingo/lingo-lex.cpp" +#line 642 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -824,7 +826,7 @@ YY_DECL #line 58 "engines/director/lingo/lingo-lex.l" -#line 828 "engines/director/lingo/lingo-lex.cpp" +#line 830 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -884,7 +886,7 @@ yy_match: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 352 ); + while ( yy_base[yy_current_state] != 354 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1149,7 +1151,7 @@ YY_RULE_SETUP #line 117 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1153 "engines/director/lingo/lingo-lex.cpp" +#line 1155 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 6a78a3f160..b7dfecb803 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -65,8 +65,8 @@ whitespace [\t ] (?i:contains) { count(); return tCONTAINS; } (?i:down) { count(); return tDOWN; } (?i:if) { count(); return tIF; } -(?i:[\n\r]+[\t ]+else[\t ]+if) { countnl(); return tNLELSIF; } -(?i:[\n\r]+[\t ]+else) { countnl(); return tNLELSE; } +(?i:[\n\r]+[\t ]*else[\t ]+if) { countnl(); return tNLELSIF; } +(?i:[\n\r]+[\t ]*else) { countnl(); return tNLELSE; } (?i:else) { count(); return tELSE; } (?i:end) { count(); return tEND; } (?i:exit) { count(); return tEXIT; } |