-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
NodePattern for numblock "count" element #156
Comments
|
A precise example of what you are trying to achieve would help me. You can use |
You can also use What is confusing is that |
This is the matcher, for rubocop#9127 def_node_matcher :symbol_proc?, <<~PATTERN
({block numblock}
${(send ...) (super ...) zsuper}
${(args (arg _)) %Integer}
(send (lvar _var) $_))
PATTERN |
Good. The question remains: should the |
I agree, allowing |
…ad of predicate `#Example_type?`) [Fixes rubocop#156]
…ad of predicate `#Example_type?`) [Fixes rubocop#156]
…ad of predicate `#Example_type?`) Stricter for what is an identifier: - forbids leading `_` or capital letter - forbids `-` anywhere Thus are no longer accepted `_Example` or `#_foo` or `bar-baz?` [Fixes rubocop#156]
…ad of predicate `#Example_type?`) Stricter for what is an identifier: - forbids leading `_` or capital letter - forbids `-` anywhere Thus are no longer accepted `_Example` or `#_foo` or `bar-baz?` [Fixes rubocop#156]
…ad of predicate `#Example_type?`) Stricter for what is an identifier: - forbids leading `_` or capital letter - forbids `-` anywhere Thus are no longer accepted `_Example` or `#_foo` or `bar-baz?` [Fixes #156]
Consider:
ruby-parse --27 -e "something { _1 }" (numblock (send nil :something) 1 (lvar :_1))
The count of numbered parameters is returned as a bare integer, which makes it extra resistant to being captured in a node pattern. It's not an
int
node soint
orint_type?
don't work, and if I try#is_a?(Integer)
I getArgumentError: wrong number of arguments (given 2, expected 1)
for some reason.Any suggestions?
The text was updated successfully, but these errors were encountered: