Open gkjohnson opened 3 years ago
Unfortunately, the binaryOps object can't be used to add new operators, only change the implementation of existing ones. It's kind of confusing because you can add to unaryOps (with the limitation that the operator needs to be a valid identifier, so no special characters). It's something that would be nice to support in the future, but isn't currently because of how the parser works.
Got it -- makes sense. Reworking the parsing for unary ops sounds like a large task. As a smaller adjustment it might be nice to add support for just &&
as an empty / non-implemented operator so users can override the behavior considering it's frequently used as boolean AND. It could throw an error by default so people don't mistakenly use it without it being overwritten.
Thanks again!
When declaring '&&' in the "binaryOps" field an error is thrown when parsing a binary '&&' expression:
Thanks for the awesome library!