diff --git a/mode/c.py b/mode/c.py index 6c858af..10484ef 100644 --- a/mode/c.py +++ b/mode/c.py @@ -34,6 +34,7 @@ class CGrammar(Grammar): PatternRule(r'keyword', r"(?:auto|break|case|char|const|continue|default|double|do|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)(?![a-zA-Z_])"), PatternRule(r'builtin', r"(?:NULL|TRUE|FALSE)"), + PatternRule(r'label', r'[a-zA-Z_][a-zA-Z0-9_]*(?=:)'), PatternRule(r'identifier', r"[a-zA-Z_][a-zA-Z0-9_]*(?! *[\(:])"), RegionRule(r'macro', r'#(?:assert|cpu|define|elif|else|endif|error|ident|ifdef|ifndef|if|import|include_next|line|machine|pragma|pragma_once|system|unassert|undef|warning)(?!=[a-zA-Z0-9_])', MacroGrammar, r'\n$'), @@ -50,7 +51,6 @@ class CGrammar(Grammar): RegionRule(r'macrocomment', r'#if +(?:0|NULL|FALSE)', Grammar, r'#endif'), - PatternRule(r'label', r'[a-zA-Z_][a-zA-Z0-9_]*(?=:)'), PatternRule(r'char', r"'.'|'\\.'|'\\[0-7]{3}'"), PatternRule(r'include', r'#include(?!=[a-zA-Z0-9_])'), PatternRule(r'header', r'<[-A-Za-z/0-9_\.]+>|"[-A-Za-z/0-9_\.]+"'),