Replace raw UTF8 parser with String parser (#6)
* Replace UTF8 parser with String based one * swift format * Add parsing errors that include context about where error is * Remove old error tests
This commit is contained in:
@@ -17,8 +17,8 @@ extension HBMustacheLibrary {
|
||||
let template: HBMustacheTemplate
|
||||
do {
|
||||
template = try HBMustacheTemplate(string: string)
|
||||
} catch {
|
||||
throw Error.failedToLoad(path, error)
|
||||
} catch let error as HBMustacheTemplate.ParserError {
|
||||
throw ParserError(filename: path, context: error.context, error: error.error)
|
||||
}
|
||||
// drop ".mustache" from path to get name
|
||||
let name = String(path.dropLast(extWithDot.count))
|
||||
|
||||
Reference in New Issue
Block a user