diff options
author | nyamatongwe <unknown> | 2000-06-14 06:36:22 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-06-14 06:36:22 +0000 |
commit | be9123b4ae8348b8eea622a7fd559cbf07426aa6 (patch) | |
tree | 272d6e1aae0b2f95a6dead3df808431613a175dc /src | |
parent | 716a74bb011444d47cfebbf400a070cd7536b856 (diff) | |
download | scintilla-mirror-be9123b4ae8348b8eea622a7fd559cbf07426aa6.tar.gz |
Simplified case where state changes to DEFAULT.
Fixed counting of lines when a string terminates just before end of line.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexCPP.cxx | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index cad24a773..e6182e8d8 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -200,13 +200,10 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo } else if (ch == '\"') { styler.ColourTo(i, state); state = SCE_C_DEFAULT; - i++; - ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - } else if (chNext == '\r' || chNext == '\n') { + } else if (chNext == '\r' || chNext == '\n') { styler.ColourTo(i-1, SCE_C_STRINGEOL); state = SCE_C_STRINGEOL; - } + } } else if (state == SCE_C_CHARACTER) { if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { styler.ColourTo(i-1, SCE_C_STRINGEOL); @@ -220,37 +217,15 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo } else if (ch == '\'') { styler.ColourTo(i, state); state = SCE_C_DEFAULT; - i++; - ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); } } else if (state == SCE_C_UUID) { if (ch == '\r' || ch == '\n' || ch == ')') { styler.ColourTo(i-1, state); + if (ch == ')') + styler.ColourTo(i, SCE_C_OPERATOR); state = SCE_C_DEFAULT; } } - if (state == SCE_C_DEFAULT) { // One of the above succeeded - if (ch == '/' && chNext == '*') { - if (styler.SafeGetCharAt(i + 2) == '*') - state = SCE_C_COMMENTDOC; - else - state = SCE_C_COMMENT; - } else if (ch == '/' && chNext == '/') { - state = SCE_C_COMMENTLINE; - } else if (ch == '\"') { - state = SCE_C_STRING; - } else if (ch == '\'') { - state = SCE_C_CHARACTER; - } else if (iswordstart(ch)) { - state = SCE_C_WORD; - } else if (isoperator(ch)) { - styler.ColourTo(i, SCE_C_OPERATOR); - if ((ch == '{') || (ch == '}')) { - levelCurrent += (ch == '{') ? 1 : -1; - } - } - } } chPrev = ch; } |