Пример #1
0
 def VisitConstant(self, o, **kwargs):
     return ast.ConstValue(value=o.value)
Пример #2
0
 def VisitConstant(self, o, **kwargs):
     new = ast.ConstValue(value=o.value)
     return copy_std(
         o,
         new,
     )
Пример #3
0
def p_rhs_term2(p):
    """ rhs_term : quantity """
    p[0] = ast.ConstValue(p[1])
Пример #4
0
def p_lhs_unit_expr(p):
    """ rhs_quantity_expr : LCURLYBRACKET quantity RCURLYBRACKET"""
    p[0] = ast.ConstValue( p[2] )
Пример #5
0
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] )