Skip to content

Commit

Permalink
Fix typo in node pattern defining method name
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj authored and bbatsov committed Aug 16, 2020
1 parent 7fc1bae commit 2ccbed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/node_pattern.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ Example patterns using this function:
The arguments can be pattern themselves, in which case a matcher responding to `===` will be passed. This makes patterns composable:

```ruby
def_node_pattern :global_const?, '(const {nil? cbase} %1)'
def_node_pattern :class_creator, '(send #global_const?({:Class :Module}) :new ...)'
def_node_matcher :global_const?, '(const {nil? cbase} %1)'
def_node_matcher :class_creator, '(send #global_const?({:Class :Module}) :new ...)'
```

== Using node matcher macros
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/ast/node_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Compiler

def initialize(str, root = 'node0', node_var = root)
@string = str
# For def_node_pattern, root == node_var
# For def_node_matcher, root == node_var
# For def_node_search, root is the root node to search on,
# and node_var is the current descendant being searched.
@root = root
Expand Down

0 comments on commit 2ccbed2

Please sign in to comment.