-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Use rustc_lexer as fallback lexer #202
Conversation
FWIW one of the goals of this crate is to compile as fast as possible, so mind taking some measurements of that for both before/after this change? (build time afterwards including that of rustc_lexer |
Very unscientific test: cad97@DESKTOP-HIBC3H1:/mnt/d/usr/Documents/Code/Rust/proc-macro2$ git.exe checkout master
Switched to branch 'master'
Your branch is up to date with 'upstream/master'.
cad97@DESKTOP-HIBC3H1:/mnt/d/usr/Documents/Code/Rust/proc-macro2$ cargo.exe clean
cad97@DESKTOP-HIBC3H1:/mnt/d/usr/Documents/Code/Rust/proc-macro2$ time cargo.exe build --release
Compiling proc-macro2 v1.0.5 (D:\usr\Documents\Code\Rust\proc-macro2)
Compiling unicode-xid v0.2.0
Finished release [optimized] target(s) in 6.57s
real 0m6.678s
user 0m0.000s
sys 0m0.000s
cad97@DESKTOP-HIBC3H1:/mnt/d/usr/Documents/Code/Rust/proc-macro2$ git.exe checkout rustc_lexer
Switched to branch 'rustc_lexer'
Your branch is up to date with 'origin/rustc_lexer'.
cad97@DESKTOP-HIBC3H1:/mnt/d/usr/Documents/Code/Rust/proc-macro2$ time cargo.exe build --release
Compiling rustc_lexer v0.1.0
Compiling proc-macro2 v1.0.5 (D:\usr\Documents\Code\Rust\proc-macro2)
Finished release [optimized] target(s) in 2.96s
real 0m3.036s
user 0m0.000s
sys 0m0.000s So it looks like the removal of |
Whoops, just realized I missed a
(measurements done with |
Second test (with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would prefer to stick with this crate's own lexer for now.
Thanks anyway for the PR!
Migrates the fallback parser to use
rustc_lexer
. WIP proof of concept currently.Closes #201, closes #126, impacts #55, #5.
Failing tests:
' static
asLiteral { lit: ' static, span: bytes(1..9) }
)