much better solution: save tablep and hash value¹ in the struct tbl entry
① also saves time during texpand :D XXX this doesn’t work well with the current indexed-array implementation
This commit is contained in:
4
syn.c
4
syn.c
@ -22,7 +22,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.40 2009/08/28 19:57:43 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.41 2009/08/28 20:30:59 tg Exp $");
|
||||
|
||||
struct nesting_state {
|
||||
int start_token; /* token than began nesting (eg, FOR) */
|
||||
@ -743,7 +743,7 @@ initkeywords(void)
|
||||
/* must be 80% of 2^n (currently 20 keywords) */ 32);
|
||||
for (tt = tokentab; tt->name; tt++) {
|
||||
if (tt->reserved) {
|
||||
p = ktenter(&keywords, tt->name, hash(tt->name), NULL);
|
||||
p = ktenter(&keywords, tt->name, hash(tt->name));
|
||||
p->flag |= DEFINED|ISSET;
|
||||
p->type = CKEYWD;
|
||||
p->val.i = tt->val;
|
||||
|
Reference in New Issue
Block a user