We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
HCL2 parser cannot parse functions with comments interleaved in the arguments.
**Describe the issue**
The HCL2 parser fails to parse a file that contains an expression with a Terraform function call that contains comments interleaved within the arguments.

**Example Value**
A file that contains the following exaple variable will fail to parse.
```hcl
variable "example" {
  default = function(
    # this comment is fine
    argument1,
    # this comment causes a parsing error
    argument2
    # this comment is fine
  )
}
```

This seems to be a replicated issue in the downstream as well > https://github.com/amplify-education/python-hcl2/issues/95.

I have opened a PR to fix this in the bridgecrewio specific parser > https://github.com/bridgecrewio/python-hcl2/pull/29.

**Question**
Is the bridgecrewio HCL2 Parser intened to be merged upstream?
If not, I will implement the change in Amplify's codebase separately.

**An aside**
Checkov is an awesome tool, it makes the jobs of myself and the rest of the Platform/DevOps Engineers on my team so much easier!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 import logging
3 import os
4 from importlib import util
5 from os import path
6 
7 import setuptools
8 from setuptools import setup
9 
10 # read the contents of your README file
11 this_directory = path.abspath(path.dirname(__file__))
12 with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
13     long_description = f.read()
14 
15 logger = logging.getLogger(__name__)
16 spec = util.spec_from_file_location(
17     "checkov.version", os.path.join("checkov", "version.py")
18 )
19 # noinspection PyUnresolvedReferences
20 mod = util.module_from_spec(spec)
21 spec.loader.exec_module(mod)  # type: ignore
22 version = mod.version  # type: ignore
23 
24 setup(
25     extras_require={
26         "dev": [
27             "pytest==5.3.1",
28             "coverage==5.5",
29             "coverage-badge",
30             "GitPython==3.1.7",
31             "bandit",
32             "jsonschema",
33         ]
34     },
35     install_requires=[
36         "bc-python-hcl2==0.3.38",
37         "cloudsplaining>=0.4.1",
38         "deep_merge",
39         "tabulate",
40         "colorama",
41         "termcolor",
42         "junit-xml>=1.9",
43         "dpath>=1.5.0,<2",
44         "pyyaml>=5.4.1",
45         "boto3>=1.17",
46         "GitPython",
47         "jmespath",
48         "tqdm",
49         "update_checker",
50         "semantic_version",
51         "packaging",
52         "networkx",
53         "dockerfile-parse",
54         "docker",
55         "configargparse",
56         "argcomplete",
57         "detect-secrets",
58         "policyuniverse",
59         "typing-extensions",
60         "cachetools",
61         "cyclonedx-python-lib>=0.11.0,<1.0.0",
62         "click>=8.0.0",
63         "aiohttp",
64         "aiodns",
65         "aiomultiprocess",
66         "jsonpath_ng",
67         "jsonschema~=3.0",
68         "prettytable>=3.0.0",
69         "pycep-parser==0.3.4",
70         "charset-normalizer",
71     ],
72     license="Apache License 2.0",
73     name="checkov",
74     version=version,
75     python_requires=">=3.7",
76     description="Infrastructure as code static analysis",
77     author="bridgecrew",
78     author_email="meet@bridgecrew.io",
79     url="https://github.com/bridgecrewio/checkov",
80     packages=setuptools.find_packages(exclude=["tests*", "integration_tests*"]),
81     include_package_data=True,
82     package_dir={
83         "checkov.bicep.checks.graph_checks": "checkov/bicep/checks/graph_checks",
84         "checkov.terraform.checks.graph_checks": "checkov/terraform/checks/graph_checks",
85     },
86     package_data={
87         "checkov.terraform.checks.graph_checks": [
88             "aws/*.yaml",
89             "gcp/*.yaml",
90             "azure/*.yaml",
91         ],
92         "checkov.common.util.templates": [
93             "*.jinja2"
94         ]
95     },
96     scripts=["bin/checkov", "bin/checkov.cmd"],
97     long_description=long_description,
98     long_description_content_type="text/markdown",
99     classifiers=[
100         "Environment :: Console",
101         "Intended Audience :: Developers",
102         "Intended Audience :: System Administrators",
103         "Programming Language :: Python :: 3.7",
104         "Programming Language :: Python :: 3.8",
105         "Programming Language :: Python :: 3.9",
106         "Programming Language :: Python :: 3.10",
107         "Topic :: Security",
108         "Topic :: Software Development :: Build Tools",
109     ],
110 )
111
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@
         ]
     },
     install_requires=[
-        "bc-python-hcl2==0.3.38",
+        "bc-python-hcl2==0.3.39",
         "cloudsplaining>=0.4.1",
         "deep_merge",
         "tabulate",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -33,7 +33,7 @@\n         ]\n     },\n     install_requires=[\n-        \"bc-python-hcl2==0.3.38\",\n+        \"bc-python-hcl2==0.3.39\",\n         \"cloudsplaining>=0.4.1\",\n         \"deep_merge\",\n         \"tabulate\",\n", "issue": "HCL2 parser cannot parse functions with comments interleaved in the arguments.\n**Describe the issue**\r\nThe HCL2 parser fails to parse a file that contains an expression with a Terraform function call that contains comments interleaved within the arguments.\r\n\r\n**Example Value**\r\nA file that contains the following exaple variable will fail to parse.\r\n```hcl\r\nvariable \"example\" {\r\n  default = function(\r\n    # this comment is fine\r\n    argument1,\r\n    # this comment causes a parsing error\r\n    argument2\r\n    # this comment is fine\r\n  )\r\n}\r\n```\r\n\r\nThis seems to be a replicated issue in the downstream as well > https://github.com/amplify-education/python-hcl2/issues/95.\r\n\r\nI have opened a PR to fix this in the bridgecrewio specific parser > https://github.com/bridgecrewio/python-hcl2/pull/29.\r\n\r\n**Question**\r\nIs the bridgecrewio HCL2 Parser intened to be merged upstream?\r\nIf not, I will implement the change in Amplify's codebase separately.\r\n\r\n**An aside**\r\nCheckov is an awesome tool, it makes the jobs of myself and the rest of the Platform/DevOps Engineers on my team so much easier!\n", "before_files": [{"content": "#!/usr/bin/env python\nimport logging\nimport os\nfrom importlib import util\nfrom os import path\n\nimport setuptools\nfrom setuptools import setup\n\n# read the contents of your README file\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\n\nlogger = logging.getLogger(__name__)\nspec = util.spec_from_file_location(\n    \"checkov.version\", os.path.join(\"checkov\", \"version.py\")\n)\n# noinspection PyUnresolvedReferences\nmod = util.module_from_spec(spec)\nspec.loader.exec_module(mod)  # type: ignore\nversion = mod.version  # type: ignore\n\nsetup(\n    extras_require={\n        \"dev\": [\n            \"pytest==5.3.1\",\n            \"coverage==5.5\",\n            \"coverage-badge\",\n            \"GitPython==3.1.7\",\n            \"bandit\",\n            \"jsonschema\",\n        ]\n    },\n    install_requires=[\n        \"bc-python-hcl2==0.3.38\",\n        \"cloudsplaining>=0.4.1\",\n        \"deep_merge\",\n        \"tabulate\",\n        \"colorama\",\n        \"termcolor\",\n        \"junit-xml>=1.9\",\n        \"dpath>=1.5.0,<2\",\n        \"pyyaml>=5.4.1\",\n        \"boto3>=1.17\",\n        \"GitPython\",\n        \"jmespath\",\n        \"tqdm\",\n        \"update_checker\",\n        \"semantic_version\",\n        \"packaging\",\n        \"networkx\",\n        \"dockerfile-parse\",\n        \"docker\",\n        \"configargparse\",\n        \"argcomplete\",\n        \"detect-secrets\",\n        \"policyuniverse\",\n        \"typing-extensions\",\n        \"cachetools\",\n        \"cyclonedx-python-lib>=0.11.0,<1.0.0\",\n        \"click>=8.0.0\",\n        \"aiohttp\",\n        \"aiodns\",\n        \"aiomultiprocess\",\n        \"jsonpath_ng\",\n        \"jsonschema~=3.0\",\n        \"prettytable>=3.0.0\",\n        \"pycep-parser==0.3.4\",\n        \"charset-normalizer\",\n    ],\n    license=\"Apache License 2.0\",\n    name=\"checkov\",\n    version=version,\n    python_requires=\">=3.7\",\n    description=\"Infrastructure as code static analysis\",\n    author=\"bridgecrew\",\n    author_email=\"meet@bridgecrew.io\",\n    url=\"https://github.com/bridgecrewio/checkov\",\n    packages=setuptools.find_packages(exclude=[\"tests*\", \"integration_tests*\"]),\n    include_package_data=True,\n    package_dir={\n        \"checkov.bicep.checks.graph_checks\": \"checkov/bicep/checks/graph_checks\",\n        \"checkov.terraform.checks.graph_checks\": \"checkov/terraform/checks/graph_checks\",\n    },\n    package_data={\n        \"checkov.terraform.checks.graph_checks\": [\n            \"aws/*.yaml\",\n            \"gcp/*.yaml\",\n            \"azure/*.yaml\",\n        ],\n        \"checkov.common.util.templates\": [\n            \"*.jinja2\"\n        ]\n    },\n    scripts=[\"bin/checkov\", \"bin/checkov.cmd\"],\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    classifiers=[\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: System Administrators\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Topic :: Security\",\n        \"Topic :: Software Development :: Build Tools\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport logging\nimport os\nfrom importlib import util\nfrom os import path\n\nimport setuptools\nfrom setuptools import setup\n\n# read the contents of your README file\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\n\nlogger = logging.getLogger(__name__)\nspec = util.spec_from_file_location(\n    \"checkov.version\", os.path.join(\"checkov\", \"version.py\")\n)\n# noinspection PyUnresolvedReferences\nmod = util.module_from_spec(spec)\nspec.loader.exec_module(mod)  # type: ignore\nversion = mod.version  # type: ignore\n\nsetup(\n    extras_require={\n        \"dev\": [\n            \"pytest==5.3.1\",\n            \"coverage==5.5\",\n            \"coverage-badge\",\n            \"GitPython==3.1.7\",\n            \"bandit\",\n            \"jsonschema\",\n        ]\n    },\n    install_requires=[\n        \"bc-python-hcl2==0.3.39\",\n        \"cloudsplaining>=0.4.1\",\n        \"deep_merge\",\n        \"tabulate\",\n        \"colorama\",\n        \"termcolor\",\n        \"junit-xml>=1.9\",\n        \"dpath>=1.5.0,<2\",\n        \"pyyaml>=5.4.1\",\n        \"boto3>=1.17\",\n        \"GitPython\",\n        \"jmespath\",\n        \"tqdm\",\n        \"update_checker\",\n        \"semantic_version\",\n        \"packaging\",\n        \"networkx\",\n        \"dockerfile-parse\",\n        \"docker\",\n        \"configargparse\",\n        \"argcomplete\",\n        \"detect-secrets\",\n        \"policyuniverse\",\n        \"typing-extensions\",\n        \"cachetools\",\n        \"cyclonedx-python-lib>=0.11.0,<1.0.0\",\n        \"click>=8.0.0\",\n        \"aiohttp\",\n        \"aiodns\",\n        \"aiomultiprocess\",\n        \"jsonpath_ng\",\n        \"jsonschema~=3.0\",\n        \"prettytable>=3.0.0\",\n        \"pycep-parser==0.3.4\",\n        \"charset-normalizer\",\n    ],\n    license=\"Apache License 2.0\",\n    name=\"checkov\",\n    version=version,\n    python_requires=\">=3.7\",\n    description=\"Infrastructure as code static analysis\",\n    author=\"bridgecrew\",\n    author_email=\"meet@bridgecrew.io\",\n    url=\"https://github.com/bridgecrewio/checkov\",\n    packages=setuptools.find_packages(exclude=[\"tests*\", \"integration_tests*\"]),\n    include_package_data=True,\n    package_dir={\n        \"checkov.bicep.checks.graph_checks\": \"checkov/bicep/checks/graph_checks\",\n        \"checkov.terraform.checks.graph_checks\": \"checkov/terraform/checks/graph_checks\",\n    },\n    package_data={\n        \"checkov.terraform.checks.graph_checks\": [\n            \"aws/*.yaml\",\n            \"gcp/*.yaml\",\n            \"azure/*.yaml\",\n        ],\n        \"checkov.common.util.templates\": [\n            \"*.jinja2\"\n        ]\n    },\n    scripts=[\"bin/checkov\", \"bin/checkov.cmd\"],\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    classifiers=[\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: System Administrators\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Topic :: Security\",\n        \"Topic :: Software Development :: Build Tools\",\n    ],\n)\n", "path": "setup.py"}]}