From 7ba2fc4720c60d82de5af00e658c846fd07fbf05 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Wed, 18 Nov 2009 19:56:31 -0500 Subject: [PATCH] better char highlighting --HG-- branch : pmacs2 --- mode/c.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mode/c.py b/mode/c.py index 4035b68..ee6fff1 100644 --- a/mode/c.py +++ b/mode/c.py @@ -79,9 +79,10 @@ class CGrammar(Grammar): PatternRule("c.operator", r"!(?!=)|\+=|-=|\*=|/=|//=|%=|&=\|\^=|>>=|<<=|\*\*="), PatternRule('c.operator', r"\+|<>|<<|<=|<|-|>>|>=|>|\*\*|&&|&|\*|\|\||\||/|\^|==|//|~|!=|%"), RegionRule('c.macrocomment', '#if +(?:0|NULL|FALSE)', Grammar, '#endif'), - PatternMatchRule('', r"(')(.)(')", 'c.char.start', 'c.char.data', 'c.char.end'), + PatternMatchRule('', r"(')([^\\])(')", 'c.char.start', 'c.char.data', 'c.char.end'), PatternMatchRule('', r"(')(\\.)(')", 'c.char.start', 'c.char.escaped', 'c.char.end'), PatternMatchRule('', r"(')(\\[0-7]{3})(')", 'c.char.start', 'c.char.octal', 'c.char.end'), + PatternMatchRule('', r"(')(\\x[0-9a-fA-F]{2})(')", 'c.char.start', 'c.char.hex', 'c.char.end'), #PatternRule('c.char', r"'.'|'\\.'|'\\[0-7]{3}'"), PatternMatchRule('x', r'(# *include)( +)(.+)(\n|$)', 'c.macro.start', 'spaces', 'c.header', 'c.macro.end'), @@ -237,6 +238,7 @@ class C(Fundamental): 'c.char.data': hi_green, 'c.char.escaped': hi_magenta, 'c.char.octal': hi_magenta, + 'c.char.hex': hi_magenta, 'c.type': hi_cyan, 'c.include': hi_blue,