diff options
-rw-r--r-- | include/SciLexer.h | 2 | ||||
-rw-r--r-- | include/Scintilla.iface | 2 | ||||
-rw-r--r-- | src/LexCPP.cxx | 30 |
3 files changed, 30 insertions, 4 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h index c676144a0..680cb1513 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -73,6 +73,8 @@ #define SCE_C_REGEX 14 #define SCE_C_COMMENTLINEDOC 15 #define SCE_C_WORD2 16 +#define SCE_C_COMMENTDOCKEYWORD 17 +#define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_H_DEFAULT 0 #define SCE_H_TAG 1 #define SCE_H_TAGUNKNOWN 2 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index c495a1960..bdfcd2e54 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1308,6 +1308,8 @@ val SCE_C_VERBATIM=13 val SCE_C_REGEX=14 val SCE_C_COMMENTLINEDOC=15 val SCE_C_WORD2=16 +val SCE_C_COMMENTDOCKEYWORD=17 +val SCE_C_COMMENTDOCKEYWORDERROR=18 # Lexical states for SCLEX_HTML, SCLEX_XML val SCE_H_DEFAULT=0 val SCE_H_TAG=1 diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index 8227b2db2..632eeab36 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -20,23 +20,43 @@ #include "Scintilla.h" #include "SciLexer.h" -static bool IsOKBeforeRE(int ch) { +static bool IsOKBeforeRE(const int ch) { return (ch == '(') || (ch == '=') || (ch == ','); } -inline bool IsAWordChar(int ch) { +inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } -inline bool IsAWordStart(int ch) { +inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } +inline bool IsADoxygenChar(const int ch) { + return (islower(ch) || ch == '$' || ch == '@' || + ch == '\\' || ch == '&' || ch == '<' || + ch == '>' || ch == '#' || ch == '{' || + ch == '}' || ch == '[' || ch == ']'); +} + +inline bool IsStateComment(const int state) { + return ((state == SCE_C_COMMENT) || + (state == SCE_C_COMMENTLINE) || + (state == SCE_C_COMMENTDOC) || + (state == SCE_C_COMMENTDOCKEYWORD) || + (state == SCE_C_COMMENTDOCKEYWORDERROR)); +} + +inline bool IsStateString(const int state) { + return ((state == SCE_C_STRING) || (state == SCE_C_VERBATIM)); +} + static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; +// WordList &keywords3 = *keywordlists[2]; bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor"); @@ -46,6 +66,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo int chPrevNonWhite = ' '; int visibleChars = 0; + int noDocChars = 0; bool lastWordWasUUID = false; StyleContext sc(startPos, length, initStyle, styler); @@ -83,7 +104,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo } sc.SetState(SCE_C_DEFAULT); } - } if (sc.state == SCE_C_PREPROCESSOR) { + } else if (sc.state == SCE_C_PREPROCESSOR) { if (stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_C_DEFAULT); @@ -174,6 +195,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo sc.SetState(SCE_C_IDENTIFIER); } } else if (sc.Match('/', '*')) { + noDocChars = 0; if (sc.Match("/**") || sc.Match("/*!")) // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTDOC); else |