From afd1ae5458f2f4192af95e3e08871d2913145c8e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 7 Oct 2011 14:28:38 +0000 Subject: [PATCH] Filters: tweak colorize_cplusplus --- src/filters.cc | 4 ++-- 1 file 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("(?|-?\\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)\\>");