Add CharSourceRange -- a half-open character range, which will be used in IDE

integration

Motivation: libIDE clients should be simple, and they should not have to
translate token-based SourceRanges to character locations.

This also allows us to remove the dependency of DiagnosticConsumer on the
Lexer.  Now the DiagnosticEngine translates the diagnostics to CharSourceRanges
and passes character-based ranges to the DiagnosticConsumer.


Swift SVN r7173
This commit is contained in:
Dmitri Hrybenko
2013-08-12 20:15:51 +00:00
parent 67affb462a
commit 70f2b64ad9
14 changed files with 166 additions and 108 deletions

View File

@@ -467,7 +467,7 @@ NullablePtr<Expr> Parser::parseExprUnary(Diag<> Message) {
assert(OperEndLoc != Tok.getLoc() && "binary operator with no spaces?");
diagnose(PreviousLoc, diag::expected_prefix_operator)
.fixItRemove(Diagnostic::Range(OperEndLoc, Tok.getLoc()));
.fixItRemoveChars(OperEndLoc, Tok.getLoc());
break;
}
}