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

toml: fix, test and optimize nan and inf values (#12592)

This commit is contained in:
Larpon
2021-11-27 20:26:28 +01:00
committed by GitHub
parent 22043f2df1
commit 1d8ece7ac0
5 changed files with 47 additions and 26 deletions

View File

@ -1232,13 +1232,9 @@ pub fn (mut p Parser) dotted_key_value() ?(DottedKey, ast.Value) {
// value parse and returns an `ast.Value` type.
// values are the token(s) appearing after an assignment operator (=).
pub fn (mut p Parser) value() ?ast.Value {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsing value...')
// println('parsed comment "${p.tok.lit}"')
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsing value from token "$p.tok.kind" "$p.tok.lit"...')
mut value := ast.Value(ast.Null{})
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsing token "$p.tok.kind" "$p.tok.lit"')
// mut value := ast.Value{}
if p.tok.kind == .number {
number_or_date := p.number_or_date() ?
value = number_or_date
@ -1257,7 +1253,6 @@ pub fn (mut p Parser) value() ?ast.Value {
p.ignore_while(parser.space_formatting)
mut t := map[string]ast.Value{}
p.inline_table(mut t) ?
// table[key_str] = ast.Value(t)
ast.Value(t)
}
else {