Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions vlib/toml/parser/parser.v
Original file line number Diff line number Diff line change
Expand Up @@ -818,19 +818,24 @@ pub fn (mut p Parser) inline_table(mut tbl map[string]ast.Value) ! {
p.check_immutable(left_most)!
}
}
key_str := key.str()
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'inserting @6 "${key_str}" = ${val} into ${ptr_str(t)}')
unsafe {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'inserting @6 "${key}" = ${val} into ${ptr_str(t)}')
t[key.str()] = val
if _ := t[key_str] {
return error(@MOD + '.' + @STRUCT + '.' + @FN +
' key "${key_str}" is already initialized with a value. At "${p.tok.kind}" "${p.tok.lit}" in this (excerpt): "...${p.excerpt()}..."')
}
t[key_str] = val
}
} else {
p.ignore_while(space_formatting)
key, val := p.key_value()!
key_str := key.str()
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'inserting @5 "${key_str}" = ${val} into ${ptr_str(tbl)}')
if _ := tbl[key_str] {
return error(@MOD + '.' + @STRUCT + '.' + @FN +
' key "${key_str}" is already initialized with a value. At "${p.tok.kind}" "${p.tok.lit}" in this (excerpt): "...${p.excerpt()}..."')
}
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'inserting @5 "${key_str}" = ${val} into ${ptr_str(tbl)}')
tbl[key_str] = val
}
previous_token_was_value = true
Expand Down
1 change: 0 additions & 1 deletion vlib/toml/tests/toml_lang_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const valid_exceptions = [
// NOTE: entries in this list are tests of invalid TOML that should have the parser fail, but currently does not.
const invalid_exceptions = [
'do_not_remove',
'inline-table/duplicate-key-02.toml',
'string/multiline-escape-space-02.toml',
'string/missing-quotes-array.toml',
'table/append-with-dotted-keys-05.toml',
Expand Down
Loading