Make priority array max size explicit.
we were implicitly depending on UMINUS being the last entry in the operator table -- that's fragile.
This commit is contained in:
parent
15a32f0683
commit
260d1eaaa7
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP,
|
|||
COLON, ASGN, COMMA, XCOMMA, SHARP, SEMIC, CBRA, CKET,
|
||||
ASPLUS, ASMINUS, ASSTAR, ASSLASH, ASPCT, ASCIRC, ASLSH,
|
||||
ASRSH, ASOR, ASAND, ELLIPS,
|
||||
DSHARP1, NAME1, DEFINED, UMINUS };
|
||||
DSHARP1, NAME1, DEFINED, UMINUS, MAXTOK};
|
||||
|
||||
enum kwtype { KIF, KIFDEF, KIFNDEF, KELIF, KELSE, KENDIF, KINCLUDE, KDEFINE,
|
||||
KUNDEF, KLINE, KERROR, KWARNING, KPRAGMA, KDEFINED,
|
||||
|
|
|
@ -31,7 +31,7 @@ const struct pri {
|
|||
char assoc;
|
||||
char arity;
|
||||
char ctype;
|
||||
} priority[] = {
|
||||
} priority[MAXTOK] = {
|
||||
[END] { 0, 0, 0, 0 },
|
||||
[EQ] { 11, 0, 2, RELAT },
|
||||
[NEQ] { 11, 0, 2, RELAT },
|
||||
|
|
Loading…
Reference in a new issue