python-hcl2 4.3.3__tar.gz → 4.3.5__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.
Files changed (38) hide show
  1. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/MANIFEST.in +1 -1
  2. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/PKG-INFO +2 -3
  3. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/README.md +1 -2
  4. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/hcl2.lark +8 -1
  5. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/transformer.py +8 -0
  6. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/version.py +2 -2
  7. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/PKG-INFO +2 -3
  8. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.codacy.yml +0 -0
  9. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.coveragerc +0 -0
  10. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.github/CODEOWNERS +0 -0
  11. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.github/workflows/codeql-analysis.yml +0 -0
  12. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.github/workflows/pr_check.yml +0 -0
  13. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.github/workflows/publish.yml +0 -0
  14. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.gitignore +0 -0
  15. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.pre-commit-config.yaml +0 -0
  16. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/.yamllint.yml +0 -0
  17. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/CHANGELOG.md +0 -0
  18. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/LICENSE +0 -0
  19. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/bin/terraform_test +0 -0
  20. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/__init__.py +0 -0
  21. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/__main__.py +0 -0
  22. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/api.py +0 -0
  23. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/parser.py +0 -0
  24. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/hcl2/py.typed +0 -0
  25. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/mypy.ini +0 -0
  26. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/pylintrc +0 -0
  27. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/pyproject.toml +0 -0
  28. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/SOURCES.txt +0 -0
  29. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/dependency_links.txt +0 -0
  30. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/entry_points.txt +0 -0
  31. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/not-zip-safe +0 -0
  32. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/requires.txt +0 -0
  33. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/python_hcl2.egg-info/top_level.txt +0 -0
  34. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/reports/.gitignore +0 -0
  35. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/requirements.txt +0 -0
  36. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/setup.cfg +0 -0
  37. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/test-requirements.txt +0 -0
  38. {python-hcl2-4.3.3 → python-hcl2-4.3.5}/tox.ini +0 -0
@@ -1,8 +1,8 @@
1
1
  # Manifest file for the egg
2
2
  include LICENSE
3
- include *.pip
4
3
  include *.md
5
4
  include *.rst
6
5
  include hcl2/hcl2.lark
7
6
  include hcl2/py.typed
7
+ include *requirements.txt
8
8
  prune test
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-hcl2
3
- Version: 4.3.3
3
+ Version: 4.3.5
4
4
  Summary: A parser for HCL2
5
5
  Author-email: Amplify Education <github@amplify.com>
6
6
  License: MIT
@@ -22,8 +22,7 @@ Requires-Python: >=3.7.0
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
 
25
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Grade)
26
- [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Coverage)
25
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2e2015f9297346cbaa788c46ab957827)](https://app.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
27
26
  [![Build Status](https://travis-ci.org/amplify-education/python-hcl2.svg?branch=master)](https://travis-ci.org/amplify-education/python-hcl2)
28
27
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/python-hcl2/master/LICENSE)
29
28
  [![PyPI](https://img.shields.io/pypi/v/python-hcl2.svg)](https://pypi.org/project/python-hcl2/)
@@ -1,5 +1,4 @@
1
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Grade)
2
- [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Coverage)
1
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2e2015f9297346cbaa788c46ab957827)](https://app.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
3
2
  [![Build Status](https://travis-ci.org/amplify-education/python-hcl2.svg?branch=master)](https://travis-ci.org/amplify-education/python-hcl2)
4
3
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/python-hcl2/master/LICENSE)
5
4
  [![PyPI](https://img.shields.io/pypi/v/python-hcl2.svg)](https://pypi.org/project/python-hcl2/)
@@ -5,7 +5,11 @@ block : identifier (identifier | STRING_LIT)* new_line_or_comment? "{" body "}"
5
5
  new_line_and_or_comma: new_line_or_comment | "," | "," new_line_or_comment
6
6
  new_line_or_comment: ( /\n/ | /#.*\n/ | /\/\/.*\n/ )+
7
7
 
8
- identifier : /[a-zA-Z_][a-zA-Z0-9_-]*/
8
+ identifier : /[a-zA-Z_][a-zA-Z0-9_-]*/ | IN | FOR | IF | FOR_EACH
9
+ IF : "if"
10
+ IN : "in"
11
+ FOR : "for"
12
+ FOR_EACH : "for_each"
9
13
 
10
14
  ?expression : expr_term | operation | conditional
11
15
 
@@ -27,6 +31,7 @@ expr_term : "(" new_line_or_comment? expression new_line_or_comment? ")"
27
31
  | index_expr_term
28
32
  | get_attr_expr_term
29
33
  | identifier
34
+ | provider_function_call
30
35
  | heredoc_template
31
36
  | heredoc_template_trim
32
37
  | attr_splat_expr_term
@@ -55,6 +60,8 @@ heredoc_template_trim : /<<-(?P<heredoc_trim>[a-zA-Z][a-zA-Z0-9._-]+)\n(?:.|\n)*
55
60
 
56
61
  function_call : identifier "(" new_line_or_comment? arguments? new_line_or_comment? ")"
57
62
  arguments : (expression (new_line_or_comment* "," new_line_or_comment* expression)* ("," | "...")? new_line_or_comment*)
63
+ colons: "::"
64
+ provider_function_call: identifier colons identifier colons identifier "(" new_line_or_comment? arguments? new_line_or_comment? ")"
58
65
 
59
66
  index_expr_term : expr_term index
60
67
  get_attr_expr_term : expr_term get_attr
@@ -111,6 +111,14 @@ class DictTransformer(Transformer):
111
111
  args_str = ", ".join([str(arg) for arg in args[1] if arg is not Discard])
112
112
  return f"{args[0]}({args_str})"
113
113
 
114
+ def provider_function_call(self, args: List) -> str:
115
+ args = self.strip_new_line_tokens(args)
116
+ args_str = ""
117
+ if len(args) > 5:
118
+ args_str = ", ".join([str(arg) for arg in args[5] if arg is not Discard])
119
+ provider_func = "::".join([args[0], args[2], args[4]])
120
+ return f"{provider_func}({args_str})"
121
+
114
122
  def arguments(self, args: List) -> List:
115
123
  return args
116
124
 
@@ -1,4 +1,4 @@
1
1
  # file generated by setuptools_scm
2
2
  # don't change, don't track in version control
3
- __version__ = version = '4.3.3'
4
- __version_tuple__ = version_tuple = (4, 3, 3)
3
+ __version__ = version = '4.3.5'
4
+ __version_tuple__ = version_tuple = (4, 3, 5)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-hcl2
3
- Version: 4.3.3
3
+ Version: 4.3.5
4
4
  Summary: A parser for HCL2
5
5
  Author-email: Amplify Education <github@amplify.com>
6
6
  License: MIT
@@ -22,8 +22,7 @@ Requires-Python: >=3.7.0
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
 
25
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Grade)
26
- [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/9c7cdf082b044abdab378fa82795b5a5)](https://www.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/python-hcl2&utm_campaign=Badge_Coverage)
25
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2e2015f9297346cbaa788c46ab957827)](https://app.codacy.com/gh/amplify-education/python-hcl2/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
27
26
  [![Build Status](https://travis-ci.org/amplify-education/python-hcl2.svg?branch=master)](https://travis-ci.org/amplify-education/python-hcl2)
28
27
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/python-hcl2/master/LICENSE)
29
28
  [![PyPI](https://img.shields.io/pypi/v/python-hcl2.svg)](https://pypi.org/project/python-hcl2/)
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