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

Special treatment for filesize 0b #133

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Special treatment for filesize 0b #133

merged 2 commits into from
Nov 6, 2024

Conversation

blindFS
Copy link
Contributor

@blindFS blindFS commented Nov 6, 2024

This PR is a partial fix for file size 0b which will lead to parse error in current grammar.

image

Since 0b is a special single terminal token in $.val_number and $.val_binary.
A perfect split into value 0 and unit b needs unnecessarily complicated tweaking of potential conflicts (also need to split 0b in other 2 rules).

With this PR however, 0b is added to $.val_filesize as a special case, no detailed fields generated:

  (pipeline [0, 0] - [1, 0]
    (pipe_element [0, 0] - [0, 2]
      (val_filesize [0, 0] - [0, 2])))

But it avoids the error with minimal effort.

@fdncred
Copy link
Collaborator

fdncred commented Nov 6, 2024

ya, that's probably a good strategy. thanks!

@fdncred fdncred merged commit d8b3356 into nushell:main Nov 6, 2024
3 checks passed
@blindFS blindFS deleted the dev branch November 7, 2024 03:45
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.

2 participants