diff --git a/src/hcl/parser.py b/src/hcl/parser.py index 50b41fd..c0d08f4 100644 --- a/src/hcl/parser.py +++ b/src/hcl/parser.py @@ -223,6 +223,7 @@ def p_listitem(self, p): ''' listitem : number | object + | list | STRING ''' if DEBUG: diff --git a/tests/lex-fixtures/list_of_lists.hcl b/tests/lex-fixtures/list_of_lists.hcl new file mode 100644 index 0000000..8af3458 --- /dev/null +++ b/tests/lex-fixtures/list_of_lists.hcl @@ -0,0 +1,2 @@ +foo = [["foo"], ["bar"]] + diff --git a/tests/test_lexer.py b/tests/test_lexer.py index 6242188..a9597e0 100644 --- a/tests/test_lexer.py +++ b/tests/test_lexer.py @@ -50,6 +50,16 @@ class Error: "COMMA", "RIGHTBRACKET", None, ], ), + ( + "list_of_lists.hcl", + [ + "IDENTIFIER", "EQUAL", "LEFTBRACKET", + "LEFTBRACKET", "STRING", "RIGHTBRACKET", + "COMMA", + "LEFTBRACKET", "STRING", "RIGHTBRACKET", + "RIGHTBRACKET", None, + ], + ), ( "list_of_maps.hcl", [ diff --git a/tests/test_parser.py b/tests/test_parser.py index 56e3b71..fd96262 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -24,6 +24,10 @@ "list_comma.hcl", False, ), + ( + "list_of_lists.hcl", + False, + ), ( "list_of_maps.hcl", False,