Loop labels

This commit is contained in:
Ilya Puchka
2017-12-28 14:17:24 +01:00
committed by David Jennes
parent a7448b74cf
commit 91df84b1a5
4 changed files with 112 additions and 11 deletions

View File

@@ -54,8 +54,13 @@ public class TokenParser {
return nodes
}
if let tag = token.components.first {
if var tag = token.components.first {
do {
// special case for labeled tags (such as for loops)
if tag.hasSuffix(":") && token.components.count >= 2 {
tag = token.components[1]
}
let parser = try environment.findTag(name: tag)
let node = try parser(self, token)
nodes.append(node)