diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Scanner.java index 0bed0873918..fb9c3a92265 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Scanner.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Scanner.java @@ -571,6 +571,10 @@ protected final boolean scanForMarkdownBeginning() { try { int temp = this.currentPosition; int count = 0; + // The scanner has already stopped at \r, so, look for matching \n + if (this.currentCharacter == '\r' && this.source[temp] == '\n') { + temp++; + } while(true) { char c = this.source[temp++]; switch(c) { @@ -580,7 +584,6 @@ protected final boolean scanForMarkdownBeginning() { return true; } break; - case '\r' : case '\n' : return false; default: @@ -1953,6 +1956,9 @@ protected int getNextToken0() throws InvalidInputException { pushLineSeparator(); } } + if (!scanForMarkdownBeginning()) { + break; + } } isUnicode = false; previous = this.currentPosition; @@ -2847,6 +2853,9 @@ public final void jumpOverMethodBody() { pushLineSeparator(); } } + if (!scanForMarkdownBeginning()) { + break; + } } isUnicode = false; previous = this.currentPosition;