replaced Token with Lexeme protocol on TemplateSyntaxError

This commit is contained in:
Ilya Puchka
2017-10-07 20:54:42 +02:00
parent 6300dbc7bf
commit 69cd8e4d3b
6 changed files with 52 additions and 69 deletions

View File

@@ -53,8 +53,8 @@ public class TokenParser {
let node = try parser(self, token)
nodes.append(node)
} catch {
if var syntaxError = error as? TemplateSyntaxError, syntaxError.token == nil {
syntaxError.token = token
if var syntaxError = error as? TemplateSyntaxError, syntaxError.lexeme == nil {
syntaxError.lexeme = token
throw syntaxError
} else {
throw error