From 0c29e540eadd80198063fa612c8a59f7d7a398fd Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Fri, 2 May 2008 15:29:09 -0700 Subject: [PATCH] Check ketwords against active keyword subset mask. The begin_keywords directives manage a mask of keyword sets that are active at a given moment. This patch makes the lexor actually test the given keyword against the mask. If it matches, return the keyword id, if it is disabled then it is an IDENTIFIER. --- lexor_keyword.gperf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lexor_keyword.gperf b/lexor_keyword.gperf index eaf3c1948..0813e514b 100644 --- a/lexor_keyword.gperf +++ b/lexor_keyword.gperf @@ -130,6 +130,8 @@ int lexor_keyword_code(const char*str, unsigned nstr) const struct lexor_keyword*rc = check_identifier(str, nstr); if (rc == 0) return IDENTIFIER; + else if ((rc->mask & lexor_keyword_mask) == 0) + return IDENTIFIER; else return rc->tokenType; }