Skip to content

Commit

Permalink
toml: disallow unclosed arrays (#12273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larpon committed Oct 22, 2021
1 parent 506924b commit 8a47568
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vlib/toml/parser/parser.v
Expand Up @@ -509,8 +509,8 @@ pub fn (mut p Parser) array() ?[]ast.Value {
continue
}
.eof {
// End Of File
return arr
return error(@MOD + '.' + @STRUCT + '.' + @FN +
' could not parse array. Reached EOF "$p.tok.kind" "$p.tok.lit" ("$p.tok.lit") in this (excerpt): "...${p.excerpt()}..."')
}
.hash {
// TODO array.comments << p.comment()
Expand Down
2 changes: 0 additions & 2 deletions vlib/toml/tests/burntsushi.toml-test_test.v
Expand Up @@ -33,10 +33,8 @@ const (
'table/duplicate-table-array.toml',
// Array
'array/tables-1.toml',
'array/no-close-2.toml',
'array/missing-separator.toml',
'array/text-after-array-entries.toml',
'array/no-close.toml',
'array/text-before-array-separator.toml',
// Date / Time
'datetime/impossible-date.toml',
Expand Down

0 comments on commit 8a47568

Please sign in to comment.