Made Token's components & contents functions public so we can use it to implement custom tags with registerTag()

This commit is contained in:
Olivier Halligon
2015-10-18 15:48:03 +02:00
parent 1136ca8fca
commit 20cc95fb87

View File

@@ -12,7 +12,7 @@ public enum Token : Equatable {
case Block(value:String)
/// Returns the underlying value as an array seperated by spaces
func components() -> [String] {
public func components() -> [String] {
// TODO: Make this smarter and treat quoted strings as a single component
let characterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
@@ -32,7 +32,7 @@ public enum Token : Equatable {
}
}
var contents:String {
public var contents:String {
switch self {
case .Block(let value):
return value