Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2004-11-15 17:17:44 -0500
committerAndrew Niefer2004-11-15 17:17:44 -0500
commit6166dbe1fef681ebf297b51b810b1bf723b7fcdb (patch)
tree34e6ffcba9954f22ba3132037d5877e60cc18836
parentcde20ef7ef445b8373689e0c20d2372f7cfcd31f (diff)
downloadorg.eclipse.cdt-6166dbe1fef681ebf297b51b810b1bf723b7fcdb.tar.gz
org.eclipse.cdt-6166dbe1fef681ebf297b51b810b1bf723b7fcdb.tar.xz
org.eclipse.cdt-6166dbe1fef681ebf297b51b810b1bf723b7fcdb.zip
patch from Devin Steffler for 77805
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/ExpressionEvaluator.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/ExpressionEvaluator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/ExpressionEvaluator.java
index b4efd0f497..4892cff474 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/ExpressionEvaluator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/ExpressionEvaluator.java
@@ -798,9 +798,24 @@ public class ExpressionEvaluator {
if (p + 1 < limit) {
if (buffer[p + 1] == '/') {
// C++ comment, skip rest of line
- return;
- } else if (buffer[p + 1] == '*') {
- // C comment, find closing */
+ for (bufferPos[bufferStackPos] += 2;
+ bufferPos[bufferStackPos] < limit;
+ ++bufferPos[bufferStackPos]) {
+ p = bufferPos[bufferStackPos];
+ if (buffer[p] == '\\' && p + 1 < limit && buffer[p + 1] == '\n') {
+ bufferPos[bufferStackPos]+=2;
+ continue;
+ }
+ if (buffer[p] == '\\' && p + 1 < limit && buffer[p + 1] == '\r' && p + 2 < limit && buffer[p + 2] == '\n') {
+ bufferPos[bufferStackPos]+=3;
+ continue;
+ }
+
+ if (buffer[p] == '\n')
+ break; // break when find non-escaped newline
+ }
+ continue;
+ } else if (buffer[p + 1] == '*') { // C comment, find closing */
for (bufferPos[bufferStackPos] += 2;
bufferPos[bufferStackPos] < limit;
++bufferPos[bufferStackPos]) {

Back to the top