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

Be equally forgiving of leading & trailing whitespace in number parsing #20606

Merged
merged 5 commits into from
Feb 19, 2017

Conversation

Tetralux
Copy link
Contributor

Follow-up from #20588.

Before #20588, the parsing code for integers was forgiving of leading and trailing whitespace.
The boolean parsing code was not.

After #20588, the integer parsing code was still forgiving of whitespace.
The boolean parsing code was still not.

This PR makes all three forgiving of all leading and trailing whitespace, as determined by isspace.

cc @tkelman

test/parse.jl Outdated

# Test that leading and trailing whitespace is ignored.
for v in (1, 2, 3)
@test parse(Int, " $v" ) == v
Copy link
Contributor

Choose a reason for hiding this comment

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

over indented by 1

@tkelman
Copy link
Contributor

tkelman commented Feb 14, 2017

@nanosoldier runbenchmarks(ALL, vs = ":master")

@Tetralux
Copy link
Contributor Author

@tkelman Oops. Might have inadvertently cancelled Nanosoldier by pushing?

@KristofferC
Copy link
Sponsor Member

Nope. It will post when done.

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@kshyatt kshyatt added the parser Language parsing and surface syntax label Feb 15, 2017
@Tetralux
Copy link
Contributor Author

Hmmm...

["array","index", ("sumvector_view","SubArray{Float32,2,Array{Float32,3},Tuple{Int64,Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}},true}")]

I'm not sure I understand what this means. Something about a slice? :/
Can one of you point me to where I can see this benchmark?

@StefanKarpinski
Copy link
Sponsor Member

That seems unrelated since we're definitely not doing any parsing during view indexing.

@Tetralux
Copy link
Contributor Author

@StefanKarpinski That's what was confusing me.
RTM?

@StefanKarpinski StefanKarpinski merged commit 1297ede into JuliaLang:master Feb 19, 2017
@Tetralux
Copy link
Contributor Author

Thank you. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants