Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.
src/operator-ledger.x
Compiler lookups from one binary operator ledger.
Functions
| Function | Summary |
|---|---|
Compiler.derived_member | Returns the protocol member that derives a comparison operator. |
Compiler.operator_member | Returns the protocol member corresponding to a direct binary operator. |
Symbol.binary_precedence | Returns a binary operator’s precedence level, or zero for any other Symbol. |
Symbol.compound_assignment | Returns the compound assignment for a binary operator, or zero. |
Symbol.compound_operator | Returns the binary operator computed by a compound assignment, or zero. |
Compiler
Compiler.derived_member
Symbol Compiler.derived_member(Compiler c, Symbol op)
Returns the protocol member that derives a comparison operator.
Inequality derives from equal, ordered comparisons derive from compare,
and unsupported operators return zero.
Source: src/operator-ledger.x:42
Compiler.operator_member
Symbol Compiler.operator_member(Compiler c, Symbol op)
Returns the protocol member corresponding to a direct binary operator. Returns zero when the operator has no direct protocol mapping.
Source: src/operator-ledger.x:32
Symbol
Symbol.binary_precedence
int Symbol.binary_precedence(Symbol op)
Returns a binary operator’s precedence level, or zero for any other
Symbol. Levels run from 1 for || to 10 for the multiplicative
operators, so a larger level binds more tightly. === and !== share
the equality level, in the relational level, and @ the
multiplicative level.
Source: src/operator-ledger.x:12
Symbol.compound_assignment
Symbol Symbol.compound_assignment(Symbol op)
Returns the compound assignment for a binary operator, or zero.
Source: src/operator-ledger.x:24
Symbol.compound_operator
Symbol Symbol.compound_operator(Symbol op)
Returns the binary operator computed by a compound assignment, or zero.
Source: src/operator-ledger.x:18