toml: disallow unclosed arrays (#12273)

pull/12274/head
Larpon 2021-10-22 19:30:29 +02:00 committed by GitHub
parent 506924b01c
commit 8a4756819a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -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()

View File

@ -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',