process template lines when Lexer is created not when parsing each token. (#230)

This commit is contained in:
Ilya Puchka
2018-09-10 11:39:19 +01:00
committed by GitHub
parent 00e71c1b4d
commit acda1b0caf
7 changed files with 52 additions and 51 deletions

View File

@@ -57,17 +57,17 @@ extension String {
public struct SourceMap: Equatable {
public let filename: String?
public let line: RangeLine
public let location: ContentLocation
init(filename: String? = nil, line: RangeLine = ("", 0, 0)) {
init(filename: String? = nil, location: ContentLocation = ("", 0, 0)) {
self.filename = filename
self.line = line
self.location = location
}
static let unknown = SourceMap()
public static func ==(lhs: SourceMap, rhs: SourceMap) -> Bool {
return lhs.filename == rhs.filename && lhs.line == rhs.line
return lhs.filename == rhs.filename && lhs.location == rhs.location
}
}