From 1ff1fcb485aa1370f36f92c26b5129793b6d150a Mon Sep 17 00:00:00 2001 From: Liquidsoul Date: Fri, 24 Aug 2018 14:48:58 +0200 Subject: [PATCH] Cleanup some syntax issues --- Sources/Lexer.swift | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/Sources/Lexer.swift b/Sources/Lexer.swift index 3300652c..14051684 100644 --- a/Sources/Lexer.swift +++ b/Sources/Lexer.swift @@ -51,9 +51,9 @@ struct Lexer { let map = [ "{{": "}}", "{%": "%}", - "{#": "#}", + "{#": "#}" ] - let tokenChars:[Unicode.Scalar] = ["{", "%", "#"] + let tokenChars: [Unicode.Scalar] = ["{", "%", "#"] while !scanner.isEmpty { if let text = scanner.scanForTokenStart(tokenChars) { @@ -95,7 +95,7 @@ class Scanner { return "" } - var index = 0; + var index = 0 range = range.upperBound.. content.endIndex { - continue; - } - if String(content[startIndex.. content.endIndex { + continue + } + if String(content[startIndex.. (String, String)? { + func scanForTokenStart(_ tokenChars: [Unicode.Scalar]) -> (String, String)? { var foundBrace = false - var index = 0; + var index = 0 range = range.upperBound.. String.Index? { var index = startIndex