Highlighters: tweak colorize_cplusplus
This commit is contained in:
parent
0e398566d2
commit
c9ac4d615d
|
@ -99,15 +99,6 @@ HighlighterAndId colorize_regex_factory(Window& window,
|
||||||
|
|
||||||
void colorize_cplusplus(DisplayBuffer& display_buffer)
|
void colorize_cplusplus(DisplayBuffer& display_buffer)
|
||||||
{
|
{
|
||||||
static boost::regex preprocessor("(\\`|(?<=\\n))\\h*#\\h*[^\\n]*");
|
|
||||||
colorize_regex(display_buffer, preprocessor, Color::Magenta);
|
|
||||||
|
|
||||||
static boost::regex comments("//[^\\n]*\\n");
|
|
||||||
colorize_regex(display_buffer, comments, Color::Cyan);
|
|
||||||
|
|
||||||
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);
|
colorize_regex(display_buffer, values, Color::Red);
|
||||||
|
|
||||||
|
@ -122,6 +113,16 @@ void colorize_cplusplus(DisplayBuffer& display_buffer)
|
||||||
|
|
||||||
static boost::regex types_keywords("\\<(const|auto|namespace|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual)\\>");
|
static boost::regex types_keywords("\\<(const|auto|namespace|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual)\\>");
|
||||||
colorize_regex(display_buffer, types_keywords, Color::Green);
|
colorize_regex(display_buffer, types_keywords, Color::Green);
|
||||||
|
|
||||||
|
static boost::regex strings("(?<!')\"(\\\\\"|[^\"])*\"");
|
||||||
|
colorize_regex(display_buffer, strings, Color::Magenta);
|
||||||
|
|
||||||
|
static boost::regex preprocessor("(\\`|(?<=\\n))\\h*#\\h*[^\\n]*");
|
||||||
|
colorize_regex(display_buffer, preprocessor, Color::Magenta);
|
||||||
|
|
||||||
|
static boost::regex comments("(//[^\\n]*\\n)|(/\\*.*?(\\*/|\\'))");
|
||||||
|
colorize_regex(display_buffer, comments, Color::Cyan);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void expand_tabulations(DisplayBuffer& display_buffer)
|
void expand_tabulations(DisplayBuffer& display_buffer)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user