storing full sourcemap in token, refactored error reporting
This commit is contained in:
@@ -169,11 +169,9 @@ func testForNode() {
|
||||
}
|
||||
|
||||
$0.it("handles invalid input") {
|
||||
let tokens: [Token] = [
|
||||
.block(value: "for i", at: .unknown),
|
||||
]
|
||||
let tokens: [Token] = [.block(value: "for i", at: .unknown)]
|
||||
let parser = TokenParser(tokens: tokens, environment: Environment())
|
||||
let error = TemplateSyntaxError("'for' statements should use the following syntax 'for x in y where condition'.")
|
||||
let error = TemplateSyntaxError(reason: "'for' statements should use the following syntax 'for x in y where condition'.", token: tokens.first)
|
||||
try expect(try parser.parse()).toThrow(error)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user