replaced Token with Lexeme protocol on TemplateSyntaxError
This commit is contained in:
@@ -17,3 +17,29 @@ public class TemplateDoesNotExist: Error, CustomStringConvertible {
|
||||
return "Template named `\(templates)` does not exist. No loaders found"
|
||||
}
|
||||
}
|
||||
|
||||
public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible {
|
||||
public let description:String
|
||||
var lexeme: Lexeme?
|
||||
|
||||
public init(_ description:String) {
|
||||
self.description = description
|
||||
}
|
||||
|
||||
public static func ==(lhs:TemplateSyntaxError, rhs:TemplateSyntaxError) -> Bool {
|
||||
return lhs.description == rhs.description
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension Range where Bound == String.Index {
|
||||
internal static var unknown: Range {
|
||||
return "".range
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
var range: Range<String.Index> {
|
||||
return startIndex..<endIndex
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user