Skip to main content

Module operator

Module operator 

Source
Expand description

The engine’s expression operators, one module per family.

Each family is its own file and its own type, so a caller can reach for exactly the set they mean and nothing here grows into one long list:

Operator wraps all six when a single type is wanted.

§Precedence was measured, not assumed

No precedence table exists in the published reference, so rather than copy C’s and hope, each relation below was established by evaluating an expression on a live engine and reading the result:

ExpressionResultWhat it establishes
2+3*414* binds inside +
1 << 2 + 18+ binds inside <<
1 & 3 == 31== binds inside &
1 | 2 & 33& binds inside |
1 ^ 2 & 33& binds inside ^
0 || 1 && 0False&& binds inside ||

Giving levels 1 (tightest) through 10 (loosest). Assignment reports None: it binds loosest, but its exact level was never measured, and an unverified number presented as fact is the thing this crate refuses to ship.

Re-exports§

pub use arithmetic::ArithmeticOperator;
pub use assignment::AssignmentOperator;
pub use bitwise::BitwiseOperator;
pub use comparison::ComparisonOperator;
pub use logical::LogicalOperator;
pub use other::OtherOperator;

Modules§

arithmetic
Arithmetic operators.
assignment
Assignment operators.
bitwise
Bitwise operators.
comparison
Comparison operators.
logical
Logical operators.
other
Operators that shape an expression rather than compute a value.

Enums§

Arity
How many operands an operator takes.
Operator
Any operator in the expression language.
OperatorClass
The family an operator belongs to.