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

Add eof check for streaming parser #321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

wardlem
Copy link

@wardlem wardlem commented May 7, 2021

Summary

Adds an end of file check to the streaming parser.

Motivation

# This works
JSON.parse("123")

# This also works
JSON.parse(IOBuffer("123\n"))

# This currently breaks
JSON.parse(IOBuffer("123"))

Fixes #314

@@ -0,0 +1,2 @@
@test JSON.parse(IOBuffer("123")) == 123
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create a new file for this, just add it to e.g.

@testset "Miscellaneous" begin

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I will change this.

@wardlem wardlem requested a review from KristofferC May 13, 2021 11:28
@pitipatw
Copy link

Is this issue resolved?
I also got an error that seems to be related to this one:

Unexpected end of input
│ ...when parsing byte with value '0'

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.

Unexpected end of input error when parsing input streams
3 participants