Skip to content
Open
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
4 changes: 1 addition & 3 deletions json/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (p *Parser) listType() (*ast.ListType, error) {
for {
tok := p.scan()
switch tok.Type {
case token.NUMBER, token.FLOAT, token.STRING:
case token.NUMBER, token.FLOAT, token.STRING, token.BOOL:
node, err := p.literalType()
if err != nil {
return nil, err
Expand All @@ -235,8 +235,6 @@ func (p *Parser) listType() (*ast.ListType, error) {
}

l.Add(node)
case token.BOOL:
// TODO(arslan) should we support? not supported by HCL yet
case token.LBRACK:
// TODO(arslan) should we support nested lists? Even though it's
// written in README of HCL, it's not a part of the grammar
Expand Down
4 changes: 4 additions & 0 deletions json/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func TestListType(t *testing.T) {
`"foo": ["123", {}]`,
[]token.Type{token.STRING, token.LBRACE},
},
{
`"foo": [true, false]`,
[]token.Type{token.BOOL, token.BOOL},
},
}

for _, l := range literals {
Expand Down