-
Notifications
You must be signed in to change notification settings - Fork 2.1k
'not' operator precedence displayed wrong #13675
Copy link
Copy link
Closed
Labels
A:syntaxChanges to the grammar or syntax beyond parser bugfixesChanges to the grammar or syntax beyond parser bugfixescategory:documentationissues relating to documentationissues relating to documentation
Milestone
Description
Describe the bug
Operators and their precedence values are given with the help operators command:

not operator precedence is given as 0. or precedence is 40.
~> if not (false) or (true) { print hello }This prints hello. If or precedence was higher than not, it wouldn't print anything, since the evaluation order would be like the following:
~> if not ((false) or (true)) { print hello }How to reproduce
Run the given command.
Expected behavior
help operators command to display the correct precedence.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.96.1 |
| major | 0 |
| minor | 96 |
| patch | 1 |
| branch | |
| commit_hash | |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.80.1 (3f5fd8dd4 2024-08-06) (built from a source tarball) |
| cargo_version | cargo 1.80.0 (376290515 2024-07-16) |
| build_time | 1980-01-01 00:00:00 +00:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | default, sqlite, system-clipboard, trash |
| installed_plugins |
Additional context
I feel there is a special reason I don't know for why nots precedence is 0 here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:syntaxChanges to the grammar or syntax beyond parser bugfixesChanges to the grammar or syntax beyond parser bugfixescategory:documentationissues relating to documentationissues relating to documentation