def parse_def_stmt(self):
stmt = ast.FunctionDefinition(self.cur_tok, [], None)
self.next()
stmt.pattern = self.parse_pattern_call(token.LBRACE)
if stmt.pattern == None:
return None
stmt.body = self.parse_block_statement()
if len(stmt.pattern) == 0:
self.err("expected at least one item in a pattern")
return None
return stmt
评论列表
文章目录