aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-12-30 16:20:46 +1100
committernyamatongwe <devnull@localhost>2012-12-30 16:20:46 +1100
commit0504c699de6efcfb4c5de19b0f524d96f880f323 (patch)
tree7fe04a1a245d7c92ce2974e70a1c000d55853a86
parent0d593286ecdc237e7fdf10d3bdce1935098da580 (diff)
downloadscintilla-mirror-0504c699de6efcfb4c5de19b0f524d96f880f323.tar.gz
Bug #3578824. Ignore comments when evaluating preprocessor expressions.
From Isiledhel.
-rw-r--r--lexers/LexCPP.cxx5
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;
}