def VisitConstant(self, o, **kwargs): return ast.ConstValue(value=o.value)
def VisitConstant(self, o, **kwargs): new = ast.ConstValue(value=o.value) return copy_std( o, new, )
def p_rhs_term2(p): """ rhs_term : quantity """ p[0] = ast.ConstValue(p[1])
def p_lhs_unit_expr(p): """ rhs_quantity_expr : LCURLYBRACKET quantity RCURLYBRACKET""" p[0] = ast.ConstValue( p[2] )
def p_rhs_term4(p): """ rhs_term : MINUSMINUS rhs_term """ backend = p.parser.library_manager.backend neg_one = ast.ConstValue( backend.Quantity( -1.0, backend.Unit() ) ) p[0] = ast.MulOp(neg_one, p[2] )