def p_try_statement_1(self, p): """try_statement : TRY block catch""" p[0] = ast.Try(statements=p[2], catch=p[3],lineno=p.lineno(2))
def p_try_statement_3(self, p): """try_statement : TRY block catch finally""" p[0] = ast.Try(statements=p[2], catch=p[3], fin=p[4], lineno=p.lineno(2))
def p_try_statement_2(self, p): """try_statement : TRY block finally""" p[0] = ast.Try(statements=p[2], fin=p[3])