branch : pmacs2
This commit is contained in:
moculus 2008-03-16 23:03:40 +00:00
parent 41e30a7127
commit c1ff2c53be
1 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import os, re import os, re
from subprocess import Popen, PIPE, STDOUT from subprocess import Popen, PIPE, STDOUT
import color, default, method, mode, tab import color, default, method, mode, tab
from lex import Grammar, PatternRule, RegionRule from lex import Grammar, PatternRule, RegionRule, OverridePatternRule
from mode.python import StringGrammar from mode.python import StringGrammar
# this might not be complete... # this might not be complete...
@ -26,7 +26,9 @@ class CGrammar(Grammar):
RegionRule(r'macrocomment', r'#if +(?:0|NULL|FALSE)', Grammar, r'#endif'), RegionRule(r'macrocomment', r'#if +(?:0|NULL|FALSE)', Grammar, r'#endif'),
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$'), 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$'),
RegionRule(r'comment', '/\*', Grammar, '\*/'), OverridePatternRule(r'comment', r'/\* *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *\*/$'),
OverridePatternRule(r'comment', r'// *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *$'),
RegionRule(r'comment', r'/\*', Grammar, r'\*/'),
PatternRule(r'comment', r'//.*$'), PatternRule(r'comment', r'//.*$'),
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'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_])"),