File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -776,16 +776,19 @@ pub fn (mut p Parser) double_array_of_tables(mut table map[string]ast.Value) ? {
776776 // Implicit allocation
777777 if p.last_aot.len == 0 {
778778 util.printdbg (@MOD + '.' + @STRUCT + '.' + @FN, 'implicit allocation of array for dotted key `$dotted_key `.' )
779- table[first.str ()] = []ast.Value{}
780779 p.last_aot = first
781780 // We register this implicit allocation as *explicit* to be able to catch
782781 // special cases like:
783782 // https://github.com/BurntSushi/toml-test/blob/576db852/tests/invalid/table/array-implicit.toml
784783 p.explicit_declared << first
785784
786- t_arr = & (table[p.last_aot.str ()] as []ast.Value)
787- t_arr << ast.Value (map [string ]ast.Value{})
788- p.last_aot_index = t_arr.len - 1
785+ mut nm := map [string ]ast.Value{}
786+ nm[last.str ()] = []ast.Value{}
787+ table[first.str ()] = ast.Value (nm)
788+
789+ t_arr = & (nm[last.str ()] as []ast.Value)
790+ t_arr << p.array_of_tables_contents () ?
791+ return
789792 } else {
790793 return error (@MOD + '.' + @STRUCT + '.' + @FN +
791794 ' nested array of tables key "$first " does not match "$p.last_aot ". (excerpt): "...${p.excerpt()} ..."' )
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ const (
1717 valid_value_exceptions = [
1818 // Integer
1919 'integer/long.toml' , // TODO awaits BUG fix with strconv.parse_int('-9223372036854775808')
20- // Table
21- 'table/array-implicit.toml' ,
2220 // Date-time
2321 'datetime/milliseconds.toml' ,
2422 // Key
You can’t perform that action at this time.
0 commit comments