From fcb13e202fc8f43bae9ff15d4ccf396d5c0df885 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 22 Aug 2000 14:02:17 +0000 Subject: Added C# support to LexCPP with verbatime string literals and @ quoted keywords handled correctly. --- src/LexCPP.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3