@@ -23,10 +23,11 @@ def parse_to_ast_with_settings(
23
23
module_path : Optional [str ] = None ,
24
24
resolved_path : Optional [str ] = None ,
25
25
add_fn_node : Optional [str ] = None ,
26
+ is_interface : bool = False ,
26
27
) -> tuple [Settings , vy_ast .Module ]:
27
28
try :
28
29
return _parse_to_ast_with_settings (
29
- vyper_source , source_id , module_path , resolved_path , add_fn_node
30
+ vyper_source , source_id , module_path , resolved_path , add_fn_node , is_interface
30
31
)
31
32
except SyntaxException as e :
32
33
e .resolved_path = resolved_path
@@ -39,6 +40,7 @@ def _parse_to_ast_with_settings(
39
40
module_path : Optional [str ] = None ,
40
41
resolved_path : Optional [str ] = None ,
41
42
add_fn_node : Optional [str ] = None ,
43
+ is_interface : bool = False ,
42
44
) -> tuple [Settings , vy_ast .Module ]:
43
45
"""
44
46
Parses a Vyper source string and generates basic Vyper AST nodes.
@@ -62,6 +64,9 @@ def _parse_to_ast_with_settings(
62
64
resolved_path: str, optional
63
65
The resolved path of the source code
64
66
Corresponds to FileInput.resolved_path
67
+ is_interface: bool
68
+ Indicates whether the source code should
69
+ be parsed as an interface file.
65
70
66
71
Returns
67
72
-------
@@ -106,6 +111,7 @@ def _parse_to_ast_with_settings(
106
111
# Convert to Vyper AST.
107
112
module = vy_ast .get_node (py_ast )
108
113
assert isinstance (module , vy_ast .Module ) # mypy hint
114
+ module .is_interface = is_interface
109
115
110
116
return pre_parser .settings , module
111
117
0 commit comments