Skip to content

Commit

Permalink
add for 'foo[bar.baz]'
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker committed Apr 29, 2020
1 parent 8e04c38 commit 8e720e0
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions hclwrite/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,91 @@ func TestParse(t *testing.T) {
},
},
},
{
"a = foo[bar.baz]\n",
TestTreeNode{
Type: "Body",
Children: []TestTreeNode{
{
Type: "Attribute",
Children: []TestTreeNode{
{
Type: "comments",
},
{
Type: "identifier",
Val: "a",
},
{
Type: "Tokens",
Val: " =",
},
{
Type: "Expression",
Children: []TestTreeNode{
{
Type: "Traversal",
Children: []TestTreeNode{
{
Type: "TraverseName",
Children: []TestTreeNode{
{
Type: "identifier",
Val: " foo",
},
},
},
},
},
{
Type: "Tokens",
Val: "[",
},
{
Type: "Traversal",
Children: []TestTreeNode{
{
Type: "TraverseName",
Children: []TestTreeNode{
{
Type: "identifier",
Val: "bar",
},
},
},
{
Type: "TraverseName",
Children: []TestTreeNode{
{
Type: "Tokens",
Val: ".",
},
{
Type: "identifier",
Val: "baz",
},
},
},
},
},
{
Type: "Tokens",
Val: "]",
},
},
},
{
Type: "comments",
},
{
Type: "Tokens",
Val: "\n",
},
},
},
},
},
},
{
"a = foo[bar].baz\n",
TestTreeNode{
Expand Down

0 comments on commit 8e720e0

Please sign in to comment.