1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: add excerpt to value parse errors (#12429)

This commit is contained in:
Larpon 2021-11-11 06:29:38 +01:00 committed by GitHub
parent dbd5acd5ba
commit 015cfdb49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -874,7 +874,7 @@ pub fn (mut p Parser) value() ?ast.Value {
}
if value is ast.Null {
return error(@MOD + '.' + @STRUCT + '.' + @FN +
' value expected .boolean, .quoted, .lsbr, .lcbr or .number got "$p.tok.kind" "$p.tok.lit"')
' value expected .boolean, .quoted, .lsbr, .lcbr or .number got "$p.tok.kind" "$p.tok.lit" in this (excerpt): "...${p.excerpt()}..."')
}
}
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsed "$p.tok.kind" as value $value.to_json()')