MCPcopy Create free account
hub / github.com/NICUP14/MiniLang / compound_statement

Method compound_statement

src/Parser.py:1310–1320  ·  view source on GitHub ↗
(self, add_predef: bool = True)

Source from the content-addressed store, hash-verified

1308 return node
1309
1310 def compound_statement(self, add_predef: bool = True) -> Optional[Node]:
1311 node = None
1312 while not self.no_more_lines(check_next_lines=True) and self.curr_token().kind not in (TokenKind.KW_END, TokenKind.KW_ELSE, TokenKind.KW_ELIF):
1313 if node is None:
1314 node = self.statement(add_predef)
1315 else:
1316 node = Node(NodeKind.GLUE, void_type,
1317 '', node, self.statement(add_predef))
1318 self.next_line()
1319
1320 return node
1321
1322 def import_statement(self) -> Optional[Node]:
1323 if Def.fun_name != '':

Callers 9

expand_macroMethod · 0.95
namespace_statementMethod · 0.95
while_statementMethod · 0.95
for_statementMethod · 0.95
elif_statementMethod · 0.95
if_statementMethod · 0.95
fun_declarationMethod · 0.95
block_statementMethod · 0.95
macro_statementMethod · 0.95

Calls 5

no_more_linesMethod · 0.95
curr_tokenMethod · 0.95
statementMethod · 0.95
next_lineMethod · 0.95
NodeClass · 0.90

Tested by

no test coverage detected