removed trailing witespaces

This commit is contained in:
Ilya Puchka
2017-12-27 18:48:37 +01:00
parent 4bfdb73175
commit 662849e968
12 changed files with 51 additions and 51 deletions

View File

@@ -42,9 +42,9 @@ class DefaultExtension: Extension {
registerTag("for", parser: ForNode.parse)
registerTag("if", parser: IfNode.parse)
registerTag("ifnot", parser: IfNode.parse_ifnot)
#if !os(Linux)
registerTag("now", parser: NowNode.parse)
#endif
#if !os(Linux)
registerTag("now", parser: NowNode.parse)
#endif
registerTag("include", parser: IncludeNode.parse)
registerTag("extends", parser: ExtendsNode.parse)
registerTag("block", parser: BlockNode.parse)

View File

@@ -12,8 +12,8 @@ class ForNode : NodeType {
let components = token.components()
guard components.count >= 3 && components[2] == "in" &&
(components.count == 4 || (components.count >= 6 && components[4] == "where")) else {
throw TemplateSyntaxError("'for' statements should use the following syntax 'for x in y where condition'.")
(components.count == 4 || (components.count >= 6 && components[4] == "where")) else {
throw TemplateSyntaxError("'for' statements should use the following syntax 'for x in y where condition'.")
}
let loopVariables = components[1].characters
@@ -134,14 +134,14 @@ class ForNode : NodeType {
"last": index == (count - 1),
"counter": index + 1,
"counter0": index,
]
]
return try context.push(dictionary: ["forloop": forContext]) {
return try push(value: item, context: context) {
try renderNodes(nodes, context)
}
}
}.joined(separator: "")
}.joined(separator: "")
}
return try context.push {

View File

@@ -53,7 +53,7 @@ enum IfToken {
case .variable(_):
return 0
case .end:
return 0
return 0
}
}

View File

@@ -47,7 +47,7 @@ struct Lexer {
"{{": "}}",
"{%": "%}",
"{#": "#}",
]
]
while !scanner.isEmpty {
if let text = scanner.scan(until: ["{{", "{%", "{#"]) {

View File

@@ -95,11 +95,11 @@ public struct Variable : Equatable, Resolvable {
current = array.count
}
} else if let object = current as? NSObject { // NSKeyValueCoding
#if os(Linux)
return nil
#else
current = object.value(forKey: bit)
#endif
#if os(Linux)
return nil
#else
current = object.value(forKey: bit)
#endif
} else if let value = current {
current = Mirror(reflecting: value).getValue(for: bit)
if current == nil {