Exemple #1
0
def p_expr_old(p: Any) -> None:
    'expr : OLD LPAREN expr RPAREN'
    p[0] = syntax.UnaryExpr(p.slice[1], 'OLD', p[3])
Exemple #2
0
def p_expr_not(p: Any) -> None:
    'expr : BANG expr'
    p[0] = syntax.UnaryExpr(p.slice[1], 'NOT', p[2])
Exemple #3
0
def p_expr_old(p: Any) -> None:
    'expr : OLD LPAREN expr RPAREN'
    e: syntax.Expr = p[3]
    p[0] = syntax.UnaryExpr('OLD', e, span=loc_join(p.slice[1], p.slice[4]))
Exemple #4
0
def p_expr_new(p: Any) -> None:
    'expr : NEW LPAREN expr RPAREN'
    e: syntax.Expr = p[3]
    p[0] = syntax.UnaryExpr('NEW', e, span=loc_join(p.slice[1], p.slice[4]))
Exemple #5
0
def p_expr_not(p: Any) -> None:
    '''expr : BANG expr
            | TILDE expr'''
    expr: syntax.Expr = p[2]
    p[0] = syntax.UnaryExpr('NOT', expr, span=loc_join(p.slice[1], expr.span))