branch : pmacs2
This commit is contained in:
moculus 2009-04-03 21:36:37 +00:00
parent f7ceeb3dda
commit 4df49ab1e9
1 changed files with 22 additions and 21 deletions

View File

@ -59,9 +59,9 @@ class CGrammar(Grammar):
'type', 'binop', 'spaces', 'function', 'spaces', 'delimiter'), 'type', 'binop', 'spaces', 'function', 'spaces', 'delimiter'),
PatternMatchRule('x', '(' + word + ')( +)(\**)(' + word + ')', PatternMatchRule('x', '(' + word + ')( +)(\**)(' + word + ')',
'type', 'spaces', 'binop', 'identifier'), 'type', 'spaces', 'binop', 'c.identifier'),
PatternMatchRule('x', '(' + word + ')(\*+)( +)(' + word + ')', PatternMatchRule('x', '(' + word + ')(\*+)( +)(' + word + ')',
'type', 'binop', 'spaces', 'identifier'), 'type', 'binop', 'spaces', 'c.identifier'),
PatternRule('function', word + r'(?= *\()'), PatternRule('function', word + r'(?= *\()'),
@ -82,7 +82,7 @@ class CGrammar(Grammar):
PatternRule('char', r"'.'|'\\.'|'\\[0-7]{3}'"), PatternRule('char', r"'.'|'\\.'|'\\[0-7]{3}'"),
PatternMatchRule('x', r'(# *include)( +)(.+)(\n|$)', PatternMatchRule('x', r'(# *include)( +)(.+)(\n|$)',
'macro.start', 'spaces', 'header', 'macro.end'), 'macro.start', 'spaces', 'header', 'macro.end'),
PatternRule('identifier', word), PatternRule('c.identifier', word),
OverridePatternRule('comment', r'/\* *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *\*/$'), OverridePatternRule('comment', r'/\* *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *\*/$'),
OverridePatternRule('comment', r'// *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *$'), OverridePatternRule('comment', r'// *@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *$'),
] ]
@ -174,24 +174,25 @@ class C(Fundamental):
commentc = '//' commentc = '//'
colors = { colors = {
'macrocomment.start': ('red', 'default', 'bold'), 'c.identifier': ('yellow', 'default', 'bold'),
'macrocomment.null': ('red', 'default', 'bold'), 'macrocomment.start': ('red', 'default', 'bold'),
'macrocomment.end': ('red', 'default', 'bold'), 'macrocomment.null': ('red', 'default', 'bold'),
'macro': ('blue', 'default', 'bold'), 'macrocomment.end': ('red', 'default', 'bold'),
'macro.start': ('blue', 'default', 'bold'), 'macro': ('blue', 'default', 'bold'),
'macro.name': ('yellow', 'default', 'bold'), 'macro.start': ('blue', 'default', 'bold'),
'macro.null': ('magenta', 'default', 'bold'), 'macro.name': ('yellow', 'default', 'bold'),
'macro.continued': ('red', 'default', 'bold'), 'macro.null': ('magenta', 'default', 'bold'),
'macro.delimiter': ('default', 'default', 'bold'), 'macro.continued': ('red', 'default', 'bold'),
'macro.concat': ('yellow', 'default', 'bold'), 'macro.delimiter': ('default', 'default', 'bold'),
'macro.quoted': ('yellow', 'default', 'bold'), 'macro.concat': ('yellow', 'default', 'bold'),
'include': ('blue', 'default', 'bold'), 'macro.quoted': ('yellow', 'default', 'bold'),
'header': ('green', 'default', 'bold'), 'include': ('blue', 'default', 'bold'),
'type': ('cyan', 'default', 'bold'), 'header': ('green', 'default', 'bold'),
'constant': ('yellow', 'default', 'bold'), 'type': ('cyan', 'default', 'bold'),
'error.start': ('blue', 'default', 'bold'), 'constant': ('yellow', 'default', 'bold'),
'error.data': ('green', 'default', 'bold'), 'error.start': ('blue', 'default', 'bold'),
'error.null': ('green', 'default', 'bold'), 'error.data': ('green', 'default', 'bold'),
'error.null': ('green', 'default', 'bold'),
} }
config = { config = {
'c.syntax-cmd': "gcc -x c -fsyntax-only %(path)s", 'c.syntax-cmd': "gcc -x c -fsyntax-only %(path)s",