def parse_func_def_stat(lexer): lexer.get_next_token_of_kind(TokenKind.KW_FUNCTION) fn_exp, has_colon = StatParser.parse_func_name(lexer) fd_exp = ExpParser.parse_func_def_exp(lexer) if has_colon: fd_exp.insert(0, 'self') return lua_stat.AssignStat(fd_exp.line, [fn_exp], [fd_exp])
def parse_assign_stat(lexer, var0): var_list = StatParser.finish_var_list(lexer, var0) lexer.get_next_token_of_kind(TokenKind.OP_ASSIGN) exp_list = ExpParser.parse_exp_list(lexer) last_line = lexer.get_line() return lua_stat.AssignStat(last_line, var_list, exp_list)