python-hcl2 4.3.2__py3-none-any.whl → 4.3.4__py3-none-any.whl

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.
hcl2/hcl2.lark CHANGED
@@ -27,6 +27,7 @@ expr_term : "(" new_line_or_comment? expression new_line_or_comment? ")"
27
27
  | index_expr_term
28
28
  | get_attr_expr_term
29
29
  | identifier
30
+ | provider_function_call
30
31
  | heredoc_template
31
32
  | heredoc_template_trim
32
33
  | attr_splat_expr_term
@@ -55,6 +56,8 @@ heredoc_template_trim : /<<-(?P<heredoc_trim>[a-zA-Z][a-zA-Z0-9._-]+)\n(?:.|\n)*
55
56
 
56
57
  function_call : identifier "(" new_line_or_comment? arguments? new_line_or_comment? ")"
57
58
  arguments : (expression (new_line_or_comment* "," new_line_or_comment* expression)* ("," | "...")? new_line_or_comment*)
59
+ colons: "::"
60
+ provider_function_call: identifier colons identifier colons identifier "(" new_line_or_comment? arguments? new_line_or_comment? ")"
58
61
 
59
62
  index_expr_term : expr_term index
60
63
  get_attr_expr_term : expr_term get_attr
hcl2/transformer.py CHANGED
@@ -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
 
hcl2/version.py CHANGED
@@ -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.2'
4
- __version_tuple__ = version_tuple = (4, 3, 2)
3
+ __version__ = version = '4.3.4'
4
+ __version_tuple__ = version_tuple = (4, 3, 4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-hcl2
3
- Version: 4.3.2
3
+ Version: 4.3.4
4
4
  Summary: A parser for HCL2
5
5
  Author-email: Amplify Education <github@amplify.com>
6
6
  License: MIT
@@ -17,13 +17,13 @@ Classifier: Programming Language :: Python :: 3.8
17
17
  Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
20
21
  Requires-Python: >=3.7.0
21
22
  Description-Content-Type: text/markdown
22
23
  License-File: LICENSE
23
- Requires-Dist: lark (<2,>=1)
24
+ Requires-Dist: lark <2,>=1
24
25
 
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)
26
+ [![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
27
  [![Build Status](https://travis-ci.org/amplify-education/python-hcl2.svg?branch=master)](https://travis-ci.org/amplify-education/python-hcl2)
28
28
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/python-hcl2/master/LICENSE)
29
29
  [![PyPI](https://img.shields.io/pypi/v/python-hcl2.svg)](https://pypi.org/project/python-hcl2/)
@@ -0,0 +1,14 @@
1
+ hcl2/__init__.py,sha256=lhqyp-1rL-31xfuxE0dfLBQ02-vIDo96uSh-T1lD9DY,176
2
+ hcl2/__main__.py,sha256=LEpiRzDH4XyeDpt6BNhas47KxRXcojE0gy4m9rjaktk,3905
3
+ hcl2/api.py,sha256=bTuQeFxKhTd9aVvJqfU6LvmDSKbb2uiDGGWJ1O2b5BE,1173
4
+ hcl2/hcl2.lark,sha256=h17qVmp-ElBVZ1E498nrL_wMMHQ2aONPtvIk_W9BxMU,3641
5
+ hcl2/parser.py,sha256=px70k5IM_IMYTyOy2w6ZjM3EJgpNDm3pVXyQ7bf8q6w,378
6
+ hcl2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ hcl2/transformer.py,sha256=F5yLvKuaw3BVS3xCkYD4QQpDKpfY0VyDXjt-X-u8Tso,10648
8
+ hcl2/version.py,sha256=LVrgIX9fRGOktnG9GUcNq6YsIhp5Io7bE6hLdEJgWe0,160
9
+ python_hcl2-4.3.4.dist-info/LICENSE,sha256=1F6u5DUziQ9nOhsdpCKebpuHYXa-t16pV8xJaZapj_s,1063
10
+ python_hcl2-4.3.4.dist-info/METADATA,sha256=o4ZrLo77gxHcEWnCO69wgxRPX1cRGkdkgtdzW6dWvOw,4238
11
+ python_hcl2-4.3.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
12
+ python_hcl2-4.3.4.dist-info/entry_points.txt,sha256=bnypOQEfgRl8rn8Y5nxN-sVykWIjN6iYEZuBdIE7oIE,50
13
+ python_hcl2-4.3.4.dist-info/top_level.txt,sha256=VojzcOOhGnzMUM9GGycypzCte0tKrxrfpvFqfxH5MFw,5
14
+ python_hcl2-4.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- hcl2/__init__.py,sha256=lhqyp-1rL-31xfuxE0dfLBQ02-vIDo96uSh-T1lD9DY,176
2
- hcl2/__main__.py,sha256=LEpiRzDH4XyeDpt6BNhas47KxRXcojE0gy4m9rjaktk,3905
3
- hcl2/api.py,sha256=bTuQeFxKhTd9aVvJqfU6LvmDSKbb2uiDGGWJ1O2b5BE,1173
4
- hcl2/hcl2.lark,sha256=xXdVhrWgLu6f6nxACBK_SbrVRg2XaJVV9vPBH0gRJho,3456
5
- hcl2/parser.py,sha256=px70k5IM_IMYTyOy2w6ZjM3EJgpNDm3pVXyQ7bf8q6w,378
6
- hcl2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- hcl2/transformer.py,sha256=iA17FNPwDzNlkhC6AOl2y_OZlIrXOfGA39G4tk2kEm0,10301
8
- hcl2/version.py,sha256=i1tkswKTljoMhYjsI0RmfxL1qiwKDVQFpKZ7Fj_hWzQ,160
9
- python_hcl2-4.3.2.dist-info/LICENSE,sha256=1F6u5DUziQ9nOhsdpCKebpuHYXa-t16pV8xJaZapj_s,1063
10
- python_hcl2-4.3.2.dist-info/METADATA,sha256=od3NhHsL5hzdgOmWZG4_3faPkSq3Q9Phis-A7mqWajs,4503
11
- python_hcl2-4.3.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
- python_hcl2-4.3.2.dist-info/entry_points.txt,sha256=bnypOQEfgRl8rn8Y5nxN-sVykWIjN6iYEZuBdIE7oIE,50
13
- python_hcl2-4.3.2.dist-info/top_level.txt,sha256=VojzcOOhGnzMUM9GGycypzCte0tKrxrfpvFqfxH5MFw,5
14
- python_hcl2-4.3.2.dist-info/RECORD,,