diff options
author | nyamatongwe <devnull@localhost> | 2012-12-30 16:20:46 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-12-30 16:20:46 +1100 |
commit | 0504c699de6efcfb4c5de19b0f524d96f880f323 (patch) | |
tree | 7fe04a1a245d7c92ce2974e70a1c000d55853a86 | |
parent | 0d593286ecdc237e7fdf10d3bdce1935098da580 (diff) | |
download | scintilla-mirror-0504c699de6efcfb4c5de19b0f524d96f880f323.tar.gz |
Bug #3578824. Ignore comments when evaluating preprocessor expressions.
From Isiledhel.
-rw-r--r-- | lexers/LexCPP.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 116d5a2b3..834c273fa 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -88,10 +88,13 @@ static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace int i =0; char ch = styler.SafeGetCharAt(start, '\n'); while ((ch != '\r') && (ch != '\n')) { + char chNext = styler.SafeGetCharAt(start + i + 1, '\n'); + if (ch == '/' && (chNext == '/' || chNext == '*')) + break; if (allowSpace || (ch != ' ')) restOfLine += ch; i++; - ch = styler.SafeGetCharAt(start + i, '\n'); + ch = chNext; } return restOfLine; } |