aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-08-22 14:02:17 +0000
committernyamatongwe <unknown>2000-08-22 14:02:17 +0000
commit23664a1c4481659558753466678f00fca81737dd (patch)
treeae5006e09bee63417cbfab0a26cdd1ec6f5e65d6
parent77c12d71d49849b769eaf1874c1a9a32ba496ceb (diff)
downloadscintilla-mirror-23664a1c4481659558753466678f00fca81737dd.tar.gz
Added C# support to LexCPP with verbatime string literals and @ quoted
keywords handled correctly.
-rw-r--r--include/SciLexer.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--src/LexCPP.cxx19
3 files changed, 20 insertions, 1 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h
index 950f0cf48..cb52493c2 100644
--- a/include/SciLexer.h
+++ b/include/SciLexer.h
@@ -56,6 +56,7 @@
#define SCE_C_OPERATOR 10
#define SCE_C_IDENTIFIER 11
#define SCE_C_STRINGEOL 12
+#define SCE_C_VERBATIM 13
// Lexical states for SCLEX_HTML, SCLEX_XML
#define SCE_H_DEFAULT 0
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 37c6baf61..c691ad386 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1097,6 +1097,7 @@ val SCE_C_PREPROCESSOR=9
val SCE_C_OPERATOR=10
val SCE_C_IDENTIFIER=11
val SCE_C_STRINGEOL=12
+val SCE_C_VERBATIM=13
val SCE_H_DEFAULT=0
val SCE_H_TAG=1
val SCE_H_TAGUNKNOWN=2
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index 4f70e9bd3..b6358ab33 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -94,7 +94,13 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
}
if (state == SCE_C_DEFAULT) {
- if (iswordstart(ch)) {
+ if (ch == '@' && chNext == '\"') {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_VERBATIM;
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (iswordstart(ch) || (ch == '@')) {
styler.ColourTo(i-1, state);
if (lastWordWasUUID) {
state = SCE_C_UUID;
@@ -220,6 +226,17 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
+ } else if (state == SCE_C_VERBATIM) {
+ if (ch == '\"') {
+ if (chNext == '\"') {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ styler.ColourTo(i, state);
+ state = SCE_C_DEFAULT;
+ }
+ }
} else if (state == SCE_C_UUID) {
if (ch == '\r' || ch == '\n' || ch == ')') {
styler.ColourTo(i-1, state);