├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── MANIFEST.in ├── README.rst ├── pyproject.toml ├── requirements.txt ├── scripts └── hcltool ├── setup.cfg ├── setup.py ├── src └── hcl │ ├── __init__.py │ ├── api.py │ ├── lexer.py │ └── parser.py ├── testing-requirements.txt └── tests ├── fixtures ├── array_comment.hcl ├── array_comment.json ├── basic.hcl ├── basic.json ├── basic_squish.hcl ├── decode_policy.hcl ├── decode_policy.json ├── decode_tf_variable.hcl ├── decode_tf_variable.json ├── depends_on.hcl ├── depends_on.json ├── empty.hcl ├── escape.hcl ├── flat.hcl ├── float.hcl ├── float.json ├── heredoc_terminator_same_line.hcl ├── heredoc_terminator_same_line.json ├── interpolation.hcl ├── interpolation.json ├── interpolation2.hcl ├── interpolation2.json ├── interpolation3.hcl ├── interpolation3.json ├── issue12.hcl ├── issue12.json ├── multiline.json ├── multiline_bad.hcl ├── no_argument_function.hcl ├── no_argument_function.json ├── scientific.hcl ├── scientific.json ├── structure.hcl ├── structure.json ├── structure2.hcl ├── structure2.json ├── structure_flat.json ├── structure_flatmap.hcl ├── structure_flatmap.json ├── structure_list.hcl ├── structure_list.json ├── structure_list_deep.hcl ├── structure_list_deep.json ├── structure_multi.hcl ├── structure_multi.json ├── structure_three_tiers.hcl ├── structure_three_tiers.json ├── tab_heredoc.hcl ├── tab_heredoc.json ├── terraform_heroku.hcl └── terraform_heroku.json ├── lex-fixtures ├── array_comment.hcl ├── assign_colon.hcl ├── assign_deep.hcl ├── comment.hcl ├── complex.hcl ├── conditional_operator.hcl ├── empty_heredoc.hcl ├── heredoc_terminator_same_line.hcl ├── list.hcl ├── list_comma.hcl ├── list_of_maps.hcl ├── multiple.hcl ├── nested_comment.hcl ├── old.hcl ├── structure.hcl ├── structure_basic.hcl ├── structure_comma.hcl ├── structure_empty.hcl ├── terraform0.12syntax.hcl ├── types.hcl ├── unterminated_block_comment.hcl └── windows_heredoc.hcl ├── run_tests.sh ├── test_decoder.py ├── test_lexer.py └── test_parser.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/.gitignore -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/.travis.yml -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/LICENSE -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/MANIFEST.in -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/README.rst -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/pyproject.toml -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ply>=3.8,<4 2 | -------------------------------------------------------------------------------- /scripts/hcltool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/scripts/hcltool -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/setup.cfg -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/setup.py -------------------------------------------------------------------------------- /src/hcl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/src/hcl/__init__.py -------------------------------------------------------------------------------- /src/hcl/api.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/src/hcl/api.py -------------------------------------------------------------------------------- /src/hcl/lexer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/src/hcl/lexer.py -------------------------------------------------------------------------------- /src/hcl/parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/src/hcl/parser.py -------------------------------------------------------------------------------- /testing-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | coverage 3 | -------------------------------------------------------------------------------- /tests/fixtures/array_comment.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/array_comment.hcl -------------------------------------------------------------------------------- /tests/fixtures/array_comment.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/array_comment.json -------------------------------------------------------------------------------- /tests/fixtures/basic.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/basic.hcl -------------------------------------------------------------------------------- /tests/fixtures/basic.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/basic.json -------------------------------------------------------------------------------- /tests/fixtures/basic_squish.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/basic_squish.hcl -------------------------------------------------------------------------------- /tests/fixtures/decode_policy.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/decode_policy.hcl -------------------------------------------------------------------------------- /tests/fixtures/decode_policy.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/decode_policy.json -------------------------------------------------------------------------------- /tests/fixtures/decode_tf_variable.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/decode_tf_variable.hcl -------------------------------------------------------------------------------- /tests/fixtures/decode_tf_variable.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/decode_tf_variable.json -------------------------------------------------------------------------------- /tests/fixtures/depends_on.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/depends_on.hcl -------------------------------------------------------------------------------- /tests/fixtures/depends_on.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/depends_on.json -------------------------------------------------------------------------------- /tests/fixtures/empty.hcl: -------------------------------------------------------------------------------- 1 | resource "foo" {} 2 | -------------------------------------------------------------------------------- /tests/fixtures/escape.hcl: -------------------------------------------------------------------------------- 1 | foo = "bar\"baz\\n" 2 | -------------------------------------------------------------------------------- /tests/fixtures/flat.hcl: -------------------------------------------------------------------------------- 1 | foo = "bar" 2 | Key = 7 3 | -------------------------------------------------------------------------------- /tests/fixtures/float.hcl: -------------------------------------------------------------------------------- 1 | a = 1.02 2 | -------------------------------------------------------------------------------- /tests/fixtures/float.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 1.02 3 | } 4 | -------------------------------------------------------------------------------- /tests/fixtures/heredoc_terminator_same_line.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/heredoc_terminator_same_line.hcl -------------------------------------------------------------------------------- /tests/fixtures/heredoc_terminator_same_line.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/heredoc_terminator_same_line.json -------------------------------------------------------------------------------- /tests/fixtures/interpolation.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation.hcl -------------------------------------------------------------------------------- /tests/fixtures/interpolation.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation.json -------------------------------------------------------------------------------- /tests/fixtures/interpolation2.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation2.hcl -------------------------------------------------------------------------------- /tests/fixtures/interpolation2.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation2.json -------------------------------------------------------------------------------- /tests/fixtures/interpolation3.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation3.hcl -------------------------------------------------------------------------------- /tests/fixtures/interpolation3.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/interpolation3.json -------------------------------------------------------------------------------- /tests/fixtures/issue12.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/issue12.hcl -------------------------------------------------------------------------------- /tests/fixtures/issue12.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/issue12.json -------------------------------------------------------------------------------- /tests/fixtures/multiline.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "${bar\nbaz}" 3 | } 4 | -------------------------------------------------------------------------------- /tests/fixtures/multiline_bad.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/multiline_bad.hcl -------------------------------------------------------------------------------- /tests/fixtures/no_argument_function.hcl: -------------------------------------------------------------------------------- 1 | path = find_in_parent_folders() -------------------------------------------------------------------------------- /tests/fixtures/no_argument_function.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "${find_in_parent_folders()}" 3 | } -------------------------------------------------------------------------------- /tests/fixtures/scientific.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/scientific.hcl -------------------------------------------------------------------------------- /tests/fixtures/scientific.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/scientific.json -------------------------------------------------------------------------------- /tests/fixtures/structure.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure.json -------------------------------------------------------------------------------- /tests/fixtures/structure2.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure2.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure2.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure2.json -------------------------------------------------------------------------------- /tests/fixtures/structure_flat.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_flat.json -------------------------------------------------------------------------------- /tests/fixtures/structure_flatmap.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_flatmap.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure_flatmap.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_flatmap.json -------------------------------------------------------------------------------- /tests/fixtures/structure_list.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_list.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure_list.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_list.json -------------------------------------------------------------------------------- /tests/fixtures/structure_list_deep.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_list_deep.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure_list_deep.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_list_deep.json -------------------------------------------------------------------------------- /tests/fixtures/structure_multi.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_multi.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure_multi.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_multi.json -------------------------------------------------------------------------------- /tests/fixtures/structure_three_tiers.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_three_tiers.hcl -------------------------------------------------------------------------------- /tests/fixtures/structure_three_tiers.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/structure_three_tiers.json -------------------------------------------------------------------------------- /tests/fixtures/tab_heredoc.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/tab_heredoc.hcl -------------------------------------------------------------------------------- /tests/fixtures/tab_heredoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "${bar\nbaz}" 3 | } 4 | -------------------------------------------------------------------------------- /tests/fixtures/terraform_heroku.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/terraform_heroku.hcl -------------------------------------------------------------------------------- /tests/fixtures/terraform_heroku.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/fixtures/terraform_heroku.json -------------------------------------------------------------------------------- /tests/lex-fixtures/array_comment.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/array_comment.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/assign_colon.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/assign_colon.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/assign_deep.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/assign_deep.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/comment.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/comment.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/complex.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/complex.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/conditional_operator.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/conditional_operator.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/empty_heredoc.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/empty_heredoc.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/heredoc_terminator_same_line.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/heredoc_terminator_same_line.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/list.hcl: -------------------------------------------------------------------------------- 1 | foo = [1, 2, "foo"] 2 | -------------------------------------------------------------------------------- /tests/lex-fixtures/list_comma.hcl: -------------------------------------------------------------------------------- 1 | foo = [1, 2, "foo",] 2 | -------------------------------------------------------------------------------- /tests/lex-fixtures/list_of_maps.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/list_of_maps.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/multiple.hcl: -------------------------------------------------------------------------------- 1 | foo = "bar" 2 | key = 7 3 | -------------------------------------------------------------------------------- /tests/lex-fixtures/nested_comment.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/nested_comment.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/old.hcl: -------------------------------------------------------------------------------- 1 | default = { 2 | "eu-west-1": "ami-b1cf19c6", 3 | } 4 | -------------------------------------------------------------------------------- /tests/lex-fixtures/structure.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/structure.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/structure_basic.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/structure_basic.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/structure_comma.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/structure_comma.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/structure_empty.hcl: -------------------------------------------------------------------------------- 1 | resource "foo" "bar" {} 2 | -------------------------------------------------------------------------------- /tests/lex-fixtures/terraform0.12syntax.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/terraform0.12syntax.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/types.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/types.hcl -------------------------------------------------------------------------------- /tests/lex-fixtures/unterminated_block_comment.hcl: -------------------------------------------------------------------------------- 1 | /* 2 | Foo 3 | -------------------------------------------------------------------------------- /tests/lex-fixtures/windows_heredoc.hcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/lex-fixtures/windows_heredoc.hcl -------------------------------------------------------------------------------- /tests/run_tests.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/run_tests.sh -------------------------------------------------------------------------------- /tests/test_decoder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/test_decoder.py -------------------------------------------------------------------------------- /tests/test_lexer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/test_lexer.py -------------------------------------------------------------------------------- /tests/test_parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PetrusHahol/pyhcl2/HEAD/tests/test_parser.py --------------------------------------------------------------------------------