class compiler::ShortcutExpr

sys::Obj
  compiler::Node
    compiler::Expr
      compiler::NameExpr
        compiler::CallExpr
          compiler::ShortcutExpr

Source

ShortcutExpr is used for operator expressions which are a shortcut to a method call:

a + b     =>  a.plus(b)
a - b     =>  a.minus(b)
a * b     =>  a.mult(b)
a / b     =>  a.div(b)
a % b     =>  a.mod(b)
a[b]      =>  a.get(b)
a[b] = c  =>  a.set(b, c)
-a        =>  a.negate()
++a, a++  =>  a.increment()
--a, a--  =>  a.decrement()
a == b    =>  a.equals(b)
a != b    =>  ! a.equals(b)
a <=>     =>  a.compare(b)
a > b     =>  a.compare(b) > 0
a >= b    =>  a.compare(b) >= 0
a < b     =>  a.compare(b) < 0
a <= b    =>  a.compare(b) <= 0
assignRequiresTempVar

virtual override Bool assignRequiresTempVar()

Source

assignTarget

virtual override Obj? assignTarget()

Source

isAssign

Bool isAssign()

Source

isAssignable

virtual override Bool isAssignable()

Source

isCompare

virtual override Bool isCompare()

Source

isPostfixLeave

Bool isPostfixLeave := false

Source

isStmt

virtual override Bool isStmt()

Source

isStrConcat

Bool isStrConcat()

Source

makeBinary

new makeBinary(Expr lhs, Token opToken, Expr rhs)

Source

makeFrom

new makeFrom(ShortcutExpr from)

Source

makeGet

new makeGet(Loc loc, Expr target, Expr index)

Source

makeUnary

new makeUnary(Loc loc, Token opToken, Expr operand)

Source

op

ShortcutOp op

Source

opToken

Token opToken

Source

print

virtual override Void print(AstWriter out)

Source

tempVar

MethodVar? tempVar

Source

toStr

virtual override Str toStr()

Source