swift format

This commit is contained in:
Adam Fowler
2021-03-15 18:24:06 +00:00
parent 955e1eb9e4
commit 66edcba185
18 changed files with 306 additions and 313 deletions

View File

@@ -83,7 +83,7 @@ extension HBMustacheTemplate {
/// parse variable name
static func parseName(_ parser: inout HBParser) throws -> (String, String?) {
parser.read(while: \.isWhitespace)
var text = parser.read(while: sectionNameChars )
var text = parser.read(while: sectionNameChars)
parser.read(while: \.isWhitespace)
guard try parser.read("}"), try parser.read("}") else { throw Error.unfinishedName }
// does the name include brackets. If so this is a method call
@@ -106,7 +106,7 @@ extension HBMustacheTemplate {
let text = try parser.read(untilString: "}}", throwOnOverflow: true, skipToEnd: true)
return text.string
}
private static let sectionNameCharsWithoutBrackets = Set<Unicode.Scalar>("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._?")
private static let sectionNameChars = Set<Unicode.Scalar>("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._?()")
}