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

[BUG] Json read won't work with negative numbers #1902

Open
glyh opened this issue Apr 6, 2024 · 4 comments
Open

[BUG] Json read won't work with negative numbers #1902

glyh opened this issue Apr 6, 2024 · 4 comments

Comments

@glyh
Copy link
Collaborator

glyh commented Apr 6, 2024

echo '-10' | json read (&num)
  echo '-10' | json read (&num)
                    ^~~~
[ interactive ]:6: json read: Invalid token while parsing JSON: Id.J8_Operator (pos 0-1: '-10\n')
  echo '-10' | json read (&num)
               ^~~~
[ interactive ]:6: errexit PID 13012: command.Simple failed with status 1
  echo '-10' | json read (&num)
               ^~~~
[ interactive ]:6: errexit PID 13012: command.Pipeline failed with status 1
@glyh glyh added the bug label Apr 6, 2024
@andychu
Copy link
Contributor

andychu commented Apr 6, 2024

Oh wow, good find! I will fix this

andychu pushed a commit that referenced this issue Apr 6, 2024
This is issue #1902.  Thanks to glyh for finding it.

Note that J8_Operator lexing had a bug - it included J8_Colon.

Unrelated:

[errors] Tweak error message
@andychu
Copy link
Contributor

andychu commented Apr 6, 2024

This is now fixed - you can grab a new tarball from

cpp-tarball or ovm-tarball task --

http://travis-ci.oilshell.org/github-jobs/6620/

The Results link -- it's an uncompressed tarball

Thanks!

@glyh
Copy link
Collaborator Author

glyh commented Apr 6, 2024

Can confirm this is fixed in the tarball.

@glyh glyh closed this as completed Apr 6, 2024
@andychu
Copy link
Contributor

andychu commented Apr 6, 2024

I usually leave these open pending-release, since I have a script that collects them for release notes, thanks

@andychu andychu reopened this Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants