[TokenParser] Add method to register tag

This commit is contained in:
Kyle Fuller
2014-10-26 17:22:02 +00:00
parent d3b7e9ca0c
commit d8e9d46310

View File

@@ -31,10 +31,14 @@ public class TokenParser {
public init(tokens:[Token]) { public init(tokens:[Token]) {
self.tokens = tokens self.tokens = tokens
tags["for"] = ForNode.parse registerTag("for", ForNode.parse)
tags["now"] = NowNode.parse registerTag("if", IfNode.parse)
tags["if"] = IfNode.parse registerTag("ifnot", IfNode.parse_ifnot)
tags["ifnot"] = IfNode.parse_ifnot registerTag("now", NowNode.parse)
}
public func registerTag(name:String, parser:TagParser) {
tags[name] = parser
} }
public func parse() -> Results { public func parse() -> Results {