removed whitespace changes

This commit is contained in:
andy
2018-10-01 14:56:09 +01:00
parent 9bd86d9fd5
commit fd79045053
4 changed files with 4 additions and 4 deletions

View File

@@ -37,8 +37,6 @@ public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible {
public init(_ description: String) {
self.init(reason: description)
}
}
extension Error {

View File

@@ -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

View File

@@ -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)!)

View File

@@ -116,7 +116,6 @@ public struct Variable : Equatable, Resolvable {
return normalize(current)
}
}
private func resolveCollection<T: Collection>(_ collection: T, bit: String) -> Any? {