diff --git a/mode/c.py b/mode/c.py index 281c850..4bb5d2f 100644 --- a/mode/c.py +++ b/mode/c.py @@ -57,7 +57,7 @@ class CGrammar(Grammar): r'identifier', r'[a-zA-Z_][a-zA-Z0-9_]*'), PatternRule(r'function', r'[a-zA-Z_][a-zA-Z0-9_]*(?= *\()'), - PatternRule(r'constant', r"[A-Z_][A-Z0-9_]+"), + PatternRule(r'constant', r"[A-Z_][A-Z0-9_]+(?![a-zA-Z0-9_])"), PatternRule(r'label', r'[a-zA-Z_][a-zA-Z0-9_]*(?=:)'), RegionRule(r'error', r'# *error', ErrorGrammar, r'\n$'), RegionRule(r'macro', r'# *(?:assert|cpu|define|elif|else|endif|error|ident|ifdef|ifndef|if|import|include_next|line|machine|pragma_once|pragma|system|unassert|undef|warning)(?!=[a-zA-Z0-9_])', MacroGrammar, r'\n$'),