toml: fix error return in value parsing (#12097)
parent
fbe54e49f5
commit
42359d8915
|
@ -650,13 +650,15 @@ pub fn (mut p Parser) value() ?ast.Value {
|
|||
ast.Value(t)
|
||||
}
|
||||
else {
|
||||
error(@MOD + '.' + @STRUCT + '.' + @FN +
|
||||
' value expected .boolean, .quoted, .lsbr, .lcbr or .number got "$p.tok.kind" "$p.tok.lit"')
|
||||
ast.Value(ast.Null{}) // TODO workaround bug
|
||||
ast.Value(ast.Null{})
|
||||
}
|
||||
}
|
||||
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"')
|
||||
}
|
||||
}
|
||||
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsed value $value.to_json()')
|
||||
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsed "$p.tok.kind" as value $value.to_json()')
|
||||
return value
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ const (
|
|||
'string/basic-out-of-range-unicode-escape-1.toml',
|
||||
'string/basic-out-of-range-unicode-escape-2.toml',
|
||||
'string/bad-uni-esc.toml',
|
||||
'string/missing-quotes.toml',
|
||||
// Integer
|
||||
'integer/capital-bin.toml',
|
||||
'integer/invalid-bin.toml',
|
||||
|
|
Loading…
Reference in New Issue