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