python-hcl2 7.0.0__tar.gz → 7.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_hcl2-7.0.1/.github/ISSUE_TEMPLATE/hcl2-parsing-error.md +32 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/CHANGELOG.md +6 -0
- {python_hcl2-7.0.0/python_hcl2.egg-info → python_hcl2-7.0.1}/PKG-INFO +1 -1
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/hcl2.lark +3 -2
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/transformer.py +3 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/version.py +2 -2
- {python_hcl2-7.0.0 → python_hcl2-7.0.1/python_hcl2.egg-info}/PKG-INFO +1 -1
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/SOURCES.txt +1 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.codacy.yml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.coveragerc +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/CODEOWNERS +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/codeql-analysis.yml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/pr_check.yml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/publish.yml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.gitignore +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.pre-commit-config.yaml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.yamllint.yml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/LICENSE +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/MANIFEST.in +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/README.md +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/bin/terraform_test +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/__init__.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/__main__.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/api.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/builder.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/parser.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/py.typed +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/reconstructor.py +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/mypy.ini +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/pylintrc +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/pyproject.toml +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/dependency_links.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/entry_points.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/not-zip-safe +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/requires.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/top_level.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/reports/.gitignore +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/requirements.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/setup.cfg +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/test-requirements.txt +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/tox.ini +0 -0
- {python_hcl2-7.0.0 → python_hcl2-7.0.1}/tree-to-hcl2-reconstruction.md +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: HCL2 parsing error
|
|
3
|
+
about: Template for reporting a bug related to parsing HCL2 code
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: kkozik-amplify
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
|
|
12
|
+
A clear and concise description of what the bug is.
|
|
13
|
+
|
|
14
|
+
**Software:**
|
|
15
|
+
- OS: [macOS / Windows / Linux]
|
|
16
|
+
- Python version (e.g. 3.9.21)
|
|
17
|
+
- python-hcl2 version (e.g. 7.0.0)
|
|
18
|
+
|
|
19
|
+
**Snippet of HCL2 code causing the unexpected behaviour:**
|
|
20
|
+
```terraform
|
|
21
|
+
locals {
|
|
22
|
+
foo = "bar"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
**Expected behavior**
|
|
26
|
+
|
|
27
|
+
A clear and concise description of what you expected to happen, e.g. python dictionary or JSON you expected to receive as a result of parsing.
|
|
28
|
+
|
|
29
|
+
**Exception traceback (if applicable)**:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
```
|
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## \[7.0.1\] - 2025-03-31
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Issue parsing dot-accessed attribute as an object key ([#209](https://github.com/amplify-education/python-hcl2/pull/209))
|
|
13
|
+
|
|
8
14
|
## \[7.0.0\] - 2025-03-27
|
|
9
15
|
|
|
10
16
|
### Added
|
|
@@ -38,6 +38,7 @@ PLUS : "+"
|
|
|
38
38
|
LPAR : "("
|
|
39
39
|
RPAR : ")"
|
|
40
40
|
COMMA : ","
|
|
41
|
+
DOT : "."
|
|
41
42
|
|
|
42
43
|
expr_term : LPAR new_line_or_comment? expression new_line_or_comment? RPAR
|
|
43
44
|
| float_lit
|
|
@@ -74,8 +75,8 @@ EQ : /[ \t]*=(?!=|>)/
|
|
|
74
75
|
tuple : "[" (new_line_or_comment* expression new_line_or_comment* ",")* (new_line_or_comment* expression)? new_line_or_comment* "]"
|
|
75
76
|
object : "{" new_line_or_comment? (new_line_or_comment* (object_elem | (object_elem COMMA)) new_line_or_comment*)* "}"
|
|
76
77
|
object_elem : object_elem_key ( EQ | ":") expression
|
|
77
|
-
object_elem_key : float_lit | int_lit | identifier | STRING_LIT
|
|
78
|
-
|
|
78
|
+
object_elem_key : float_lit | int_lit | identifier | STRING_LIT | object_elem_key_dot_accessor
|
|
79
|
+
object_elem_key_dot_accessor : identifier (DOT identifier)+
|
|
79
80
|
|
|
80
81
|
heredoc_template : /<<(?P<heredoc>[a-zA-Z][a-zA-Z0-9._-]+)\n?(?:.|\n)*?\n\s*(?P=heredoc)\n/
|
|
81
82
|
heredoc_template_trim : /<<-(?P<heredoc_trim>[a-zA-Z][a-zA-Z0-9._-]+)\n?(?:.|\n)*?\n\s*(?P=heredoc_trim)\n/
|
|
@@ -107,6 +107,9 @@ class DictTransformer(Transformer):
|
|
|
107
107
|
value = self.to_string_dollar(value)
|
|
108
108
|
return {key: value}
|
|
109
109
|
|
|
110
|
+
def object_elem_key_dot_accessor(self, args: List) -> str:
|
|
111
|
+
return "".join(args)
|
|
112
|
+
|
|
110
113
|
def object(self, args: List) -> Dict:
|
|
111
114
|
args = self.strip_new_line_tokens(args)
|
|
112
115
|
result: Dict[str, Any] = {}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|