-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add new ruby parser that uses Prism #1144
Merged
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
61e7613
Add a new ruby parser RDoc::Parser::PrismRuby
tompng 76d7786
Add a new ruby parser testcase independent from parser's internal imp…
tompng 021d547
unknown meta method
tompng c44bd1f
Use MethodSignatureVisitor only to scan params, block_params and call…
tompng 83b0fde
Add calls_super test
tompng aca20e1
Drop ruby 2.6. Prism requires ruby >= 2.7
tompng ec8ba9e
Remove duplicated documentation comment from prism_ruby.rb
tompng 6531724
Add test for wrong argument passed to metaprogramming method
tompng f8a7c8f
Rename visit_call_[DSL_METHOD_NAME] to make it distinguishable from v…
tompng c6341ec
Method receiver switch of true/false/nil to a case statement
tompng 00e164d
Extract common part of add_method(by def keyword) and add meta_commen…
tompng 24ce586
Reuse consecutive comments array when collecting comments
tompng 0a8634c
Simplify DSL call_node handling
tompng 1ce2634
Refactor extracting method visibility arguments
tompng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are these changes for? Looks like they're fixing issues that'd also affect the default Ruby parser?
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.
In the default ruby parser, the third parameter
line
is just ignored.The line where
:method:
is written is the source line number of ghost method.The original code is calculating line number by this code.
rdoc/lib/rdoc/parser/ruby.rb
Lines 1094 to 1095 in 1bb3bec
pre_process.rb
parses comment directives,parse_comment
also parses some comment directives.To avoid re-implementing these kind of thing, I changed
PreProcess#handle
to also provide line_number for each directive.This is not the best way. pre_process has problem and I think it should be fixed in the future. pre_process needs code_object already created, but we need to parse the comment first to identify code_object type which can be either attribute or method.