-
Notifications
You must be signed in to change notification settings - Fork 446
Use Prism instead of Ripper for Ruby source tokenization #1470
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
base: master
Are you sure you want to change the base?
Conversation
|
🚀 Preview deployment available at: https://a7caabcf.rdoc-6cd.pages.dev (commit: 1433d3f) |
kou
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.
+1
| super(code) | ||
| # Returns tokens parsed from +code+. | ||
| def self.parse(code) | ||
| lex = self.new(code) |
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.
self. is redundant here.
| lex = self.new(code) | |
| lex = new(code) |
| begin | ||
| while tk = lex.get_squashed_tk | ||
| tokens.push tk | ||
| end | ||
| rescue StopIteration | ||
| end |
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.
It seems that we can remove begin/rescue StopIteration/end here because 2b96a8b removed Enumerator.
| tk[:state] = EXPR_ARG | ||
| tk[:kind] = :on_ident | ||
| elsif tk[:text] =~ /^[-+]$/ then | ||
| elsif tk[:text] =~ /^[-+]$/ |
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.
| elsif tk[:text] =~ /^[-+]$/ | |
| elsif tk[:text] =~ /\A[-+]\z/ |
|
I think creating a new syntax highlighter based on |
No description provided.