isAssociativeOperator property
bool
get
isAssociativeOperator
Return true
if this type of token represents an associative operator. An
associative operator is an operator for which the following equality is
true: (a * b) * c == a * (b * c)
. In other words, if the result of
applying the operator to multiple operands does not depend on the order in
which those applications occur.
Note: This method considers the logical-and and logical-or operators to be associative, even though the order in which the application of those operators can have an effect because evaluation of the right-hand operand is conditional.
Implementation
bool get isAssociativeOperator =>
this == TokenType.AMPERSAND ||
this == TokenType.AMPERSAND_AMPERSAND ||
this == TokenType.BAR ||
this == TokenType.BAR_BAR ||
this == TokenType.CARET ||
this == TokenType.PLUS ||
this == TokenType.STAR;