diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/magic-expr.c | 8 | ||||
-rw-r--r-- | src/map/magic-interpreter-lexer.c | 387 | ||||
-rw-r--r-- | src/map/magic-interpreter-parser.c | 911 | ||||
-rw-r--r-- | src/map/magic-interpreter-parser.h | 48 | ||||
-rw-r--r-- | src/map/magic-interpreter-parser.y | 3 | ||||
-rw-r--r-- | src/map/magic-interpreter.h | 1 | ||||
-rw-r--r-- | src/map/magic-interpreter.l | 1 | ||||
-rw-r--r-- | src/map/magic-stmt.c | 6 |
8 files changed, 697 insertions, 668 deletions
diff --git a/src/map/magic-expr.c b/src/map/magic-expr.c index d22e596..483a9ee 100644 --- a/src/map/magic-expr.c +++ b/src/map/magic-expr.c @@ -1015,6 +1015,13 @@ fun_substr(env_t *env, int args_nr, val_t *result, val_t *args) return 0; } +static int +fun_sqrt(env_t *env, int args_nr, val_t *result, val_t *args) +{ + RESULTINT = (int) sqrt(ARGINT(0)); + return 0; +} + #define BATTLE_RECORD2(sname, name) { sname, "e", 'i', fun_get_##name } #define BATTLE_RECORD(name) BATTLE_RECORD2(#name, name) @@ -1083,6 +1090,7 @@ static fun_t functions[] = { { "strstr", "ss", 'i', fun_strstr }, { "strlen", "s", 'i', fun_strlen }, { "substr", "sii", 's', fun_substr }, + { "sqrt", "i", 'i', fun_sqrt }, { NULL, NULL, '.', NULL } }; diff --git a/src/map/magic-interpreter-lexer.c b/src/map/magic-interpreter-lexer.c index 6cf5d73..50b6865 100644 --- a/src/map/magic-interpreter-lexer.c +++ b/src/map/magic-interpreter-lexer.c @@ -396,8 +396,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 85 -#define YY_END_OF_BUFFER 86 +#define YY_NUM_RULES 86 +#define YY_END_OF_BUFFER 87 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -405,34 +405,34 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[238] = +static yyconst flex_int16_t yy_accept[240] = { 0, - 0, 0, 86, 84, 83, 83, 84, 84, 84, 23, - 33, 17, 18, 21, 19, 28, 20, 35, 22, 78, - 78, 27, 26, 14, 9, 13, 29, 80, 80, 80, - 80, 7, 80, 80, 80, 80, 80, 5, 80, 80, - 80, 1, 80, 3, 31, 32, 34, 84, 30, 12, - 0, 77, 0, 0, 81, 24, 78, 0, 0, 36, - 16, 11, 10, 51, 15, 37, 80, 80, 80, 80, - 80, 80, 74, 80, 80, 80, 80, 69, 49, 80, - 80, 80, 80, 6, 80, 4, 40, 65, 80, 80, - 8, 80, 80, 80, 80, 2, 80, 80, 80, 41, - - 80, 0, 0, 76, 25, 0, 77, 0, 0, 82, - 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 50, 80, 73, 48, 80, 80, 66, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 0, 0, 76, 80, 80, 80, 80, 39, 80, - 80, 80, 80, 80, 71, 80, 80, 80, 56, 80, - 80, 80, 80, 58, 80, 80, 80, 80, 70, 80, - 75, 59, 62, 80, 60, 80, 80, 80, 64, 80, - 80, 80, 45, 80, 80, 80, 80, 47, 80, 80, - 80, 80, 80, 80, 80, 80, 61, 67, 80, 80, - - 80, 80, 44, 52, 68, 80, 80, 80, 80, 80, - 80, 72, 80, 80, 53, 80, 42, 80, 57, 80, - 80, 46, 80, 80, 63, 54, 80, 38, 80, 55, - 80, 80, 80, 80, 80, 43, 0 + 0, 0, 87, 85, 84, 84, 85, 85, 85, 23, + 33, 17, 18, 21, 19, 28, 20, 35, 22, 79, + 79, 27, 26, 14, 9, 13, 29, 81, 81, 81, + 81, 7, 81, 81, 81, 81, 81, 5, 81, 81, + 81, 1, 81, 3, 31, 32, 34, 85, 30, 12, + 0, 78, 0, 0, 82, 24, 79, 0, 0, 36, + 16, 11, 10, 51, 15, 37, 81, 81, 81, 81, + 81, 81, 75, 81, 81, 81, 81, 70, 49, 81, + 81, 81, 81, 6, 81, 81, 4, 40, 65, 81, + 81, 8, 81, 81, 81, 81, 2, 81, 81, 81, + + 41, 81, 0, 0, 77, 25, 0, 78, 0, 0, + 83, 80, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 50, 81, 74, 48, 81, 81, 67, + 81, 66, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 0, 0, 77, 81, 81, 81, 81, + 39, 81, 81, 81, 81, 81, 72, 81, 81, 81, + 56, 81, 81, 81, 81, 58, 81, 81, 81, 81, + 71, 81, 76, 59, 62, 81, 60, 81, 81, 81, + 64, 81, 81, 81, 45, 81, 81, 81, 81, 47, + 81, 81, 81, 81, 81, 81, 81, 81, 61, 68, + + 81, 81, 81, 81, 44, 52, 69, 81, 81, 81, + 81, 81, 81, 73, 81, 81, 53, 81, 42, 81, + 57, 81, 81, 46, 81, 81, 63, 54, 81, 38, + 81, 55, 81, 81, 81, 81, 81, 43, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -477,69 +477,69 @@ static yyconst flex_int32_t yy_meta[58] = 1, 1, 3, 2, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[246] = +static yyconst flex_int16_t yy_base[248] = { 0, - 0, 0, 287, 288, 288, 288, 264, 53, 282, 288, - 276, 288, 288, 288, 288, 288, 42, 288, 267, 44, - 46, 288, 288, 44, 46, 48, 288, 45, 239, 47, - 241, 43, 240, 0, 44, 46, 51, 48, 236, 51, - 248, 63, 76, 251, 288, 288, 288, 35, 220, 288, - 76, 288, 102, 272, 288, 288, 83, 271, 0, 288, - 288, 288, 288, 288, 288, 288, 0, 233, 66, 242, - 75, 75, 0, 240, 226, 86, 226, 0, 0, 223, - 239, 227, 238, 0, 225, 0, 0, 0, 223, 220, - 0, 224, 226, 229, 215, 0, 214, 219, 225, 207, - - 219, 67, 86, 288, 288, 79, 113, 118, 249, 288, - 0, 208, 211, 206, 222, 210, 201, 219, 203, 199, - 212, 211, 0, 206, 209, 0, 212, 211, 0, 198, - 207, 188, 203, 191, 194, 196, 197, 198, 188, 200, - 180, 75, 119, 77, 179, 194, 188, 185, 0, 175, - 182, 178, 172, 188, 0, 170, 188, 176, 0, 186, - 181, 176, 170, 0, 171, 168, 176, 164, 0, 161, - 0, 0, 0, 171, 0, 168, 153, 161, 0, 154, - 150, 169, 0, 143, 145, 130, 127, 0, 139, 125, - 127, 137, 133, 126, 118, 131, 0, 0, 127, 125, - - 112, 127, 0, 0, 0, 113, 111, 124, 123, 106, - 111, 0, 121, 105, 0, 102, 0, 103, 0, 101, - 99, 0, 112, 127, 0, 0, 96, 0, 113, 0, - 99, 109, 102, 93, 87, 0, 288, 176, 179, 181, - 184, 187, 190, 125, 193 + 0, 0, 289, 290, 290, 290, 266, 53, 284, 290, + 278, 290, 290, 290, 290, 290, 42, 290, 269, 44, + 46, 290, 290, 44, 46, 48, 290, 45, 241, 47, + 243, 43, 242, 0, 44, 46, 51, 48, 238, 51, + 250, 63, 76, 253, 290, 290, 290, 35, 222, 290, + 76, 290, 102, 274, 290, 290, 83, 273, 0, 290, + 290, 290, 290, 290, 290, 290, 0, 235, 66, 244, + 75, 75, 0, 242, 228, 86, 228, 0, 0, 225, + 241, 229, 240, 0, 227, 237, 0, 0, 0, 224, + 221, 0, 225, 227, 230, 216, 0, 215, 220, 226, + + 208, 220, 67, 115, 290, 290, 79, 116, 120, 250, + 290, 0, 209, 212, 207, 223, 211, 202, 220, 204, + 200, 213, 212, 0, 207, 210, 0, 213, 212, 0, + 199, 0, 208, 189, 204, 192, 195, 197, 198, 199, + 189, 201, 181, 77, 119, 78, 180, 195, 189, 186, + 0, 176, 183, 179, 173, 189, 0, 171, 189, 177, + 0, 187, 182, 177, 171, 0, 172, 169, 177, 165, + 0, 162, 0, 0, 0, 172, 0, 169, 154, 162, + 0, 155, 151, 170, 0, 165, 146, 131, 128, 0, + 139, 123, 127, 135, 131, 124, 117, 130, 0, 0, + + 126, 124, 111, 126, 0, 0, 0, 112, 110, 123, + 121, 105, 110, 0, 120, 104, 0, 101, 0, 102, + 0, 100, 98, 0, 112, 127, 0, 0, 96, 0, + 113, 0, 99, 109, 103, 93, 89, 0, 290, 176, + 179, 181, 184, 187, 190, 127, 193 } ; -static yyconst flex_int16_t yy_def[246] = +static yyconst flex_int16_t yy_def[248] = { 0, - 237, 1, 237, 237, 237, 237, 237, 238, 239, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 237, 237, 237, 241, 237, 237, - 238, 237, 242, 239, 237, 237, 237, 243, 244, 237, - 237, 237, 237, 237, 237, 237, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - - 240, 241, 245, 237, 237, 238, 238, 242, 243, 237, - 244, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 241, 245, 241, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 0, 237, 237, 237, - 237, 237, 237, 237, 237 + 239, 1, 239, 239, 239, 239, 239, 240, 241, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 239, 239, 239, 243, 239, 239, + 240, 239, 244, 241, 239, 239, 239, 245, 246, 239, + 239, 239, 239, 239, 239, 239, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + + 242, 242, 243, 247, 239, 239, 240, 240, 244, 245, + 239, 246, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 243, 247, 243, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 0, 239, + 239, 239, 239, 239, 239, 239, 239 } ; -static yyconst flex_int16_t yy_nxt[346] = +static yyconst flex_int16_t yy_nxt[348] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -548,40 +548,40 @@ static yyconst flex_int16_t yy_nxt[346] = 40, 34, 41, 42, 43, 34, 44, 34, 45, 4, 46, 47, 34, 34, 48, 49, 4, 52, 57, 57, 57, 57, 57, 57, 60, 61, 62, 63, 64, 65, - 66, 68, 71, 74, 78, 80, 82, 84, 88, 75, - 52, 76, 79, 52, 103, 81, 72, 85, 102, 69, - 83, 104, 91, 89, 86, 113, 92, 59, 93, 57, - - 57, 97, 53, 94, 51, 98, 107, 95, 99, 96, - 114, 116, 119, 120, 123, 100, 103, 52, 117, 118, - 51, 102, 107, 104, 103, 53, 103, 111, 53, 236, - 124, 104, 235, 104, 234, 143, 233, 232, 231, 230, - 229, 228, 144, 227, 226, 225, 224, 223, 222, 221, - 220, 108, 219, 218, 217, 216, 215, 214, 213, 212, - 211, 210, 53, 209, 208, 207, 206, 108, 143, 205, - 204, 203, 202, 201, 200, 144, 51, 51, 51, 54, - 54, 54, 67, 67, 102, 102, 102, 106, 106, 106, - 109, 109, 109, 142, 142, 142, 199, 198, 197, 196, - - 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, - 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, - 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, - 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, - 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, - 145, 110, 141, 140, 139, 138, 137, 136, 135, 134, - 133, 132, 131, 130, 129, 128, 127, 126, 125, 122, - 121, 115, 112, 110, 55, 105, 101, 90, 87, 77, - 73, 70, 58, 56, 55, 50, 237, 3, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237 + 66, 68, 71, 74, 78, 80, 82, 84, 89, 75, + 52, 76, 79, 52, 104, 81, 72, 85, 86, 69, + 83, 105, 92, 90, 87, 114, 93, 59, 94, 57, + + 57, 98, 53, 95, 51, 99, 108, 96, 100, 97, + 115, 117, 120, 121, 124, 101, 104, 103, 118, 119, + 52, 103, 51, 105, 108, 53, 104, 104, 53, 112, + 125, 238, 237, 105, 105, 236, 235, 234, 233, 232, + 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, + 221, 109, 220, 219, 218, 217, 216, 215, 214, 213, + 212, 211, 210, 209, 145, 53, 208, 207, 145, 109, + 206, 146, 205, 204, 203, 146, 51, 51, 51, 54, + 54, 54, 67, 67, 103, 103, 103, 107, 107, 107, + 110, 110, 110, 144, 144, 144, 202, 201, 200, 199, + + 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, + 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, + 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, + 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, + 148, 147, 111, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 123, 122, 116, 113, 111, 55, 106, 102, 91, + 88, 77, 73, 70, 58, 56, 55, 50, 239, 3, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239 } ; -static yyconst flex_int16_t yy_chk[346] = +static yyconst flex_int16_t yy_chk[348] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -591,46 +591,46 @@ static yyconst flex_int16_t yy_chk[346] = 1, 1, 1, 1, 1, 1, 1, 8, 17, 17, 20, 20, 21, 21, 24, 24, 24, 25, 25, 26, 26, 28, 30, 32, 35, 36, 37, 38, 40, 32, - 51, 32, 35, 106, 48, 36, 30, 38, 103, 28, + 51, 32, 35, 107, 48, 36, 30, 38, 38, 28, 37, 48, 42, 40, 38, 69, 42, 20, 42, 57, 57, 43, 8, 42, 53, 43, 53, 42, 43, 42, - 69, 71, 72, 72, 76, 43, 102, 107, 71, 71, - 108, 143, 108, 102, 142, 51, 144, 244, 106, 235, - 76, 142, 234, 144, 233, 103, 232, 231, 229, 227, - 224, 223, 103, 221, 220, 218, 216, 214, 213, 211, - 210, 53, 209, 208, 207, 206, 202, 201, 200, 199, - 196, 195, 107, 194, 193, 192, 191, 108, 143, 190, - 189, 187, 186, 185, 184, 143, 238, 238, 238, 239, - 239, 239, 240, 240, 241, 241, 241, 242, 242, 242, - 243, 243, 243, 245, 245, 245, 182, 181, 180, 178, - - 177, 176, 174, 170, 168, 167, 166, 165, 163, 162, - 161, 160, 158, 157, 156, 154, 153, 152, 151, 150, - 148, 147, 146, 145, 141, 140, 139, 138, 137, 136, - 135, 134, 133, 132, 131, 130, 128, 127, 125, 124, - 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, - 112, 109, 101, 100, 99, 98, 97, 95, 94, 93, - 92, 90, 89, 85, 83, 82, 81, 80, 77, 75, - 74, 70, 68, 58, 54, 49, 44, 41, 39, 33, - 31, 29, 19, 11, 9, 7, 3, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237 + 69, 71, 72, 72, 76, 43, 103, 104, 71, 71, + 108, 145, 109, 103, 109, 51, 144, 146, 107, 246, + 76, 237, 236, 144, 146, 235, 234, 233, 231, 229, + 226, 225, 223, 222, 220, 218, 216, 215, 213, 212, + 211, 53, 210, 209, 208, 204, 203, 202, 201, 198, + 197, 196, 195, 194, 104, 108, 193, 192, 145, 109, + 191, 104, 189, 188, 187, 145, 240, 240, 240, 241, + 241, 241, 242, 242, 243, 243, 243, 244, 244, 244, + 245, 245, 245, 247, 247, 247, 186, 184, 183, 182, + + 180, 179, 178, 176, 172, 170, 169, 168, 167, 165, + 164, 163, 162, 160, 159, 158, 156, 155, 154, 153, + 152, 150, 149, 148, 147, 143, 142, 141, 140, 139, + 138, 137, 136, 135, 134, 133, 131, 129, 128, 126, + 125, 123, 122, 121, 120, 119, 118, 117, 116, 115, + 114, 113, 110, 102, 101, 100, 99, 98, 96, 95, + 94, 93, 91, 90, 86, 85, 83, 82, 81, 80, + 77, 75, 74, 70, 68, 58, 54, 49, 44, 41, + 39, 33, 31, 29, 19, 11, 9, 7, 3, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[86] = +static yyconst flex_int32_t yy_rule_can_match_eol[87] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, - 0, 0, 0, 1, 0, 0, }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 0, 1, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -747,8 +747,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -756,7 +760,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( magic_frontend_text, magic_frontend_leng, 1, magic_frontend_out ) +#define ECHO do { if (fwrite( magic_frontend_text, magic_frontend_leng, 1, magic_frontend_out )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -858,7 +862,7 @@ YY_DECL #line 22 "magic-interpreter.l" -#line 862 "magic-interpreter-lexer.c" +#line 866 "magic-interpreter-lexer.c" yylval = yylval_param; @@ -915,13 +919,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 238 ) + if ( yy_current_state >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 288 ); + while ( yy_base[yy_current_state] != 290 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1283,67 +1287,72 @@ YY_RULE_SETUP case 66: YY_RULE_SETUP #line 89 "magic-interpreter.l" -{FIXLOC; return MOB_F;} +{FIXLOC; return NPC_F;} YY_BREAK case 67: YY_RULE_SETUP #line 90 "magic-interpreter.l" -{FIXLOC; return ENTITY_F;} +{FIXLOC; return MOB_F;} YY_BREAK case 68: YY_RULE_SETUP #line 91 "magic-interpreter.l" -{FIXLOC; return TARGET_F;} +{FIXLOC; return ENTITY_F;} YY_BREAK case 69: YY_RULE_SETUP #line 92 "magic-interpreter.l" -{FIXLOC; return IF;} +{FIXLOC; return TARGET_F;} YY_BREAK case 70: YY_RULE_SETUP #line 93 "magic-interpreter.l" -{FIXLOC; return THEN;} +{FIXLOC; return IF;} YY_BREAK case 71: YY_RULE_SETUP #line 94 "magic-interpreter.l" -{FIXLOC; return ELSE;} +{FIXLOC; return THEN;} YY_BREAK case 72: YY_RULE_SETUP #line 95 "magic-interpreter.l" -{FIXLOC; return FOREACH;} +{FIXLOC; return ELSE;} YY_BREAK case 73: YY_RULE_SETUP #line 96 "magic-interpreter.l" -{FIXLOC; return FOR;} +{FIXLOC; return FOREACH;} YY_BREAK case 74: YY_RULE_SETUP #line 97 "magic-interpreter.l" -{FIXLOC; return DO;} +{FIXLOC; return FOR;} YY_BREAK case 75: YY_RULE_SETUP #line 98 "magic-interpreter.l" -{FIXLOC; return SLEEP;} +{FIXLOC; return DO;} YY_BREAK case 76: -/* rule 76 can match eol */ YY_RULE_SETUP -#line 100 "magic-interpreter.l" +#line 99 "magic-interpreter.l" +{FIXLOC; return SLEEP;} + YY_BREAK +case 77: +/* rule 77 can match eol */ +YY_RULE_SETUP +#line 101 "magic-interpreter.l" { char *string = strdup(magic_frontend_text); magic_frontend_lval.s = string; FIXLOC; return SCRIPT_DATA; } YY_BREAK -case 77: -/* rule 77 can match eol */ +case 78: +/* rule 78 can match eol */ YY_RULE_SETUP -#line 106 "magic-interpreter.l" +#line 107 "magic-interpreter.l" { char *string = strdup(magic_frontend_text + 1); char *src = string; char *dst = string; @@ -1359,60 +1368,60 @@ YY_RULE_SETUP return STRING; } YY_BREAK -case 78: +case 79: YY_RULE_SETUP -#line 121 "magic-interpreter.l" +#line 122 "magic-interpreter.l" { magic_frontend_lval.i = atoi(magic_frontend_text); FIXLOC; return INT; } YY_BREAK -case 79: +case 80: YY_RULE_SETUP -#line 125 "magic-interpreter.l" +#line 126 "magic-interpreter.l" { magic_frontend_lval.i = strtol(magic_frontend_text + 2, NULL, 16); FIXLOC; return INT; } YY_BREAK -case 80: +case 81: YY_RULE_SETUP -#line 129 "magic-interpreter.l" +#line 130 "magic-interpreter.l" { magic_frontend_lval.s = strdup(magic_frontend_text); FIXLOC; return ID; } YY_BREAK -case 81: +case 82: *yy_cp = (yy_hold_char); /* undo effects of setting up magic_frontend_text */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up magic_frontend_text again */ YY_RULE_SETUP -#line 133 "magic-interpreter.l" +#line 134 "magic-interpreter.l" /* Ignore comments */ YY_BREAK -case 82: +case 83: *yy_cp = (yy_hold_char); /* undo effects of setting up magic_frontend_text */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up magic_frontend_text again */ YY_RULE_SETUP -#line 134 "magic-interpreter.l" +#line 135 "magic-interpreter.l" /* Ignore comments */ YY_BREAK -case 83: -/* rule 83 can match eol */ +case 84: +/* rule 84 can match eol */ YY_RULE_SETUP -#line 135 "magic-interpreter.l" +#line 136 "magic-interpreter.l" /* ignore whitespace */ YY_BREAK -case 84: +case 85: YY_RULE_SETUP -#line 136 "magic-interpreter.l" +#line 137 "magic-interpreter.l" fprintf(stderr, "%s: Unexpected character in line %d\n", MAGIC_CONFIG_FILE, magic_frontend_lineno); YY_BREAK -case 85: +case 86: YY_RULE_SETUP -#line 139 "magic-interpreter.l" +#line 140 "magic-interpreter.l" ECHO; YY_BREAK -#line 1416 "magic-interpreter-lexer.c" +#line 1425 "magic-interpreter-lexer.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1704,7 +1713,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 238 ) + if ( yy_current_state >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1732,11 +1741,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 238 ) + if ( yy_current_state >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 237); + yy_is_jam = (yy_current_state == 239); return yy_is_jam ? 0 : yy_current_state; } @@ -2381,7 +2390,7 @@ void magic_frontend_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 139 "magic-interpreter.l" +#line 140 "magic-interpreter.l" diff --git a/src/map/magic-interpreter-parser.c b/src/map/magic-interpreter-parser.c index 66fb120..8cf2312 100644 --- a/src/map/magic-interpreter-parser.c +++ b/src/map/magic-interpreter-parser.c @@ -114,17 +114,18 @@ ATEND = 295, ATTRIGGER = 296, PC_F = 297, - MOB_F = 298, - ENTITY_F = 299, - TARGET_F = 300, - IF = 301, - THEN = 302, - ELSE = 303, - FOREACH = 304, - FOR = 305, - DO = 306, - SLEEP = 307, - OR = 308 + NPC_F = 298, + MOB_F = 299, + ENTITY_F = 300, + TARGET_F = 301, + IF = 302, + THEN = 303, + ELSE = 304, + FOREACH = 305, + FOR = 306, + DO = 307, + SLEEP = 308, + OR = 309 }; #endif /* Tokens. */ @@ -168,17 +169,18 @@ #define ATEND 295 #define ATTRIGGER 296 #define PC_F 297 -#define MOB_F 298 -#define ENTITY_F 299 -#define TARGET_F 300 -#define IF 301 -#define THEN 302 -#define ELSE 303 -#define FOREACH 304 -#define FOR 305 -#define DO 306 -#define SLEEP 307 -#define OR 308 +#define NPC_F 298 +#define MOB_F 299 +#define ENTITY_F 300 +#define TARGET_F 301 +#define IF 302 +#define THEN 303 +#define ELSE 304 +#define FOREACH 305 +#define FOR 306 +#define DO 307 +#define SLEEP 308 +#define OR 309 @@ -296,7 +298,7 @@ typedef union YYSTYPE proc_t *proc; } /* Line 187 of yacc.c. */ -#line 300 "magic-interpreter-parser.c" +#line 302 "magic-interpreter-parser.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -321,7 +323,7 @@ typedef struct YYLTYPE /* Line 216 of yacc.c. */ -#line 325 "magic-interpreter-parser.c" +#line 327 "magic-interpreter-parser.c" #ifdef short # undef short @@ -538,20 +540,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 18 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1029 +#define YYLAST 983 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 74 +#define YYNTOKENS 75 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 32 /* YYNRULES -- Number of rules. */ -#define YYNRULES 110 +#define YYNRULES 111 /* YYNRULES -- Number of states. */ -#define YYNSTATES 251 +#define YYNSTATES 252 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 308 +#define YYMAXUTOK 309 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -563,7 +565,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 14, 23, 2, - 72, 73, 12, 10, 16, 11, 17, 13, 2, 2, + 73, 74, 12, 10, 16, 11, 17, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 19, 8, 7, 9, 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -589,7 +591,7 @@ static const yytype_uint8 yytranslate[] = 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71 + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 }; #if YYDEBUG @@ -606,71 +608,71 @@ static const yytype_uint16 yyprhs[] = 217, 222, 224, 228, 232, 234, 238, 242, 246, 251, 252, 255, 256, 259, 261, 265, 269, 271, 275, 278, 281, 284, 287, 290, 294, 296, 300, 304, 306, 308, - 310, 312, 314, 316, 318, 320, 324, 327, 330, 333, - 336, 341, 349, 358, 365, 370, 374, 380, 382, 389, - 390 + 310, 312, 314, 316, 318, 320, 322, 326, 329, 332, + 335, 338, 343, 351, 360, 367, 372, 376, 382, 384, + 391, 392 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 75, 0, -1, -1, 79, 76, 75, -1, -1, 76, - 19, -1, -1, 78, -1, 5, -1, 78, 16, 5, - -1, 5, 7, 84, -1, 25, 5, 7, 84, -1, - 42, 5, 18, 84, 7, 84, -1, 26, 5, 72, - 77, 73, 7, 105, -1, 80, 43, 5, 81, 18, - 84, 7, 89, -1, -1, 29, 80, -1, 30, 80, - -1, 28, 80, -1, -1, 72, 5, 18, 82, 73, + 76, 0, -1, -1, 80, 77, 76, -1, -1, 77, + 19, -1, -1, 79, -1, 5, -1, 79, 16, 5, + -1, 5, 7, 85, -1, 25, 5, 7, 85, -1, + 42, 5, 18, 85, 7, 85, -1, 26, 5, 73, + 78, 74, 7, 106, -1, 81, 43, 5, 82, 18, + 85, 7, 90, -1, -1, 29, 81, -1, 30, 81, + -1, 28, 81, -1, -1, 73, 5, 18, 83, 74, -1, 60, -1, 48, -1, 6, -1, 3, -1, 4, - -1, 83, -1, 5, -1, 88, -1, 84, 10, 84, - -1, 84, 11, 84, -1, 84, 12, 84, -1, 84, - 14, 84, -1, 84, 13, 84, -1, 84, 8, 84, - -1, 84, 9, 84, -1, 84, 23, 84, -1, 84, - 24, 84, -1, 84, 20, 84, -1, 84, 31, 84, - -1, 84, 32, 84, -1, 84, 36, 84, -1, 84, - 35, 84, -1, 84, 37, 84, -1, 84, 38, 84, - -1, 84, 33, 84, -1, 84, 7, 84, -1, 84, - 34, 84, -1, 5, 72, 85, 73, -1, 72, 84, - 73, -1, 84, 17, 5, -1, -1, 86, -1, 84, - -1, 86, 16, 84, -1, 15, 72, 84, 16, 84, - 16, 84, 73, -1, 87, -1, 87, 15, 10, 72, - 84, 16, 84, 73, -1, 87, 41, 84, 18, 72, - 84, 16, 84, 73, -1, 92, -1, 44, 90, 45, - 92, -1, 76, -1, 90, 91, 76, -1, 5, 7, - 84, -1, 93, -1, 93, 20, 92, -1, 96, 47, - 93, -1, 72, 92, 73, -1, 57, 105, 94, 95, - -1, -1, 59, 105, -1, -1, 58, 105, -1, 98, - -1, 96, 71, 96, -1, 72, 97, 73, -1, 96, - -1, 96, 16, 97, -1, 49, 84, -1, 50, 99, - -1, 51, 99, -1, 52, 84, -1, 53, 84, -1, - 21, 100, 22, -1, 101, -1, 100, 16, 101, -1, - 3, 12, 102, -1, 102, -1, 4, -1, 3, -1, - 60, -1, 61, -1, 62, -1, 43, -1, 63, -1, - 72, 105, 73, -1, 54, 19, -1, 55, 19, -1, - 46, 19, -1, 56, 19, -1, 5, 7, 84, 19, - -1, 67, 103, 5, 45, 84, 69, 104, -1, 68, - 5, 7, 84, 40, 84, 69, 104, -1, 64, 84, - 65, 104, 66, 104, -1, 64, 84, 65, 104, -1, - 70, 84, 19, -1, 5, 72, 85, 73, 19, -1, - 39, -1, 27, 5, 72, 85, 73, 19, -1, -1, - 104, 76, 105, -1 + -1, 84, -1, 5, -1, 89, -1, 85, 10, 85, + -1, 85, 11, 85, -1, 85, 12, 85, -1, 85, + 14, 85, -1, 85, 13, 85, -1, 85, 8, 85, + -1, 85, 9, 85, -1, 85, 23, 85, -1, 85, + 24, 85, -1, 85, 20, 85, -1, 85, 31, 85, + -1, 85, 32, 85, -1, 85, 36, 85, -1, 85, + 35, 85, -1, 85, 37, 85, -1, 85, 38, 85, + -1, 85, 33, 85, -1, 85, 7, 85, -1, 85, + 34, 85, -1, 5, 73, 86, 74, -1, 73, 85, + 74, -1, 85, 17, 5, -1, -1, 87, -1, 85, + -1, 87, 16, 85, -1, 15, 73, 85, 16, 85, + 16, 85, 74, -1, 88, -1, 88, 15, 10, 73, + 85, 16, 85, 74, -1, 88, 41, 85, 18, 73, + 85, 16, 85, 74, -1, 93, -1, 44, 91, 45, + 93, -1, 77, -1, 91, 92, 77, -1, 5, 7, + 85, -1, 94, -1, 94, 20, 93, -1, 97, 47, + 94, -1, 73, 93, 74, -1, 57, 106, 95, 96, + -1, -1, 59, 106, -1, -1, 58, 106, -1, 99, + -1, 97, 72, 97, -1, 73, 98, 74, -1, 97, + -1, 97, 16, 98, -1, 49, 85, -1, 50, 100, + -1, 51, 100, -1, 52, 85, -1, 53, 85, -1, + 21, 101, 22, -1, 102, -1, 101, 16, 102, -1, + 3, 12, 103, -1, 103, -1, 4, -1, 3, -1, + 60, -1, 62, -1, 63, -1, 43, -1, 64, -1, + 61, -1, 73, 106, 74, -1, 54, 19, -1, 55, + 19, -1, 46, 19, -1, 56, 19, -1, 5, 7, + 85, 19, -1, 68, 104, 5, 45, 85, 70, 105, + -1, 69, 5, 7, 85, 40, 85, 70, 105, -1, + 65, 85, 66, 105, 67, 105, -1, 65, 85, 66, + 105, -1, 71, 85, 19, -1, 5, 73, 86, 74, + 19, -1, 39, -1, 27, 5, 73, 86, 74, 19, + -1, -1, 105, 77, 106, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 212, 212, 213, 219, 220, 226, 227, 231, 237, - 244, 255, 261, 272, 281, 294, 295, 300, 305, 313, - 314, 320, 322, 327, 330, 333, 339, 342, 353, 356, - 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, - 378, 380, 382, 384, 386, 388, 390, 392, 395, 400, - 402, 407, 408, 413, 418, 425, 429, 433, 439, 449, - 451, 460, 464, 473, 486, 488, 497, 499, 501, 512, - 513, 519, 520, 525, 527, 533, 538, 540, 545, 549, - 553, 557, 561, 568, 573, 577, 584, 586, 591, 600, - 605, 607, 609, 611, 613, 618, 620, 622, 624, 626, - 628, 639, 646, 653, 659, 665, 669, 673, 680, 687, - 688 + 0, 213, 213, 214, 220, 221, 227, 228, 232, 238, + 245, 256, 262, 273, 282, 295, 296, 301, 306, 314, + 315, 321, 323, 328, 331, 334, 340, 343, 354, 357, + 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, + 379, 381, 383, 385, 387, 389, 391, 393, 396, 401, + 403, 408, 409, 414, 419, 426, 430, 434, 440, 450, + 452, 461, 465, 474, 487, 489, 498, 500, 502, 513, + 514, 520, 521, 526, 528, 534, 539, 541, 546, 550, + 554, 558, 562, 569, 574, 578, 585, 587, 592, 601, + 606, 608, 610, 612, 614, 616, 621, 623, 625, 627, + 629, 631, 642, 649, 656, 662, 668, 672, 676, 683, + 690, 691 }; #endif @@ -686,9 +688,9 @@ static const char *const yytname[] = "LTE", "ANDAND", "OROR", "SCRIPT_DATA", "TO", "TOWARDS", "TELEPORT_ANCHOR", "SPELL", "LET", "IN", "END", "DARROW", "STRING_TY", "REQUIRE", "CATALYSTS", "COMPONENTS", "MANA", "CASTTIME", "SKIP", - "ABORT", "BREAK", "EFFECT", "ATEND", "ATTRIGGER", "PC_F", "MOB_F", - "ENTITY_F", "TARGET_F", "IF", "THEN", "ELSE", "FOREACH", "FOR", "DO", - "SLEEP", "OR", "'('", "')'", "$accept", "spellconf", "semicolons", + "ABORT", "BREAK", "EFFECT", "ATEND", "ATTRIGGER", "PC_F", "NPC_F", + "MOB_F", "ENTITY_F", "TARGET_F", "IF", "THEN", "ELSE", "FOREACH", "FOR", + "DO", "SLEEP", "OR", "'('", "')'", "$accept", "spellconf", "semicolons", "proc_formals_list", "proc_formals_list_ne", "spellconf_option", "spell_flags", "argopt", "arg_ty", "value", "expr", "arg_list", "arg_list_ne", "location", "area", "spelldef", "defs", "def", @@ -710,25 +712,25 @@ static const yytype_uint16 yytoknum[] = 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 40, 41 + 307, 308, 309, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 74, 75, 75, 76, 76, 77, 77, 78, 78, - 79, 79, 79, 79, 79, 80, 80, 80, 80, 81, - 81, 82, 82, 83, 83, 83, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 85, 85, 86, 86, 87, 88, 88, 88, 89, - 89, 90, 90, 91, 92, 92, 93, 93, 93, 94, - 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, - 98, 98, 98, 99, 100, 100, 101, 101, 102, 102, - 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, - 105 + 0, 75, 76, 76, 77, 77, 78, 78, 79, 79, + 80, 80, 80, 80, 80, 81, 81, 81, 81, 82, + 82, 83, 83, 84, 84, 84, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 86, 86, 87, 87, 88, 89, 89, 89, 90, + 90, 91, 91, 92, 93, 93, 94, 94, 94, 95, + 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, + 99, 99, 99, 100, 101, 101, 102, 102, 103, 103, + 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 106, 106 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -743,9 +745,9 @@ static const yytype_uint8 yyr2[] = 4, 1, 3, 3, 1, 3, 3, 3, 4, 0, 2, 0, 2, 1, 3, 3, 1, 3, 2, 2, 2, 2, 2, 3, 1, 3, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, - 4, 7, 8, 6, 4, 3, 5, 1, 6, 0, - 3 + 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, + 2, 4, 7, 8, 6, 4, 3, 5, 1, 6, + 0, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -763,73 +765,73 @@ static const yytype_uint8 yydefact[] = 0, 52, 0, 49, 46, 34, 35, 29, 30, 31, 33, 32, 50, 38, 36, 37, 39, 40, 45, 47, 42, 41, 43, 44, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 0, 0, 109, 9, 46, 0, - 0, 54, 0, 0, 0, 0, 0, 107, 0, 0, - 0, 0, 0, 0, 0, 0, 109, 4, 13, 22, - 21, 0, 0, 0, 0, 0, 0, 51, 0, 98, - 96, 97, 99, 0, 93, 90, 91, 92, 94, 0, - 0, 0, 0, 109, 20, 4, 0, 0, 0, 0, - 0, 109, 0, 14, 59, 64, 0, 73, 0, 0, - 0, 0, 0, 51, 0, 0, 0, 105, 95, 110, - 61, 0, 78, 0, 79, 80, 81, 82, 69, 0, - 76, 0, 0, 0, 0, 55, 57, 0, 100, 0, - 0, 104, 0, 0, 0, 0, 4, 89, 88, 0, - 84, 87, 109, 71, 67, 0, 75, 0, 65, 66, - 0, 74, 58, 106, 0, 0, 0, 0, 0, 60, - 62, 0, 0, 83, 70, 109, 68, 76, 77, 108, - 103, 0, 0, 63, 89, 86, 85, 72, 101, 0, - 102 + 0, 48, 0, 0, 0, 0, 110, 9, 46, 0, + 0, 54, 0, 0, 0, 0, 0, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 110, 4, 13, 22, + 21, 0, 0, 0, 0, 0, 0, 51, 0, 99, + 97, 98, 100, 0, 93, 90, 95, 91, 92, 94, + 0, 0, 0, 0, 110, 20, 4, 0, 0, 0, + 0, 0, 110, 0, 14, 59, 64, 0, 73, 0, + 0, 0, 0, 0, 51, 0, 0, 0, 106, 96, + 111, 61, 0, 78, 0, 79, 80, 81, 82, 69, + 0, 76, 0, 0, 0, 0, 55, 57, 0, 101, + 0, 0, 105, 0, 0, 0, 0, 4, 89, 88, + 0, 84, 87, 110, 71, 67, 0, 75, 0, 65, + 66, 0, 74, 58, 107, 0, 0, 0, 0, 0, + 60, 62, 0, 0, 83, 70, 110, 68, 76, 77, + 109, 104, 0, 0, 63, 89, 86, 85, 72, 102, + 0, 103 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 8, 19, 64, 65, 9, 10, 68, 131, 27, - 69, 70, 71, 29, 30, 163, 181, 206, 189, 165, - 213, 236, 166, 191, 167, 184, 209, 210, 211, 149, + 69, 70, 71, 29, 30, 164, 182, 207, 190, 166, + 214, 237, 167, 192, 168, 185, 210, 211, 212, 150, 127, 128 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -174 +#define YYPACT_NINF -175 static const yytype_int16 yypact[] = { - 56, 3, 12, 14, 72, 72, 72, 16, 26, -174, - -15, 1, 42, -12, -174, -174, -174, 45, -174, 524, - 60, -174, -174, -5, -174, 2, 1, -174, 819, 55, - -174, 1, 89, 1, -174, -174, 25, 1, 1, 247, + 351, 7, 14, 18, 41, 41, 41, 51, 59, -175, + 22, 1, 60, 5, -175, -175, -175, 64, -175, 275, + 78, -175, -175, 17, -175, 28, 1, -175, 773, -13, + -175, 1, 81, 1, -175, -175, 29, 1, 1, 223, 1, 1, 1, 1, 1, 1, 1, 1, 99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 95, 1, 819, -174, 39, 97, 851, 115, 108, 819, - 59, 122, 595, -174, 62, 976, 976, 997, 997, 245, - 245, 245, -174, 62, 62, 62, 62, 62, 976, 976, - 976, 976, 946, 915, 67, 627, 133, 152, 1, 140, - 1, -174, 1, 1, 1, 90, 181, -174, 516, -37, - 883, 819, 659, 691, 1, 5, 156, -174, 145, 153, - 154, 157, 1, 81, 166, 1, 181, -174, -174, -174, - -174, 105, 103, 1, 1, 723, 1, 1, 107, -174, - -174, -174, -174, 475, -174, -174, -174, -174, -174, 182, - 183, 755, 119, 158, -174, -174, 1, 172, 172, 1, - 1, 181, 131, -174, -174, 174, 19, -174, 279, 322, - 1, 787, 123, 1, 181, 150, 1, -174, -174, -174, - 179, 8, 819, 52, -174, -174, 819, 819, 141, 126, - 48, 128, 117, 117, 78, -174, -174, 354, -174, 186, - 129, 143, 1, 561, 199, 117, -174, 195, -174, -8, - -174, -174, 181, 160, -174, 78, -174, 117, -174, -174, - 78, -174, -174, -174, 191, 181, 397, 1, 1, -174, - 179, 68, 52, -174, -174, 181, -174, -13, -174, -174, - -174, 181, 436, 819, -174, -174, -174, -174, -174, 181, - -174 + 95, 1, 773, -175, 33, 96, 805, 104, 92, 773, + 39, 108, 549, -175, 46, 930, 930, 951, 951, 221, + 221, 221, -175, 46, 46, 46, 46, 46, 930, 930, + 930, 930, 900, 869, 47, 581, 125, 128, 1, 112, + 1, -175, 1, 1, 1, 61, 156, -175, 477, -35, + 837, 773, 613, 645, 1, 2, 140, -175, 139, 143, + 144, 146, 1, 93, 142, 1, 156, -175, -175, -175, + -175, 103, 91, 1, 1, 677, 1, 1, 97, -175, + -175, -175, -175, 455, -175, -175, -175, -175, -175, -175, + 162, 161, 709, 105, 132, -175, -175, 1, 148, 148, + 1, 1, 156, 123, -175, -175, 164, 13, -175, 255, + 299, 1, 741, 107, 1, 156, 137, 1, -175, -175, + -175, 166, 6, 773, 58, -175, -175, 773, 773, 130, + 116, 8, 117, 460, 460, 66, -175, -175, 331, -175, + 174, 120, 131, 1, 515, 192, 460, -175, 194, -175, + -4, -175, -175, 156, 149, -175, 66, -175, 460, -175, + -175, 66, -175, -175, -175, 185, 156, 375, 1, 1, + -175, 166, 69, 58, -175, -175, 156, -175, -6, -175, + -175, -175, 156, 415, 773, -175, -175, -175, -175, -175, + 156, -175 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -174, 192, -118, -174, -174, -174, 111, -174, -174, -174, - -11, -119, -174, -174, -174, -174, -174, -174, -130, 22, - -174, -174, -137, 4, -174, 63, -174, -9, -7, -174, - -173, -102 + -175, 189, -119, -175, -175, -175, 94, -175, -175, -175, + -11, -120, -175, -175, -175, -175, -175, -175, -129, 15, + -175, -175, -137, -3, -175, 55, -175, -18, -16, -175, + -174, -105 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -839,201 +841,186 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -16 static const yytype_int16 yytable[] = { - 28, 201, 164, 215, 21, 22, 23, 24, 232, 153, - 11, 129, 136, 204, 233, 39, 25, 12, 172, 13, - 62, 17, 66, 130, 152, 190, 18, 72, 20, 74, - 75, 76, 77, 78, 79, 80, 81, 180, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 31, - 95, 179, 240, 205, 200, 207, 208, 221, 194, 188, - 32, 1, 218, 33, 215, 36, 193, 37, 248, 40, - 60, 244, 208, 26, 38, 229, 250, 137, 237, 48, - 190, 2, 3, 237, 4, 5, 6, 108, 230, 110, - 194, 111, 112, 113, 63, 193, 61, 67, 7, -15, - 4, 5, 6, 135, 82, 94, 21, 22, 23, 24, - 234, 143, 96, 97, 151, 14, 15, 16, 25, 194, - 99, 74, 168, 169, 144, 171, 100, 156, 157, 158, - 159, 160, 101, 247, 21, 22, 23, 24, 102, 104, - 106, 145, 146, 147, 148, 182, 25, 155, 186, 187, - 220, 39, 156, 157, 158, 159, 160, 107, 109, 197, - 161, 138, 114, 115, 139, 203, 156, 157, 158, 159, - 160, 150, 140, 141, 161, 162, 142, 34, 154, 173, - 156, 157, 158, 159, 160, 116, 115, 175, 161, 217, - 176, 226, 178, 183, 192, 202, 199, 117, 34, 214, - 212, 216, 224, 162, 118, 223, 228, 231, 116, 225, - 239, 35, 119, 120, 121, 219, 242, 243, 235, 238, - 117, 185, 122, 246, 245, 123, 124, 118, 125, 0, - 126, 0, 0, 0, 0, 119, 120, 121, 0, 0, - 0, 0, 0, 0, 0, 122, 0, 0, 123, 124, - 0, 125, 40, 126, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 0, 48, 49, 0, 49, 50, 51, - 50, 51, 0, 0, 0, 0, 52, 53, 52, 53, - 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, - 73, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, - 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 195, 52, 53, 54, 55, 56, 57, 58, - 59, 40, 41, 42, 43, 44, 45, 46, 47, 0, - 0, 48, 0, 0, 49, 0, 0, 50, 51, 0, - 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, - 57, 58, 59, 0, 0, 196, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 41, 42, 43, 44, 45, - 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, - 50, 51, 0, 0, 0, 0, 0, 222, 52, 53, - 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, - 0, 0, 0, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, - 51, 0, 0, 0, 0, 0, 241, 52, 53, 54, - 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, - 0, 0, 40, 41, 42, 43, 44, 45, 46, 47, + 28, 202, 60, 165, 21, 22, 23, 24, 154, 136, + 216, 205, 233, 129, 11, 39, 25, 173, 234, 12, + 62, 153, 66, 13, 216, 130, 191, 72, 61, 74, + 75, 76, 77, 78, 79, 80, 81, 181, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 180, + 95, 206, 241, 40, 201, 194, 17, 189, 222, 18, + 194, 208, 209, 48, 219, 20, 195, 31, 249, 4, + 5, 6, 245, 209, 26, 137, 251, 230, 32, 238, + 195, 191, 33, 36, 238, 195, 63, 108, 231, 110, + 37, 111, 112, 113, 21, 22, 23, 24, 14, 15, + 16, 38, 67, 135, 82, 94, 25, 96, 235, 99, + 100, 143, 97, 101, 152, 157, 158, 159, 160, 161, + 104, 74, 169, 170, 102, 172, 21, 22, 23, 24, + 109, 248, 106, 107, 114, 156, 144, 115, 25, 221, + 157, 158, 159, 160, 161, 138, 183, 151, 162, 187, + 188, 34, 39, 145, 146, 147, 148, 149, 139, 116, + 198, 115, 140, 141, 163, 142, 204, 176, 177, 184, + 174, 117, 157, 158, 159, 160, 161, 155, 118, 179, + 162, 200, 203, 116, 193, 34, 119, 120, 121, 213, + 215, 217, 227, 224, 225, 117, 163, 122, 226, 229, + 123, 124, 118, 125, 240, 126, 232, 236, 35, 220, + 119, 120, 121, 239, 186, 247, 246, 243, 244, 0, + 0, 122, 0, 0, 123, 124, 0, 125, 40, 126, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, + 48, 49, 0, 49, 50, 51, 50, 51, 0, 0, + 0, 0, 52, 53, 52, 53, 54, 55, 56, 57, + 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, - 0, 0, 0, 0, 0, 249, 52, 53, 54, 55, - 56, 57, 58, 59, 0, 0, -12, 0, 0, 0, - 0, -12, 0, 40, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 48, 0, -12, 0, 0, 0, 0, - 174, -12, -12, 34, -12, -12, -12, 0, 0, 2, - 3, 0, 4, 5, 6, 0, 0, 0, -12, -12, - 0, 0, 0, 0, 0, 0, 7, -15, 40, 41, + 1, 0, 0, 0, 0, 0, 52, 53, 54, 55, + 56, 57, 58, 59, 34, 0, 0, 73, 0, 0, + 2, 3, 0, 4, 5, 6, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 0, 48, 7, -15, 49, + 0, 0, 50, 51, 0, 0, 0, 0, 0, 196, + 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, - 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 49, 0, 0, 50, 51, 1, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, - 0, 227, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 103, 48, 0, 0, 49, 0, 0, 50, 51, + 0, 0, 0, 197, 0, 0, 2, 3, 0, 4, + 5, 6, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 7, -15, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 223, 52, 53, 54, 55, + 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 242, 52, 53, 54, 55, + 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 0, 0, 49, 0, -12, 50, 51, + 0, 0, -12, 0, 40, 250, 52, 53, 54, 55, + 56, 57, 58, 59, 48, 0, -12, 0, 0, 0, + 0, 0, -12, -12, 0, -12, -12, -12, 0, 157, + 158, 159, 160, 161, 0, 0, 0, 162, 0, -12, + -12, 175, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 218, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, - 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, - 46, 47, 0, 0, 48, 105, 0, 49, 0, 0, - 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, - 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 133, 48, 0, 0, 49, + 56, 57, 58, 59, 0, 228, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 103, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 134, 48, 0, + 42, 43, 44, 45, 46, 47, 0, 0, 48, 105, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, - 40, 41, 42, 43, 44, 45, 46, 47, 0, 170, + 40, 41, 42, 43, 44, 45, 46, 47, 0, 133, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 0, 48, 0, 177, 49, 0, 0, 50, 51, + 0, 134, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, - 46, 47, 0, 0, 48, 0, 198, 49, 0, 0, + 46, 47, 0, 171, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, + 44, 45, 46, 47, 0, 0, 48, 0, 178, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 52, 53, 54, 55, 56, 57, 58, 59, 98, 41, + 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, - 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 199, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, - 132, 41, 42, 43, 44, 45, 46, 47, 0, 0, + 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, - 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, + 58, 59, 98, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, - 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, - 55, 56, 57, 40, 0, 0, 43, 44, 45, 46, - 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, - 51, 0, 0, 0, 40, 0, 0, 52, 53, 45, + 56, 57, 58, 59, 132, 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, - 50, 51, 0, 0, 0, 0, 0, 0, 52, 53 + 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, + 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, + 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, + 52, 53, 54, 55, 56, 57, 58, 40, 41, 42, + 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, + 49, 0, 0, 50, 51, 0, 0, 0, 0, 0, + 0, 52, 53, 54, 55, 56, 57, 40, 0, 0, + 43, 44, 45, 46, 47, 0, 0, 48, 0, 0, + 49, 0, 0, 50, 51, 0, 0, 0, 40, 0, + 0, 52, 53, 45, 46, 47, 0, 0, 48, 0, + 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 0, 52, 53 }; static const yytype_int16 yycheck[] = { - 11, 174, 132, 16, 3, 4, 5, 6, 16, 127, - 7, 48, 7, 5, 22, 26, 15, 5, 137, 5, - 31, 5, 33, 60, 126, 162, 0, 38, 43, 40, - 41, 42, 43, 44, 45, 46, 47, 155, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 7, - 61, 153, 225, 45, 173, 3, 4, 194, 71, 161, - 72, 5, 192, 18, 16, 5, 47, 72, 241, 7, - 15, 3, 4, 72, 72, 205, 249, 72, 215, 17, - 217, 25, 26, 220, 28, 29, 30, 98, 206, 100, - 71, 102, 103, 104, 5, 47, 41, 72, 42, 43, - 28, 29, 30, 114, 5, 10, 3, 4, 5, 6, - 212, 122, 73, 16, 125, 4, 5, 6, 15, 71, - 5, 132, 133, 134, 43, 136, 18, 49, 50, 51, - 52, 53, 73, 235, 3, 4, 5, 6, 16, 72, - 7, 60, 61, 62, 63, 156, 15, 44, 159, 160, - 72, 162, 49, 50, 51, 52, 53, 5, 18, 170, - 57, 5, 72, 5, 19, 176, 49, 50, 51, 52, - 53, 5, 19, 19, 57, 72, 19, 19, 73, 72, - 49, 50, 51, 52, 53, 27, 5, 5, 57, 72, - 7, 202, 73, 21, 20, 45, 73, 39, 19, 73, - 59, 73, 73, 72, 46, 19, 7, 12, 27, 66, - 19, 19, 54, 55, 56, 193, 227, 228, 58, 215, - 39, 158, 64, 232, 231, 67, 68, 46, 70, -1, - 72, -1, -1, -1, -1, 54, 55, 56, -1, -1, - -1, -1, -1, -1, -1, 64, -1, -1, 67, 68, - -1, 70, 7, 72, 7, 8, 9, 10, 11, 12, - 13, 14, 17, -1, 17, 20, -1, 20, 23, 24, - 23, 24, -1, -1, -1, -1, 31, 32, 31, 32, - 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, - -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, - 31, 32, 33, 34, 35, 36, 37, 38, -1, -1, - 73, -1, -1, -1, -1, -1, -1, -1, -1, 7, - 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, - -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, - -1, -1, 73, 31, 32, 33, 34, 35, 36, 37, - 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, - -1, 17, -1, -1, 20, -1, -1, 23, 24, -1, - -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, - 36, 37, 38, -1, -1, 73, -1, -1, -1, -1, - -1, -1, -1, -1, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, - 23, 24, -1, -1, -1, -1, -1, 73, 31, 32, - 33, 34, 35, 36, 37, 38, -1, -1, -1, -1, - -1, -1, -1, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, - 24, -1, -1, -1, -1, -1, 69, 31, 32, 33, - 34, 35, 36, 37, 38, -1, -1, -1, -1, -1, - -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, + 11, 175, 15, 132, 3, 4, 5, 6, 127, 7, + 16, 5, 16, 48, 7, 26, 15, 137, 22, 5, + 31, 126, 33, 5, 16, 60, 163, 38, 41, 40, + 41, 42, 43, 44, 45, 46, 47, 156, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 154, + 61, 45, 226, 7, 174, 47, 5, 162, 195, 0, + 47, 3, 4, 17, 193, 43, 72, 7, 242, 28, + 29, 30, 3, 4, 73, 73, 250, 206, 73, 216, + 72, 218, 18, 5, 221, 72, 5, 98, 207, 100, + 73, 102, 103, 104, 3, 4, 5, 6, 4, 5, + 6, 73, 73, 114, 5, 10, 15, 74, 213, 5, + 18, 122, 16, 74, 125, 49, 50, 51, 52, 53, + 73, 132, 133, 134, 16, 136, 3, 4, 5, 6, + 18, 236, 7, 5, 73, 44, 43, 5, 15, 73, + 49, 50, 51, 52, 53, 5, 157, 5, 57, 160, + 161, 19, 163, 60, 61, 62, 63, 64, 19, 27, + 171, 5, 19, 19, 73, 19, 177, 5, 7, 21, + 73, 39, 49, 50, 51, 52, 53, 74, 46, 74, + 57, 74, 45, 27, 20, 19, 54, 55, 56, 59, + 74, 74, 203, 19, 74, 39, 73, 65, 67, 7, + 68, 69, 46, 71, 19, 73, 12, 58, 19, 194, + 54, 55, 56, 216, 159, 233, 232, 228, 229, -1, + -1, 65, -1, -1, 68, 69, -1, 71, 7, 73, + 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, + 17, 20, -1, 20, 23, 24, 23, 24, -1, -1, + -1, -1, 31, 32, 31, 32, 33, 34, 35, 36, + 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, - -1, -1, -1, -1, -1, 69, 31, 32, 33, 34, - 35, 36, 37, 38, -1, -1, 0, -1, -1, -1, - -1, 5, -1, 7, -1, -1, -1, -1, -1, 5, - -1, -1, -1, 17, -1, 19, -1, -1, -1, -1, - 65, 25, 26, 19, 28, 29, 30, -1, -1, 25, - 26, -1, 28, 29, 30, -1, -1, -1, 42, 43, - -1, -1, -1, -1, -1, -1, 42, 43, 7, 8, + 5, -1, -1, -1, -1, -1, 31, 32, 33, 34, + 35, 36, 37, 38, 19, -1, -1, 74, -1, -1, + 25, 26, -1, 28, 29, 30, 7, 8, 9, 10, + 11, 12, 13, 14, -1, -1, 17, 42, 43, 20, + -1, -1, 23, 24, -1, -1, -1, -1, -1, 74, + 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, - -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + -1, 20, -1, -1, 23, 24, 5, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, - -1, 40, 7, 8, 9, 10, 11, 12, 13, 14, - -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, + -1, -1, -1, 74, -1, -1, 25, 26, -1, 28, + 29, 30, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, 42, 43, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, 74, 31, 32, 33, 34, + 35, 36, 37, 38, -1, -1, -1, -1, -1, -1, + -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, 70, 31, 32, 33, 34, + 35, 36, 37, 38, -1, -1, -1, -1, -1, -1, + -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, -1, -1, 20, -1, 0, 23, 24, + -1, -1, 5, -1, 7, 70, 31, 32, 33, 34, + 35, 36, 37, 38, 17, -1, 19, -1, -1, -1, + -1, -1, 25, 26, -1, 28, 29, 30, -1, 49, + 50, 51, 52, 53, -1, -1, -1, 57, -1, 42, + 43, 66, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, 73, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, - 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, 17, 18, -1, 20, -1, -1, - 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, - 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, + 35, 36, 37, 38, -1, 40, 7, 8, 9, 10, 11, 12, 13, 14, -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, - 9, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 9, 10, 11, 12, 13, 14, -1, -1, 17, 18, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, 17, -1, 19, 20, -1, -1, 23, 24, + -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, 17, -1, 19, 20, -1, -1, + 13, 14, -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, + 11, 12, 13, 14, -1, -1, 17, -1, 19, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, - -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + 19, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, @@ -1041,46 +1028,53 @@ static const yytype_int16 yycheck[] = 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, - 35, 36, 37, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, - 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, - 34, 35, 36, 7, -1, -1, 10, 11, 12, 13, - 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, - 24, -1, -1, -1, 7, -1, -1, 31, 32, 12, + 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, - 23, 24, -1, -1, -1, -1, -1, -1, 31, 32 + 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, + 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, + 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, + -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, 35, 36, 37, 7, 8, 9, + 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, + 20, -1, -1, 23, 24, -1, -1, -1, -1, -1, + -1, 31, 32, 33, 34, 35, 36, 7, -1, -1, + 10, 11, 12, 13, 14, -1, -1, 17, -1, -1, + 20, -1, -1, 23, 24, -1, -1, -1, 7, -1, + -1, 31, 32, 12, 13, 14, -1, -1, 17, -1, + -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + -1, -1, 31, 32 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 25, 26, 28, 29, 30, 42, 75, 79, - 80, 7, 5, 5, 80, 80, 80, 5, 0, 76, - 43, 3, 4, 5, 6, 15, 72, 83, 84, 87, - 88, 7, 72, 18, 19, 75, 5, 72, 72, 84, + 0, 5, 25, 26, 28, 29, 30, 42, 76, 80, + 81, 7, 5, 5, 81, 81, 81, 5, 0, 77, + 43, 3, 4, 5, 6, 15, 73, 84, 85, 88, + 89, 7, 73, 18, 19, 76, 5, 73, 73, 85, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 23, 24, 31, 32, 33, 34, 35, 36, 37, 38, - 15, 41, 84, 5, 77, 78, 84, 72, 81, 84, - 85, 86, 84, 73, 84, 84, 84, 84, 84, 84, - 84, 84, 5, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 10, 84, 73, 16, 7, 5, - 18, 73, 16, 16, 72, 18, 7, 5, 84, 18, - 84, 84, 84, 84, 72, 5, 27, 39, 46, 54, - 55, 56, 64, 67, 68, 70, 72, 104, 105, 48, - 60, 82, 7, 16, 16, 84, 7, 72, 5, 19, - 19, 19, 19, 84, 43, 60, 61, 62, 63, 103, - 5, 84, 105, 76, 73, 44, 49, 50, 51, 52, - 53, 57, 72, 89, 92, 93, 96, 98, 84, 84, - 16, 84, 85, 72, 65, 5, 7, 19, 73, 105, - 76, 90, 84, 21, 99, 99, 84, 84, 105, 92, - 96, 97, 20, 47, 71, 73, 73, 84, 19, 73, - 85, 104, 45, 84, 5, 45, 91, 3, 4, 100, - 101, 102, 59, 94, 73, 16, 73, 72, 92, 93, - 72, 96, 73, 19, 73, 66, 84, 40, 7, 92, - 76, 12, 16, 22, 105, 58, 95, 96, 97, 19, - 104, 69, 84, 84, 3, 102, 101, 105, 104, 69, - 104 + 15, 41, 85, 5, 78, 79, 85, 73, 82, 85, + 86, 87, 85, 74, 85, 85, 85, 85, 85, 85, + 85, 85, 5, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 10, 85, 74, 16, 7, 5, + 18, 74, 16, 16, 73, 18, 7, 5, 85, 18, + 85, 85, 85, 85, 73, 5, 27, 39, 46, 54, + 55, 56, 65, 68, 69, 71, 73, 105, 106, 48, + 60, 83, 7, 16, 16, 85, 7, 73, 5, 19, + 19, 19, 19, 85, 43, 60, 61, 62, 63, 64, + 104, 5, 85, 106, 77, 74, 44, 49, 50, 51, + 52, 53, 57, 73, 90, 93, 94, 97, 99, 85, + 85, 16, 85, 86, 73, 66, 5, 7, 19, 74, + 106, 77, 91, 85, 21, 100, 100, 85, 85, 106, + 93, 97, 98, 20, 47, 72, 74, 74, 85, 19, + 74, 86, 105, 45, 85, 5, 45, 92, 3, 4, + 101, 102, 103, 59, 95, 74, 16, 74, 73, 93, + 94, 73, 97, 74, 19, 74, 67, 85, 40, 7, + 93, 77, 12, 16, 22, 106, 58, 96, 97, 98, + 19, 105, 70, 85, 85, 3, 103, 102, 106, 105, + 70, 105 }; #define yyerrok (yyerrstatus = 0) @@ -1917,37 +1911,37 @@ yyreduce: switch (yyn) { case 2: -#line 212 "magic-interpreter-parser.y" +#line 213 "magic-interpreter-parser.y" {;} break; case 3: -#line 214 "magic-interpreter-parser.y" +#line 215 "magic-interpreter-parser.y" {;} break; case 4: -#line 219 "magic-interpreter-parser.y" +#line 220 "magic-interpreter-parser.y" {;} break; case 5: -#line 221 "magic-interpreter-parser.y" +#line 222 "magic-interpreter-parser.y" {;} break; case 6: -#line 226 "magic-interpreter-parser.y" +#line 227 "magic-interpreter-parser.y" { (yyval.proc) = aCalloc(sizeof(proc_t), 1); ;} break; case 7: -#line 228 "magic-interpreter-parser.y" +#line 229 "magic-interpreter-parser.y" { (yyval.proc) = (yyvsp[(1) - (1)].proc); ;} break; case 8: -#line 232 "magic-interpreter-parser.y" +#line 233 "magic-interpreter-parser.y" { (yyval.proc) = aCalloc(sizeof(proc_t), 1); (yyval.proc)->args_nr = 1; (yyval.proc)->args = malloc(sizeof(int)); @@ -1956,7 +1950,7 @@ yyreduce: break; case 9: -#line 238 "magic-interpreter-parser.y" +#line 239 "magic-interpreter-parser.y" { (yyval.proc) = (yyvsp[(1) - (3)].proc); (yyval.proc)->args = realloc((yyval.proc)->args, sizeof(int) * (1 + (yyval.proc)->args_nr)); (yyval.proc)->args[(yyval.proc)->args_nr++] = intern_id((yyvsp[(3) - (3)].s)); @@ -1964,7 +1958,7 @@ yyreduce: break; case 10: -#line 245 "magic-interpreter-parser.y" +#line 246 "magic-interpreter-parser.y" { int var_id; if (find_constant((yyvsp[(1) - (3)].s))) { @@ -1978,7 +1972,7 @@ yyreduce: break; case 11: -#line 256 "magic-interpreter-parser.y" +#line 257 "magic-interpreter-parser.y" { val_t var; magic_eval(&magic_default_env, &var, (yyvsp[(4) - (4)].expr)); @@ -1987,7 +1981,7 @@ yyreduce: break; case 12: -#line 262 "magic-interpreter-parser.y" +#line 263 "magic-interpreter-parser.y" { teleport_anchor_t *anchor = calloc(sizeof(teleport_anchor_t), 1); anchor->name = (yyvsp[(2) - (6)].s); @@ -2001,7 +1995,7 @@ yyreduce: break; case 13: -#line 273 "magic-interpreter-parser.y" +#line 274 "magic-interpreter-parser.y" { proc_t *proc = (yyvsp[(4) - (7)].proc); proc->name = (yyvsp[(2) - (7)].s); @@ -2013,7 +2007,7 @@ yyreduce: break; case 14: -#line 282 "magic-interpreter-parser.y" +#line 283 "magic-interpreter-parser.y" { spell_t *spell = (yyvsp[(8) - (8)].spell); spell->name = (yyvsp[(3) - (8)].s); spell->invocation = magic_eval_str(&magic_default_env, (yyvsp[(6) - (8)].expr)); @@ -2027,12 +2021,12 @@ yyreduce: break; case 15: -#line 294 "magic-interpreter-parser.y" +#line 295 "magic-interpreter-parser.y" { (yyval.i) = 0; ;} break; case 16: -#line 296 "magic-interpreter-parser.y" +#line 297 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_LOCAL) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`LOCAL' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_LOCAL; @@ -2040,7 +2034,7 @@ yyreduce: break; case 17: -#line 301 "magic-interpreter-parser.y" +#line 302 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_NONMAGIC) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`NONMAGIC' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_NONMAGIC; @@ -2048,7 +2042,7 @@ yyreduce: break; case 18: -#line 306 "magic-interpreter-parser.y" +#line 307 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_SILENT) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`SILENT' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_SILENT; @@ -2056,52 +2050,52 @@ yyreduce: break; case 19: -#line 313 "magic-interpreter-parser.y" +#line 314 "magic-interpreter-parser.y" { (yyval.spellarg_def).ty = SPELLARG_NONE; ;} break; case 20: -#line 315 "magic-interpreter-parser.y" +#line 316 "magic-interpreter-parser.y" { (yyval.spellarg_def).id = intern_id((yyvsp[(2) - (5)].s)); (yyval.spellarg_def).ty = (yyvsp[(4) - (5)].i); ;} break; case 21: -#line 321 "magic-interpreter-parser.y" +#line 322 "magic-interpreter-parser.y" { (yyval.i) = SPELLARG_PC; ;} break; case 22: -#line 323 "magic-interpreter-parser.y" +#line 324 "magic-interpreter-parser.y" { (yyval.i) = SPELLARG_STRING; ;} break; case 23: -#line 328 "magic-interpreter-parser.y" +#line 329 "magic-interpreter-parser.y" { (yyval.value).ty = TY_DIR; (yyval.value).v.v_int = (yyvsp[(1) - (1)].i); ;} break; case 24: -#line 331 "magic-interpreter-parser.y" +#line 332 "magic-interpreter-parser.y" { (yyval.value).ty = TY_INT; (yyval.value).v.v_int = (yyvsp[(1) - (1)].i); ;} break; case 25: -#line 334 "magic-interpreter-parser.y" +#line 335 "magic-interpreter-parser.y" { (yyval.value).ty = TY_STRING; (yyval.value).v.v_string = (yyvsp[(1) - (1)].s); ;} break; case 26: -#line 340 "magic-interpreter-parser.y" +#line 341 "magic-interpreter-parser.y" { (yyval.expr) = magic_new_expr(EXPR_VAL); (yyval.expr)->e.e_val = (yyvsp[(1) - (1)].value); ;} break; case 27: -#line 343 "magic-interpreter-parser.y" +#line 344 "magic-interpreter-parser.y" { val_t *val; if ((val = find_constant((yyvsp[(1) - (1)].s)))) { @@ -2115,109 +2109,109 @@ yyreduce: break; case 28: -#line 354 "magic-interpreter-parser.y" +#line 355 "magic-interpreter-parser.y" { (yyval.expr) = magic_new_expr(EXPR_AREA); (yyval.expr)->e.e_area = (yyvsp[(1) - (1)].area); ;} break; case 29: -#line 357 "magic-interpreter-parser.y" +#line 358 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "+", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 30: -#line 359 "magic-interpreter-parser.y" +#line 360 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "-", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 31: -#line 361 "magic-interpreter-parser.y" +#line 362 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "*", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 32: -#line 363 "magic-interpreter-parser.y" +#line 364 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "%", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 33: -#line 365 "magic-interpreter-parser.y" +#line 366 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "/", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 34: -#line 367 "magic-interpreter-parser.y" +#line 368 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">", (yyvsp[(3) - (3)].expr), (yyvsp[(1) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 35: -#line 369 "magic-interpreter-parser.y" +#line 370 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 36: -#line 371 "magic-interpreter-parser.y" +#line 372 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "&", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 37: -#line 373 "magic-interpreter-parser.y" +#line 374 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "^", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 38: -#line 375 "magic-interpreter-parser.y" +#line 376 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "|", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 39: -#line 377 "magic-interpreter-parser.y" +#line 378 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "<<", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 40: -#line 379 "magic-interpreter-parser.y" +#line 380 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">>", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 41: -#line 381 "magic-interpreter-parser.y" +#line 382 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">=", (yyvsp[(3) - (3)].expr), (yyvsp[(1) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 42: -#line 383 "magic-interpreter-parser.y" +#line 384 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 43: -#line 385 "magic-interpreter-parser.y" +#line 386 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "&&", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 44: -#line 387 "magic-interpreter-parser.y" +#line 388 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "||", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 45: -#line 389 "magic-interpreter-parser.y" +#line 390 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 46: -#line 391 "magic-interpreter-parser.y" +#line 392 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 47: -#line 393 "magic-interpreter-parser.y" +#line 394 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); (yyval.expr) = fun_expr("not", 1, &(yyval.expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 48: -#line 396 "magic-interpreter-parser.y" +#line 397 "magic-interpreter-parser.y" { (yyval.expr) = fun_expr((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].arg_list).args_nr, (yyvsp[(3) - (4)].arg_list).args, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column); if ((yyvsp[(3) - (4)].arg_list).args) free((yyvsp[(3) - (4)].arg_list).args); @@ -2225,27 +2219,27 @@ yyreduce: break; case 49: -#line 401 "magic-interpreter-parser.y" +#line 402 "magic-interpreter-parser.y" { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} break; case 50: -#line 403 "magic-interpreter-parser.y" +#line 404 "magic-interpreter-parser.y" { (yyval.expr) = dot_expr((yyvsp[(1) - (3)].expr), intern_id((yyvsp[(3) - (3)].s))); ;} break; case 51: -#line 407 "magic-interpreter-parser.y" +#line 408 "magic-interpreter-parser.y" { (yyval.arg_list).args_nr = 0; ;} break; case 52: -#line 409 "magic-interpreter-parser.y" +#line 410 "magic-interpreter-parser.y" { (yyval.arg_list) = (yyvsp[(1) - (1)].arg_list) ;} break; case 53: -#line 414 "magic-interpreter-parser.y" +#line 415 "magic-interpreter-parser.y" { (yyval.arg_list).args = aCalloc(sizeof(expr_t *), 1); (yyval.arg_list).args_nr = 1; (yyval.arg_list).args[0] = (yyvsp[(1) - (1)].expr); @@ -2253,26 +2247,26 @@ yyreduce: break; case 54: -#line 419 "magic-interpreter-parser.y" +#line 420 "magic-interpreter-parser.y" { (yyval.arg_list).args = realloc((yyval.arg_list).args, (1 + (yyval.arg_list).args_nr) * sizeof(expr_t *)); (yyval.arg_list).args[(yyval.arg_list).args_nr++] = (yyvsp[(3) - (3)].expr); ;} break; case 55: -#line 426 "magic-interpreter-parser.y" +#line 427 "magic-interpreter-parser.y" { (yyval.location).m = (yyvsp[(3) - (8)].expr); (yyval.location).x = (yyvsp[(5) - (8)].expr); (yyval.location).y = (yyvsp[(7) - (8)].expr); ;} break; case 56: -#line 430 "magic-interpreter-parser.y" +#line 431 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_LOCATION; (yyval.area).a.a_loc = (yyvsp[(1) - (1)].location); ;} break; case 57: -#line 434 "magic-interpreter-parser.y" +#line 435 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_RECT; (yyval.area).a.a_rect.loc = (yyvsp[(1) - (8)].location); (yyval.area).a.a_rect.width = (yyvsp[(5) - (8)].expr); @@ -2281,7 +2275,7 @@ yyreduce: break; case 58: -#line 440 "magic-interpreter-parser.y" +#line 441 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_BAR; (yyval.area).a.a_bar.loc = (yyvsp[(1) - (9)].location); (yyval.area).a.a_bar.width = (yyvsp[(6) - (9)].expr); @@ -2291,12 +2285,12 @@ yyreduce: break; case 59: -#line 450 "magic-interpreter-parser.y" +#line 451 "magic-interpreter-parser.y" { (yyval.spell) = new_spell((yyvsp[(1) - (1)].spellguard)); ;} break; case 60: -#line 452 "magic-interpreter-parser.y" +#line 453 "magic-interpreter-parser.y" { (yyval.spell) = new_spell((yyvsp[(4) - (4)].spellguard)); (yyval.spell)->letdefs_nr = (yyvsp[(2) - (4)].letdefs).letdefs_nr; (yyval.spell)->letdefs = (yyvsp[(2) - (4)].letdefs).letdefs; @@ -2305,14 +2299,14 @@ yyreduce: break; case 61: -#line 461 "magic-interpreter-parser.y" +#line 462 "magic-interpreter-parser.y" { (yyval.letdefs).letdefs_nr = 0; (yyval.letdefs).letdefs = (letdef_t *) malloc(1); ;} break; case 62: -#line 465 "magic-interpreter-parser.y" +#line 466 "magic-interpreter-parser.y" { (yyval.letdefs) = (yyvsp[(1) - (3)].letdefs); (yyval.letdefs).letdefs_nr++; (yyval.letdefs).letdefs = realloc((yyval.letdefs).letdefs, sizeof(letdef_t) * (yyval.letdefs).letdefs_nr); @@ -2321,7 +2315,7 @@ yyreduce: break; case 63: -#line 474 "magic-interpreter-parser.y" +#line 475 "magic-interpreter-parser.y" { if (find_constant((yyvsp[(1) - (3)].s))) { fail((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, "Attempt to re-define constant `%s' as LET-bound variable.\n", (yyvsp[(1) - (3)].s)); @@ -2334,12 +2328,12 @@ yyreduce: break; case 64: -#line 487 "magic-interpreter-parser.y" +#line 488 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; case 65: -#line 489 "magic-interpreter-parser.y" +#line 490 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_CHOICE); sg->next = (yyvsp[(1) - (3)].spellguard); sg->s.s_alt = (yyvsp[(3) - (3)].spellguard); @@ -2348,17 +2342,17 @@ yyreduce: break; case 66: -#line 498 "magic-interpreter-parser.y" +#line 499 "magic-interpreter-parser.y" { (yyval.spellguard) = spellguard_implication((yyvsp[(1) - (3)].spellguard), (yyvsp[(3) - (3)].spellguard)); ;} break; case 67: -#line 500 "magic-interpreter-parser.y" +#line 501 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(2) - (3)].spellguard); ;} break; case 68: -#line 502 "magic-interpreter-parser.y" +#line 503 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_EFFECT); sg->s.s_effect.effect = (yyvsp[(2) - (4)].effect); sg->s.s_effect.at_trigger = (yyvsp[(3) - (4)].effect); @@ -2368,32 +2362,32 @@ yyreduce: break; case 69: -#line 512 "magic-interpreter-parser.y" +#line 513 "magic-interpreter-parser.y" { (yyval.effect) = NULL; ;} break; case 70: -#line 514 "magic-interpreter-parser.y" +#line 515 "magic-interpreter-parser.y" { (yyval.effect) = (yyvsp[(2) - (2)].effect); ;} break; case 71: -#line 519 "magic-interpreter-parser.y" +#line 520 "magic-interpreter-parser.y" { (yyval.effect) = NULL; ;} break; case 72: -#line 521 "magic-interpreter-parser.y" +#line 522 "magic-interpreter-parser.y" { (yyval.effect) = (yyvsp[(2) - (2)].effect); ;} break; case 73: -#line 526 "magic-interpreter-parser.y" +#line 527 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; case 74: -#line 528 "magic-interpreter-parser.y" +#line 529 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_CHOICE); sg->next = (yyvsp[(1) - (3)].spellguard); sg->s.s_alt = (yyvsp[(3) - (3)].spellguard); @@ -2402,86 +2396,86 @@ yyreduce: break; case 75: -#line 534 "magic-interpreter-parser.y" +#line 535 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(2) - (3)].spellguard); ;} break; case 76: -#line 539 "magic-interpreter-parser.y" +#line 540 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; case 77: -#line 541 "magic-interpreter-parser.y" +#line 542 "magic-interpreter-parser.y" { (yyval.spellguard) = spellguard_implication ((yyvsp[(1) - (3)].spellguard), (yyvsp[(3) - (3)].spellguard)); ;} break; case 78: -#line 546 "magic-interpreter-parser.y" +#line 547 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CONDITION); (yyval.spellguard)->s.s_condition = (yyvsp[(2) - (2)].expr); ;} break; case 79: -#line 550 "magic-interpreter-parser.y" +#line 551 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CATALYSTS); (yyval.spellguard)->s.s_catalysts = (yyvsp[(2) - (2)].components); ;} break; case 80: -#line 554 "magic-interpreter-parser.y" +#line 555 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_COMPONENTS); (yyval.spellguard)->s.s_components = (yyvsp[(2) - (2)].components); ;} break; case 81: -#line 558 "magic-interpreter-parser.y" +#line 559 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_MANA); (yyval.spellguard)->s.s_mana = (yyvsp[(2) - (2)].expr); ;} break; case 82: -#line 562 "magic-interpreter-parser.y" +#line 563 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CASTTIME); (yyval.spellguard)->s.s_casttime = (yyvsp[(2) - (2)].expr); ;} break; case 83: -#line 569 "magic-interpreter-parser.y" +#line 570 "magic-interpreter-parser.y" { (yyval.components) = (yyvsp[(2) - (3)].components); ;} break; case 84: -#line 574 "magic-interpreter-parser.y" +#line 575 "magic-interpreter-parser.y" { (yyval.components) = NULL; magic_add_component(&(yyval.components), (yyvsp[(1) - (1)].component).id, (yyvsp[(1) - (1)].component).count); ;} break; case 85: -#line 578 "magic-interpreter-parser.y" +#line 579 "magic-interpreter-parser.y" { (yyval.components) = (yyvsp[(1) - (3)].components); magic_add_component(&(yyval.components), (yyvsp[(3) - (3)].component).id, (yyvsp[(3) - (3)].component).count); ;} break; case 86: -#line 585 "magic-interpreter-parser.y" +#line 586 "magic-interpreter-parser.y" { (yyval.component).id = (yyvsp[(3) - (3)].i); (yyval.component).count = (yyvsp[(1) - (3)].i); ;} break; case 87: -#line 587 "magic-interpreter-parser.y" +#line 588 "magic-interpreter-parser.y" { (yyval.component).id = (yyvsp[(1) - (1)].i); (yyval.component).count = 1; ;} break; case 88: -#line 592 "magic-interpreter-parser.y" +#line 593 "magic-interpreter-parser.y" { struct item_data *item = itemdb_searchname((yyvsp[(1) - (1)].s)); if (!item) { fail ((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, "Unknown item `%s'\n", (yyvsp[(1) - (1)].s)); @@ -2493,62 +2487,67 @@ yyreduce: break; case 89: -#line 601 "magic-interpreter-parser.y" +#line 602 "magic-interpreter-parser.y" { (yyval.i) = (yyvsp[(1) - (1)].i); ;} break; case 90: -#line 606 "magic-interpreter-parser.y" +#line 607 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_PC; ;} break; case 91: -#line 608 "magic-interpreter-parser.y" +#line 609 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_MOB; ;} break; case 92: -#line 610 "magic-interpreter-parser.y" +#line 611 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_ENTITY; ;} break; case 93: -#line 612 "magic-interpreter-parser.y" +#line 613 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_SPELL; ;} break; case 94: -#line 614 "magic-interpreter-parser.y" +#line 615 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_TARGET; ;} break; case 95: -#line 619 "magic-interpreter-parser.y" - { (yyval.effect) = (yyvsp[(2) - (3)].effect); ;} +#line 617 "magic-interpreter-parser.y" + { (yyval.i) = FOREACH_FILTER_NPC; ;} break; case 96: -#line 621 "magic-interpreter-parser.y" - { (yyval.effect) = new_effect(EFFECT_SKIP); ;} +#line 622 "magic-interpreter-parser.y" + { (yyval.effect) = (yyvsp[(2) - (3)].effect); ;} break; case 97: -#line 623 "magic-interpreter-parser.y" - { (yyval.effect) = new_effect(EFFECT_ABORT); ;} +#line 624 "magic-interpreter-parser.y" + { (yyval.effect) = new_effect(EFFECT_SKIP); ;} break; case 98: -#line 625 "magic-interpreter-parser.y" - { (yyval.effect) = new_effect(EFFECT_END); ;} +#line 626 "magic-interpreter-parser.y" + { (yyval.effect) = new_effect(EFFECT_ABORT); ;} break; case 99: -#line 627 "magic-interpreter-parser.y" - { (yyval.effect) = new_effect(EFFECT_BREAK); ;} +#line 628 "magic-interpreter-parser.y" + { (yyval.effect) = new_effect(EFFECT_END); ;} break; case 100: -#line 629 "magic-interpreter-parser.y" +#line 630 "magic-interpreter-parser.y" + { (yyval.effect) = new_effect(EFFECT_BREAK); ;} + break; + + case 101: +#line 632 "magic-interpreter-parser.y" { if (find_constant((yyvsp[(1) - (4)].s))) { fail((yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, "Attempt to re-define constant `%s' in assignment.", (yyvsp[(1) - (4)].s)); @@ -2561,8 +2560,8 @@ yyreduce: ;} break; - case 101: -#line 640 "magic-interpreter-parser.y" + case 102: +#line 643 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_FOREACH); (yyval.effect)->e.e_foreach.id = intern_id((yyvsp[(3) - (7)].s)); (yyval.effect)->e.e_foreach.area = (yyvsp[(5) - (7)].expr); @@ -2571,8 +2570,8 @@ yyreduce: ;} break; - case 102: -#line 647 "magic-interpreter-parser.y" + case 103: +#line 650 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_FOR); (yyval.effect)->e.e_for.id = intern_id((yyvsp[(2) - (8)].s)); (yyval.effect)->e.e_for.start = (yyvsp[(4) - (8)].expr); @@ -2581,8 +2580,8 @@ yyreduce: ;} break; - case 103: -#line 654 "magic-interpreter-parser.y" + case 104: +#line 657 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_IF); (yyval.effect)->e.e_if.cond = (yyvsp[(2) - (6)].expr); (yyval.effect)->e.e_if.true_branch = (yyvsp[(4) - (6)].effect); @@ -2590,8 +2589,8 @@ yyreduce: ;} break; - case 104: -#line 660 "magic-interpreter-parser.y" + case 105: +#line 663 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_IF); (yyval.effect)->e.e_if.cond = (yyvsp[(2) - (4)].expr); (yyval.effect)->e.e_if.true_branch = (yyvsp[(4) - (4)].effect); @@ -2599,22 +2598,22 @@ yyreduce: ;} break; - case 105: -#line 666 "magic-interpreter-parser.y" + case 106: +#line 669 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SLEEP); (yyval.effect)->e.e_sleep = (yyvsp[(2) - (3)].expr); ;} break; - case 106: -#line 670 "magic-interpreter-parser.y" + case 107: +#line 673 "magic-interpreter-parser.y" { (yyval.effect) = op_effect((yyvsp[(1) - (5)].s), (yyvsp[(3) - (5)].arg_list).args_nr, (yyvsp[(3) - (5)].arg_list).args, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column); free((yyvsp[(1) - (5)].s)); ;} break; - case 107: -#line 674 "magic-interpreter-parser.y" + case 108: +#line 677 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SCRIPT); (yyval.effect)->e.e_script = parse_script((unsigned char *) (yyvsp[(1) - (1)].s), (yylsp[(1) - (1)]).first_line); free((yyvsp[(1) - (1)].s)); @@ -2623,26 +2622,26 @@ yyreduce: ;} break; - case 108: -#line 681 "magic-interpreter-parser.y" + case 109: +#line 684 "magic-interpreter-parser.y" { (yyval.effect) = call_proc((yyvsp[(2) - (6)].s), (yyvsp[(4) - (6)].arg_list).args_nr, (yyvsp[(4) - (6)].arg_list).args, (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column); free((yyvsp[(2) - (6)].s)); ;} break; - case 109: -#line 687 "magic-interpreter-parser.y" + case 110: +#line 690 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SKIP); ;} break; - case 110: -#line 689 "magic-interpreter-parser.y" + case 111: +#line 692 "magic-interpreter-parser.y" { (yyval.effect) = set_effect_continuation((yyvsp[(1) - (3)].effect), (yyvsp[(3) - (3)].effect)); ;} break; /* Line 1267 of yacc.c. */ -#line 2646 "magic-interpreter-parser.c" +#line 2645 "magic-interpreter-parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2862,7 +2861,7 @@ yyreturn: } -#line 693 "magic-interpreter-parser.y" +#line 696 "magic-interpreter-parser.y" /* We do incremental realloc here to store our results. Since this happens only once diff --git a/src/map/magic-interpreter-parser.h b/src/map/magic-interpreter-parser.h index 9b84fa1..b2f0e66 100644 --- a/src/map/magic-interpreter-parser.h +++ b/src/map/magic-interpreter-parser.h @@ -79,17 +79,18 @@ ATEND = 295, ATTRIGGER = 296, PC_F = 297, - MOB_F = 298, - ENTITY_F = 299, - TARGET_F = 300, - IF = 301, - THEN = 302, - ELSE = 303, - FOREACH = 304, - FOR = 305, - DO = 306, - SLEEP = 307, - OR = 308 + NPC_F = 298, + MOB_F = 299, + ENTITY_F = 300, + TARGET_F = 301, + IF = 302, + THEN = 303, + ELSE = 304, + FOREACH = 305, + FOR = 306, + DO = 307, + SLEEP = 308, + OR = 309 }; #endif /* Tokens. */ @@ -133,17 +134,18 @@ #define ATEND 295 #define ATTRIGGER 296 #define PC_F 297 -#define MOB_F 298 -#define ENTITY_F 299 -#define TARGET_F 300 -#define IF 301 -#define THEN 302 -#define ELSE 303 -#define FOREACH 304 -#define FOR 305 -#define DO 306 -#define SLEEP 307 -#define OR 308 +#define NPC_F 298 +#define MOB_F 299 +#define ENTITY_F 300 +#define TARGET_F 301 +#define IF 302 +#define THEN 303 +#define ELSE 304 +#define FOREACH 305 +#define FOR 306 +#define DO 307 +#define SLEEP 308 +#define OR 309 @@ -172,7 +174,7 @@ typedef union YYSTYPE proc_t *proc; } /* Line 1489 of yacc.c. */ -#line 176 "magic-interpreter-parser.h" +#line 178 "magic-interpreter-parser.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 diff --git a/src/map/magic-interpreter-parser.y b/src/map/magic-interpreter-parser.y index deb686d..047e38c 100644 --- a/src/map/magic-interpreter-parser.y +++ b/src/map/magic-interpreter-parser.y @@ -154,6 +154,7 @@ find_constant(char *name); %token ATEND %token ATTRIGGER %token PC_F +%token NPC_F %token MOB_F %token ENTITY_F %token TARGET_F @@ -612,6 +613,8 @@ selection : PC_F { $$ = FOREACH_FILTER_SPELL; } | TARGET_F { $$ = FOREACH_FILTER_TARGET; } + | NPC_F + { $$ = FOREACH_FILTER_NPC; } ; diff --git a/src/map/magic-interpreter.h b/src/map/magic-interpreter.h index 0e6218e..ebc49ee 100644 --- a/src/map/magic-interpreter.h +++ b/src/map/magic-interpreter.h @@ -166,6 +166,7 @@ typedef struct expr { #define FOREACH_FILTER_ENTITY 3 #define FOREACH_FILTER_TARGET 4 #define FOREACH_FILTER_SPELL 5 +#define FOREACH_FILTER_NPC 6 typedef struct effect { struct effect* next; diff --git a/src/map/magic-interpreter.l b/src/map/magic-interpreter.l index c16ba8e..2c9792f 100644 --- a/src/map/magic-interpreter.l +++ b/src/map/magic-interpreter.l @@ -86,6 +86,7 @@ "ATTRIGGER" {FIXLOC; return ATTRIGGER;} "CONST" {FIXLOC; return CONST;} "PC" {FIXLOC; return PC_F;} +"NPC" {FIXLOC; return NPC_F;} "MOB" {FIXLOC; return MOB_F;} "ENTITY" {FIXLOC; return ENTITY_F;} "TARGET" {FIXLOC; return TARGET_F;} diff --git a/src/map/magic-stmt.c b/src/map/magic-stmt.c index c9984af..153d380 100644 --- a/src/map/magic-stmt.c +++ b/src/map/magic-stmt.c @@ -984,6 +984,12 @@ find_entities_in_area_c(entity_t *target, va_list va) } else return 0; + case BL_NPC: + if (filter == FOREACH_FILTER_NPC) + break; + else + return 0; + default: return 0; } |