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

various improvements to parser #22161

Merged
merged 2 commits into from
Jun 5, 2017
Merged

various improvements to parser #22161

merged 2 commits into from
Jun 5, 2017

Conversation

JeffBezanson
Copy link
Member

  • move call to short-form-function-loc inside parse-assignment
    this is faster and fixes nested cases like f(x)=g(x)=1
  • fix a case where an unexpected "foo" message was missing quotes
  • optimize common case of arglists of comma-separated simple tokens
  • some other small optimizations
  • put code back in precedence order
  • separate parse-Nary and parse-comma so they're easier to read
  • cleaner code for parse-unary and parse-factor

release-0.6:

julia> open("bigarray.txt","w") do f
        show(f, rand(100000))
       end

julia> @time parse(readstring("bigarray.txt"));
  2.380243 seconds (100.02 k allocations: 3.244 MiB)

This PR:

julia> @time parse(readstring("bigarray.txt"));
  1.401921 seconds (100.02 k allocations: 3.244 MiB)

This only affects parsing speed of long, simple argument lists.

- move call to `short-form-function-loc` inside `parse-assignment`
  this is faster and fixes nested cases like `f(x)=g(x)=1`
- fix a case where an `unexpected "foo"` message was missing quotes

- optimize common case of arglists of comma-separated simple tokens
- some other small optimizations

- put code back in precedence order
- separate parse-Nary and parse-comma so they're easier to read
- cleaner code for parse-unary and parse-factor
@JeffBezanson JeffBezanson added the parser Language parsing and surface syntax label May 31, 2017
@JeffBezanson JeffBezanson merged commit aab564a into master Jun 5, 2017
@JeffBezanson JeffBezanson deleted the jb/parser branch June 5, 2017 15:35
kmsquire added a commit to kmsquire/Coverage.jl that referenced this pull request Sep 5, 2017
* JuliaLang/julia#22161 updated the parser and
  caused some changes in how Coverage works
* For test/data/testparser.jl, line 10 is the end of a @doc string (`"""
  ->`), and Line 11 is an expression (`f6(x) = 6x`)
* Before the above commit, the zero count goes to line 10, and after,
  the zero count goes (more correctly?) to line 11
tkelman pushed a commit to JuliaCI/Coverage.jl that referenced this pull request Sep 8, 2017
* JuliaLang/julia#22161 updated the parser and
  caused some changes in how Coverage works
* For test/data/testparser.jl, line 10 is the end of a @doc string (`"""
  ->`), and Line 11 is an expression (`f6(x) = 6x`)
* Before the above commit, the zero count goes to line 10, and after,
  the zero count goes (more correctly?) to line 11
@vtjnash vtjnash mentioned this pull request Sep 14, 2017
vtjnash pushed a commit that referenced this pull request Sep 14, 2017
- move call to `short-form-function-loc` inside `parse-assignment`
  this is faster and fixes nested cases like `f(x)=g(x)=1`
- fix a case where an `unexpected "foo"` message was missing quotes

- optimize common case of arglists of comma-separated simple tokens
- some other small optimizations

- put code back in precedence order
- separate parse-Nary and parse-comma so they're easier to read
- cleaner code for parse-unary and parse-factor
ararslan pushed a commit that referenced this pull request Sep 15, 2017
- move call to `short-form-function-loc` inside `parse-assignment`
  this is faster and fixes nested cases like `f(x)=g(x)=1`
- fix a case where an `unexpected "foo"` message was missing quotes

- optimize common case of arglists of comma-separated simple tokens
- some other small optimizations

- put code back in precedence order
- separate parse-Nary and parse-comma so they're easier to read
- cleaner code for parse-unary and parse-factor
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.

3 participants