Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 833a664

Browse files
test changes
1 parent 53becd6 commit 833a664

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

hcl2/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""The API that will be exposed to users of this package"""
22
from typing import TextIO
33

4+
from lark import Tree
5+
46
from hcl2.parser import hcl2
57
from hcl2.transformer import DictTransformer
68

@@ -26,3 +28,8 @@ def loads(text: str, with_meta=False) -> dict:
2628
# Append a new line as a temporary fix
2729
tree = hcl2.parse(text + "\n")
2830
return DictTransformer(with_meta=with_meta).transform(tree)
31+
32+
33+
def load_to_tree(file: TextIO) -> Tree:
34+
"""docstring"""
35+
return hcl2.parse(file.read() + "\n")

0 commit comments

Comments
 (0)