From d60ef405c9f3eca13dd7e505c8c330ec0241ff02 Mon Sep 17 00:00:00 2001 From: Yashas Date: Mon, 31 Dec 2018 10:34:38 +0530 Subject: [PATCH] force `sc_tokens` size and token enumeration size to match --- source/compiler/sc.h | 5 ++++- source/compiler/sc2.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/compiler/sc.h b/source/compiler/sc.h index a418350..65a1bfa 100644 --- a/source/compiler/sc.h +++ b/source/compiler/sc.h @@ -421,7 +421,10 @@ enum { teLOCAL, /* local variable (name or offset) */ teFUNCTN, /* Pawn function */ teNATIVE, /* native function */ - teNONNEG , /* nonnegative integer */ + teNONNEG, /* nonnegative integer */ + + tlexLAST = teNONNEG, + /* for assigment to "lastst" only (see SC1.C) */ tEXPR, tENDLESS, /* endless loop */ diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index d30c34f..2ae7943 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -2133,7 +2133,7 @@ SC_FUNC void lexinit(void) _lexnewline=FALSE; } -char *sc_tokens[] = { +char *sc_tokens[tlexLAST-tFIRST+1] = { "*=", "/=", "%=", "+=", "-=", "<<=", ">>>=", ">>=", "&=", "^=", "|=", "||", "&&", "==", "!=", "<=", ">=", "<<", ">>>", ">>", "++", "--", "...", "..",