Remove 'state' keyword from compiler (bug 4572, r=dvander).
Remove 'state' keyword from compiler (
bug 4572, r=dvander).
1.1 --- a/sourcepawn/compiler/sc.h Sat Dec 28 08:19:34 2013 -0500
1.2 +++ b/sourcepawn/compiler/sc.h Sat Dec 28 08:42:50 2013 -0500
1.3 @@ -293,7 +293,7 @@
1.4 */
1.5 #define tFIRST 256 /* value of first multi-character operator */
1.6 #define tMIDDLE 280 /* value of last multi-character operator */
1.7 -#define tLAST 333 /* value of last multi-character match-able token */
1.8 +#define tLAST 332 /* value of last multi-character match-able token */
1.9 /* multi-character operators */
1.10 #define taMULT 256 /* *= */
1.11 #define taDIV 257 /* /= */
1.12 @@ -350,40 +350,39 @@
1.13 #define tRETURN 307
1.14 #define tSIZEOF 308
1.15 #define tSLEEP 309
1.16 -#define tSTATE 310
1.17 -#define tSTATIC 311
1.18 -#define tSTOCK 312
1.19 -#define tSTRUCT 313
1.20 -#define tSWITCH 314
1.21 -#define tTAGOF 315
1.22 -#define tTHEN 316
1.23 -#define tWHILE 317
1.24 +#define tSTATIC 310
1.25 +#define tSTOCK 311
1.26 +#define tSTRUCT 312
1.27 +#define tSWITCH 313
1.28 +#define tTAGOF 314
1.29 +#define tTHEN 315
1.30 +#define tWHILE 316
1.31 /* compiler directives */
1.32 -#define tpASSERT 318 /* #assert */
1.33 -#define tpDEFINE 319
1.34 -#define tpELSE 320 /* #else */
1.35 -#define tpELSEIF 321 /* #elseif */
1.36 -#define tpEMIT 322
1.37 -#define tpENDIF 323
1.38 -#define tpENDINPUT 324
1.39 -#define tpENDSCRPT 325
1.40 -#define tpERROR 326
1.41 -#define tpFILE 327
1.42 -#define tpIF 328 /* #if */
1.43 -#define tINCLUDE 329
1.44 -#define tpLINE 330
1.45 -#define tpPRAGMA 331
1.46 -#define tpTRYINCLUDE 332
1.47 -#define tpUNDEF 333
1.48 +#define tpASSERT 317 /* #assert */
1.49 +#define tpDEFINE 318
1.50 +#define tpELSE 319 /* #else */
1.51 +#define tpELSEIF 320 /* #elseif */
1.52 +#define tpEMIT 321
1.53 +#define tpENDIF 322
1.54 +#define tpENDINPUT 323
1.55 +#define tpENDSCRPT 324
1.56 +#define tpERROR 325
1.57 +#define tpFILE 326
1.58 +#define tpIF 327 /* #if */
1.59 +#define tINCLUDE 328
1.60 +#define tpLINE 329
1.61 +#define tpPRAGMA 330
1.62 +#define tpTRYINCLUDE 331
1.63 +#define tpUNDEF 332
1.64 /* semicolon is a special case, because it can be optional */
1.65 -#define tTERM 334 /* semicolon or newline */
1.66 -#define tENDEXPR 335 /* forced end of expression */
1.67 +#define tTERM 333 /* semicolon or newline */
1.68 +#define tENDEXPR 334 /* forced end of expression */
1.69 /* other recognized tokens */
1.70 -#define tNUMBER 336 /* integer number */
1.71 -#define tRATIONAL 337 /* rational number */
1.72 -#define tSYMBOL 338
1.73 -#define tLABEL 339
1.74 -#define tSTRING 340
1.75 +#define tNUMBER 335 /* integer number */
1.76 +#define tRATIONAL 336 /* rational number */
1.77 +#define tSYMBOL 337
1.78 +#define tLABEL 338
1.79 +#define tSTRING 339
1.80 #define tEXPR 341 /* for assigment to "lastst" only (see SC1.C) */
1.81 #define tENDLESS 342 /* endless loop, for assigment to "lastst" only */
1.82 #define tEMPTYBLOCK 343 /* empty blocks for AM bug 4825 */
2.1 --- a/sourcepawn/compiler/sc1.c Sat Dec 28 08:19:34 2013 -0500
2.2 +++ b/sourcepawn/compiler/sc1.c Sat Dec 28 08:42:50 2013 -0500
2.3 @@ -5730,10 +5730,6 @@
2.4 dosleep();
2.5 lastst=tSLEEP;
2.6 break;
2.7 - case tSTATE:
2.8 - dostate();
2.9 - lastst=tSTATE;
2.10 - break;
2.11 case tCONST:
2.12 decl_const(sLOCAL);
2.13 break;
3.1 --- a/sourcepawn/compiler/sc2.c Sat Dec 28 08:19:34 2013 -0500
3.2 +++ b/sourcepawn/compiler/sc2.c Sat Dec 28 08:42:50 2013 -0500
3.3 @@ -1852,7 +1852,7 @@
3.4 "assert", "*begin", "break", "case", "cellsof", "chars", "const", "continue", "default",
3.5 "defined", "do", "else", "*end", "enum", "exit", "for", "forward", "funcenum", "functag", "goto",
3.6 "if", "native", "new", "decl", "operator", "public", "return", "sizeof",
3.7 - "sleep", "state", "static", "stock", "struct", "switch", "tagof", "*then", "while",
3.8 + "sleep", "static", "stock", "struct", "switch", "tagof", "*then", "while",
3.9 "#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput",
3.10 "#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
3.11 "#tryinclude", "#undef",
4.1 --- a/sourcepawn/compiler/sc3.c Sat Dec 28 08:19:34 2013 -0500
4.2 +++ b/sourcepawn/compiler/sc3.c Sat Dec 28 08:42:50 2013 -0500
4.3 @@ -1703,22 +1703,6 @@
4.4 while (paranthese--)
4.5 needtoken(')');
4.6 return FALSE;
4.7 - case tSTATE: {
4.8 - constvalue *automaton;
4.9 - constvalue *state;
4.10 - if (sc_getstateid(&automaton,&state)) {
4.11 - assert(automaton!=NULL);
4.12 - assert((automaton->index==0 && automaton->name[0]=='\0') || automaton->index>0);
4.13 - loadreg(automaton->value,sALT);
4.14 - assert(state!=NULL);
4.15 - ldconst(state->value,sPRI);
4.16 - ob_eq();
4.17 - clear_value(lval);
4.18 - lval->ident=iEXPRESSION;
4.19 - lval->tag=pc_addtag("bool");
4.20 - } /* if */
4.21 - return FALSE;
4.22 - } /* case */
4.23 default:
4.24 lexpush();
4.25 lvalue=hier1(lval);