mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Lexer] Introduce Lexer::getLocForStartOfToken() that returns the location at the start of the token that a given offset points to.
Swift SVN r8281
This commit is contained in:
@@ -110,6 +110,11 @@ public:
|
||||
/// \brief Returns the distance in bytes between the given source locations.
|
||||
unsigned getByteDistance(SourceLoc Start, SourceLoc End) const;
|
||||
|
||||
/// Returns the SourceLoc for the byte offset in the specified buffer.
|
||||
SourceLoc getLocForOffset(unsigned BufferID, unsigned Offset) const {
|
||||
return getLocForBufferStart(BufferID).getAdvancedLoc(Offset);
|
||||
}
|
||||
|
||||
std::pair<unsigned, unsigned> getLineAndColumn(SourceLoc Loc,
|
||||
int BufferID = -1) const {
|
||||
assert(Loc.isValid());
|
||||
|
||||
Reference in New Issue
Block a user