-
Notifications
You must be signed in to change notification settings - Fork 3
🐛 fix(mq-lang): handle double not operator and add related test #1118
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
🐛 fix(mq-lang): handle double not operator and add related test #1118
Conversation
- Fix parser to properly handle `TokenKind::Not` as an unexpected token in specific contexts. - Add integration test for double not operator (`!!`) on booleans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a parser issue where the double not operator (!!) was not being handled correctly in the mq language. The fix adds TokenKind::Not to the list of unexpected tokens in a specific parsing context, and includes an integration test to verify the double not operator works correctly on boolean values.
Changes:
- Updated parser logic to properly recognize
TokenKind::Notas an unexpected token in specific contexts - Added integration test case verifying that
!!truecorrectly evaluates totrue
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/mq-lang/src/ast/parser.rs | Added TokenKind::Not to the list of tokens triggering an UnexpectedToken error in the parser |
| crates/mq-lang/tests/integration_tests.rs | Added integration test case for double not operator on boolean values |
| #[case::double_not_true("!!true", | ||
| vec![RuntimeValue::Boolean(false)], | ||
| Ok(vec![RuntimeValue::Boolean(true)].into()))] |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test only covers !!true. Consider adding test cases for !!false to ensure the double not operator works correctly for both boolean values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: harehare <533078+harehare@users.noreply.github.com>
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes |
Add test coverage for `!!false` operator
TokenKind::Notas an unexpected token in specific contexts.!!) on booleans.