diff options
author | nyamatongwe <unknown> | 2012-12-30 16:20:46 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2012-12-30 16:20:46 +1100 |
commit | c0977484d040f289bf888c1268006bc59c8acc4d (patch) | |
tree | 46ded29ca572ebabbb4d44a9691de2fb5a198206 /lexers/LexCPP.cxx | |
parent | b10a61c045bc2af559fbc42c8d0034c160c87013 (diff) | |
download | scintilla-mirror-c0977484d040f289bf888c1268006bc59c8acc4d.tar.gz |
Bug #3578824. Ignore comments when evaluating preprocessor expressions.
From Isiledhel.
Diffstat (limited to 'lexers/LexCPP.cxx')
-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; } |