-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 0. in lexer #10025
base: master
Are you sure you want to change the base?
Fix 0. in lexer #10025
Conversation
this is a language-breaking change and cannot be done just like this. if we ever get a nixlang revision a la rfc137 this should absolutely be part of the syntax revision, but current nixlang cannot do this without breaking stuff. |
You're right, this changes how this example expression is parsed: Here's another example: |
Here's another instance of the "list item separator" making things difficult. Without versioning the language, which is also not exactly great, the best thing we can do is to warn about such "ambiguous" syntax. |
Best not to work on the parser until pennae's rewrite is merged |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-02-28-nix-team-meeting-129/40499/1 |
since this was listed as "blocked on parser rewrite" in the meeting notes but #9971 was rejected outright, we will add here: this should also be rejected outright for the exact same reason |
@pennae Does that mean you disagree with the idea of keeping the same behavior, while adding a warning about this suspicious syntax?
For those who don't already know, usually we refers to their personal pronoun, which can't be distinguished from the pronoun for a group. I respect that and I believe it's important that others know this to, for respectful, fair and effective communication. |
without infrastructure that would also allow #9971 to emit a warning for suspicious indentation? yes. this kind of issue should be handled consistently across all instances. |
Of course we need the right infrastructure for both cases to work. I can't estimate the feasibility or cost of this, and I don't want to burden you with these issues any more than necessary. Let's take one step at a time, the step being the rewrite. We can worry about these warnings later. |
@thufschmitt ok, the we're on the same page after all :) very good |
Motivation
0.
is not parsed correctly as a float.Context
Currently,
0.
is tokenized asINT '.'
.This change will also allow
01.123
, butINT
token is defined as just[0-9]+
so this will make parser more consistent. Currently,01
is parsed asINT
, but01.0
, gives an errorattempt to call something which is not a function but an integer
.Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.