Closed tamasfe closed 2 years ago
Well, it actually is an operator. It is parsed like a normal operator, except that internally it gets turned into a call to contains
with the operands switched. But syntax wise, it is an operator.
It does have a different precedence though.
I assigned the lowest binding power to it for now which is just above the default user-provided ones. (yeah it's now possible to provide custom operators that are valid identifiers).
I assigned the lowest binding power to it for now
Precedence of the in
operator is defined here: https://rhai.rs/book/engine/custom-op.html#operator-precedence
We should parse
in
just as an operator for the sake of simplicity, then restrict its usability in the HIR where needed.