-
Notifications
You must be signed in to change notification settings - Fork 832
Remove some unnecessary copying from lexer #9961
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
Conversation
TIHan
left a comment
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.
This looks good, only a few minor nits.
I think the ReadOnlySpan use makes a lot of sense, but we will need to be careful as it doesn't mean the source won't change from underneath it.
cartermp
left a comment
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.
Approved as well, subject to some nits. Thanks!
|
nice! |
* rename methods * remove "new"
|
I've updated the style and added a small change to illex .fsl for integer parsing to use span |
|
Thanks! |
* Reduce copying and allocations in lexing * Simplify and improve perf of eval * Dont create temporary array in discardInput since blit handles overlapping memory * Fix review comments and update a new method * rename methods * remove "new"
Removes some copying and allocations from the lexer code which was found when trying to learn how the lexing works.
I am new to F# so if there is some style issues please let me know.
If you prefer I can remove the
LexemeContainsandLexemeCharfrom lexbuf since the code can be rewritten tojust call ".Lexeme" and then index that one or do IndexOf on the span instead