diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-10-07 14:28:38 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-10-07 14:28:38 +0000 |
| commit | afd1ae5458f2f4192af95e3e08871d2913145c8e (patch) | |
| tree | 6fde29daf9c9f2864a8174b7f2bfb6685ec0eac0 /src | |
| parent | 868a2f8107ef46f22e2e1276fcc8302c2ad1c7ed (diff) | |
Filters: tweak colorize_cplusplus
Diffstat (limited to 'src')
| -rw-r--r-- | src/filters.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/filters.cc b/src/filters.cc index 19f37105..56f1a86e 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -27,7 +27,7 @@ void colorize_regex(DisplayBuffer& display_buffer, void colorize_cplusplus(DisplayBuffer& display_buffer) { - static boost::regex preprocessor("(?<=\\n)\\h*#\\h*[^\\n]*(?=\\n)"); + static boost::regex preprocessor("(\\`|(?<=\\n))\\h*#\\h*[^\\n]*(?=\\n)"); colorize_regex(display_buffer, preprocessor, Color::Magenta); static boost::regex comments("//[^\\n]*\\n"); @@ -36,7 +36,7 @@ void colorize_cplusplus(DisplayBuffer& display_buffer) static boost::regex strings("(?<!')\"(\\\\\"|[^\"])*\""); colorize_regex(display_buffer, strings, Color::Magenta); - static boost::regex values("\\<(true|false|NULL|nullptr)\\>|-?\\d+[fdiu]?|'[^']?'"); + static boost::regex values("\\<(true|false|NULL|nullptr)\\>|-?\\d+[fdiu]?|'\\\\?[^']?'"); colorize_regex(display_buffer, values, Color::Red); static boost::regex builtin_types("\\<(void|int|float|bool|size_t)\\>"); |
