removed whitespace changes
This commit is contained in:
@@ -37,8 +37,6 @@ public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible {
|
||||
public init(_ description: String) {
|
||||
self.init(reason: description)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
extension Error {
|
||||
|
||||
@@ -63,7 +63,9 @@ class ExtendsNode : NodeType {
|
||||
guard (parsedNodes.any { $0 is ExtendsNode }) == nil else {
|
||||
throw TemplateSyntaxError("'extends' cannot appear more than once in the same template")
|
||||
}
|
||||
|
||||
let blockNodes = parsedNodes.compactMap { $0 as? BlockNode }
|
||||
|
||||
let nodes = blockNodes.reduce([String: BlockNode]()) { (accumulator, node) -> [String: BlockNode] in
|
||||
var dict = accumulator
|
||||
dict[node.name] = node
|
||||
|
||||
@@ -22,6 +22,7 @@ struct Lexer {
|
||||
init(templateName: String? = nil, templateString: String) {
|
||||
self.templateName = templateName
|
||||
self.templateString = templateString
|
||||
|
||||
self.lines = templateString.components(separatedBy: .newlines).enumerated().compactMap {
|
||||
guard !$0.element.isEmpty else { return nil }
|
||||
return (content: $0.element, number: UInt($0.offset + 1), templateString.range(of: $0.element)!)
|
||||
|
||||
@@ -116,7 +116,6 @@ public struct Variable : Equatable, Resolvable {
|
||||
|
||||
return normalize(current)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private func resolveCollection<T: Collection>(_ collection: T, bit: String) -> Any? {
|
||||
|
||||
Reference in New Issue
Block a user