Add tokens and token parser

This commit is contained in:
Kyle Fuller
2014-10-23 17:18:31 +01:00
parent 5af59ecb15
commit 02a1af2f44
7 changed files with 169 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ public protocol Error : Printable {
}
public protocol Node : Equatable {
public protocol Node {
func render(context:Context) -> (String?, Error?)
}
@@ -28,12 +28,8 @@ public class TextNode : Node {
}
}
public func ==(lhs:TextNode, rhs:TextNode) -> Bool {
return true
}
public class VariableNode : Node {
let variable:Variable
public let variable:Variable
public init(variable:Variable) {
self.variable = variable
@@ -55,7 +51,3 @@ public class VariableNode : Node {
return (nil, nil)
}
}
public func ==(lhs:VariableNode, rhs:VariableNode) -> Bool {
return true
}