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

make binary not not parse complex expressions on right side #22078

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Jun 11, 2023

fixes #16324

This fixes the pragma issue, and is consistent with not normally having higher precedence than any infix operator. However the left hand side still parses anything.

The issue mentions this:

type FooBar = Foo not nil | Bar

which no longer parses, because of how binary not is special cased in type parsing. Meanwhile Foo | Bar not nil becomes (Foo | Bar) not nil which presumably wouldn't be implemented. Maybe in the future we can remove the special parsing and the compiler can handle Foo(not nil)?

@Araq Araq merged commit e0ad71a into nim-lang:devel Jun 12, 2023
@github-actions
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from e0ad71a

Hint: mm: orc; opt: speed; options: -d:release
167816 lines; 8.269s; 610.949MiB peakmem

bung87 pushed a commit to bung87/Nim that referenced this pull request Jul 29, 2023
…ng#22078)

* binary `not` only parses simple expressions

fixes nim-lang#16324

* switch to primary
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

Successfully merging this pull request may close these issues.

Syntax error when not nil in return type is followed by {.inline.}
2 participants