|
Link Here
|
| 1096 |
int previousPosition = -1; |
1096 |
int previousPosition = -1; |
| 1097 |
int typeRefStartPosition = -1; |
1097 |
int typeRefStartPosition = -1; |
| 1098 |
|
1098 |
|
|
|
1099 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=200207 |
| 1100 |
boolean considerAsStringLiteral = false; |
| 1101 |
int literalStartPosition = -1; |
| 1102 |
|
| 1099 |
// Get reference tokens |
1103 |
// Get reference tokens |
| 1100 |
nextToken : while (this.index < this.scanner.eofPosition) { |
1104 |
nextToken : while (this.index < this.scanner.eofPosition) { |
| 1101 |
previousPosition = this.index; |
1105 |
previousPosition = this.index; |
|
Link Here
|
| 1151 |
} |
1155 |
} |
| 1152 |
char[] currentError = this.scanner.getCurrentIdentifierSource(); |
1156 |
char[] currentError = this.scanner.getCurrentIdentifierSource(); |
| 1153 |
if (currentError.length>0 && currentError[0] == '"') { |
1157 |
if (currentError.length>0 && currentError[0] == '"') { |
| 1154 |
if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(this.scanner.getCurrentTokenStartPosition(), getTokenEndPosition()); |
1158 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=200207 |
| 1155 |
return false; |
1159 |
// handle double quoted strings than span on several lines |
| 1156 |
} |
1160 |
if (considerAsStringLiteral) { |
|
|
1161 |
// closing '"' found |
| 1162 |
considerAsStringLiteral = false; |
| 1163 |
literalStartPosition = -1; |
| 1164 |
break; |
| 1165 |
} else { |
| 1166 |
if (this.scanner.currentCharacter == '\r') { |
| 1167 |
// unterminated string literal: keep on parsing the reference until closing '"' found |
| 1168 |
considerAsStringLiteral = true; |
| 1169 |
// store position for error handling |
| 1170 |
literalStartPosition = this.scanner.getCurrentTokenStartPosition(); |
| 1171 |
break; |
| 1172 |
} else { |
| 1173 |
if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(this.scanner.getCurrentTokenStartPosition(), getTokenEndPosition()); |
| 1174 |
return false; |
| 1175 |
} |
| 1176 |
} |
| 1177 |
} |
| 1157 |
break nextToken; |
1178 |
break nextToken; |
| 1158 |
case TerminalTokens.TokenNameIdentifier : |
1179 |
case TerminalTokens.TokenNameIdentifier : |
|
|
1180 |
// discard identifiers when inside an unterminated string literal |
| 1181 |
if (considerAsStringLiteral) { |
| 1182 |
consumeToken(); |
| 1183 |
break; |
| 1184 |
} |
| 1159 |
if (typeRef == null) { |
1185 |
if (typeRef == null) { |
| 1160 |
typeRefStartPosition = this.scanner.getCurrentTokenStartPosition(); |
1186 |
typeRefStartPosition = this.scanner.getCurrentTokenStartPosition(); |
| 1161 |
typeRef = parseQualifiedName(true); |
1187 |
typeRef = parseQualifiedName(true); |
|
Link Here
|
| 1178 |
return true; |
1204 |
return true; |
| 1179 |
} |
1205 |
} |
| 1180 |
if (this.reportProblems) { |
1206 |
if (this.reportProblems) { |
| 1181 |
this.sourceParser.problemReporter().javadocMissingReference(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); |
1207 |
if (considerAsStringLiteral) { |
|
|
1208 |
// unterminated string literal |
| 1209 |
this.sourceParser.problemReporter().javadocInvalidReference(literalStartPosition, getTokenEndPosition()); |
| 1210 |
} else { |
| 1211 |
this.sourceParser.problemReporter().javadocMissingReference(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); |
| 1212 |
} |
| 1182 |
} |
1213 |
} |
| 1183 |
return false; |
1214 |
return false; |
| 1184 |
} |
1215 |
} |