Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'not(' Operator #17

Open
JEbertPrime opened this issue May 9, 2021 · 0 comments
Open

Add 'not(' Operator #17

JEbertPrime opened this issue May 9, 2021 · 0 comments

Comments

@JEbertPrime
Copy link
Contributor

The not( operator (wiki post) is equivalent to JavaScript's ! operator, but differs in a few key ways.

  • Everything after the operator is evaluated before not, including logical operators and mathematical expressions.
Disp not(1 and 0
//1
Disp not(1 and 0 or 1
//0
  • A close parenthesis is not required, but can be used to enclose a not( operator within a line
Disp not(1) or 1
//1
Disp not(0) or 0
//1

The operator takes a single argument of the same types as other logical operators, and can be nested.
I foresee this being a fairly simple rule to implement in the parser, considering the already implemented support for other expressions using (.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant