From f7ceeb3dda6dd46c2bf51d2bbde2fcaebd90e747 Mon Sep 17 00:00:00 2001 From: moculus Date: Fri, 3 Apr 2009 16:25:58 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- mode/c.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mode/c.py b/mode/c.py index 8bcb732..a13745d 100644 --- a/mode/c.py +++ b/mode/c.py @@ -37,6 +37,13 @@ class MacroGrammar(Grammar): class CGrammar(Grammar): rules = [ PatternRule('spaces', r' +'), + + PatternMatchRule('x', r'(\()( *)(' + word + r')(\**)( *)(\))( *)(?=[a-zA-Z0-9_\(])', + 'delimiter', 'spaces', 'type', 'operator', 'spaces', 'delimiter', + 'spaces'), + #PatternMatchRule('x', r'(\()(' + word + r')(\))', + # 'delimiter', 'type', 'delimiter'), + PatternRule(r"delimiter", r"\.|\(|\)|\[|\]|{|}|@|,|:|`|;|=(?!=)|\?|->"), PatternRule('eol', r"\n$"), PatternMatchRule('x', r'(struct|enum|union)( +)(' + word + ')', @@ -56,6 +63,7 @@ class CGrammar(Grammar): PatternMatchRule('x', '(' + word + ')(\*+)( +)(' + word + ')', 'type', 'binop', 'spaces', 'identifier'), + PatternRule('function', word + r'(?= *\()'), PatternRule('constant', "[A-Z_][A-Z0-9_]+(?!" + chr2 + ")"), PatternRule('label', word + '(?=:)'),