feat(filters): Allow filters with arguments

This commit is contained in:
Kyle Fuller
2016-11-27 01:59:57 +00:00
parent 1e3afc0dd5
commit 60b378d482
6 changed files with 95 additions and 10 deletions

View File

@@ -12,7 +12,6 @@ public func until(_ tags: [String]) -> ((TokenParser, Token) -> Bool) {
}
}
public typealias Filter = (Any?) throws -> Any?
/// A class for parsing an array of tokens and converts them into a collection of Node's
open class TokenParser {
@@ -77,7 +76,7 @@ open class TokenParser {
tokens.insert(token, at: 0)
}
open func findFilter(_ name: String) throws -> Filter {
open func findFilter(_ name: String) throws -> FilterType {
if let filter = namespace.filters[name] {
return filter
}