feat(for loop): Support range literals (#192)
This commit is contained in:
@@ -40,7 +40,7 @@ public class TokenParser {
|
||||
case .text(let text):
|
||||
nodes.append(TextNode(text: text))
|
||||
case .variable:
|
||||
nodes.append(VariableNode(variable: try compileFilter(token.contents)))
|
||||
nodes.append(VariableNode(variable: try compileResolvable(token.contents)))
|
||||
case .block:
|
||||
if let parse_until = parse_until , parse_until(self, token) {
|
||||
prependToken(token)
|
||||
@@ -114,6 +114,11 @@ public class TokenParser {
|
||||
return try FilterExpression(token: token, parser: self)
|
||||
}
|
||||
|
||||
public func compileResolvable(_ token: String) throws -> Resolvable {
|
||||
return try RangeVariable(token, parser: self)
|
||||
?? compileFilter(token)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// https://en.wikipedia.org/wiki/Levenshtein_distance#Iterative_with_two_matrix_rows
|
||||
|
||||
Reference in New Issue
Block a user