[Template] Expose token parser
This commit is contained in:
@@ -8,6 +8,10 @@ public class Context : Equatable {
|
||||
dictionaries = [dictionary]
|
||||
}
|
||||
|
||||
public init() {
|
||||
dictionaries = []
|
||||
}
|
||||
|
||||
public subscript(key: String) -> AnyObject? {
|
||||
get {
|
||||
for dictionary in reverse(dictionaries) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
public class Template {
|
||||
let parser:TokenParser
|
||||
public let parser:TokenParser
|
||||
|
||||
public convenience init?(named:String) {
|
||||
self.init(named:named, inBundle:nil)
|
||||
@@ -45,4 +45,9 @@ public class Template {
|
||||
return .Error(error:error)
|
||||
}
|
||||
}
|
||||
|
||||
public func render() -> Result {
|
||||
let context = Context()
|
||||
return render(context)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user