Fix error on block pattern and method call without receiver#90
Open
pocke wants to merge 1 commit intosoutaro:masterfrom
Open
Fix error on block pattern and method call without receiver#90pocke wants to merge 1 commit intosoutaro:masterfrom
pocke wants to merge 1 commit intosoutaro:masterfrom
Conversation
```console
$ cat test.rb
foo
$ querly find a{}.foo
Error: undefined method `type' for nil:NilClass
pattern: a{}.foo
Backtrace:
/path/to/querly-1.3.0/lib/querly/pattern/expr.rb:174:in `test_node'
/path/to/querly-1.3.0/lib/querly/pattern/expr.rb:195:in `test_receiver'
/path/to/querly-1.3.0/lib/querly/pattern/expr.rb:182:in `test_node'
/path/to/querly-1.3.0/lib/querly/pattern/expr.rb:159:in `=~'
/path/to/querly-1.3.0/lib/querly/analyzer.rb:42:in `test_pair'
/path/to/querly-1.3.0/lib/querly/analyzer.rb:34:in `block (2 levels) in find'
/path/to/querly-1.3.0/lib/querly/node_pair.rb:25:in `each_subpair'
/path/to/querly-1.3.0/lib/querly/analyzer.rb:33:in `block in find'
/path/to/querly-1.3.0/lib/querly/analyzer.rb:32:in `each'
/path/to/querly-1.3.0/lib/querly/analyzer.rb:32:in `find'
/path/to/querly-1.3.0/lib/querly/cli/find.rb:23:in `start'
/path/to/querly-1.3.0/lib/querly/cli.rb:104:in `find'
/path/to/thor-1.2.1/lib/thor/command.rb:27:in `run'
/path/to/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
/path/to/thor-1.2.1/lib/thor.rb:392:in `dispatch'
/path/to/thor-1.2.1/lib/thor/base.rb:485:in `start'
/path/to/querly-1.3.0/exe/querly:8:in `<top (required)>'
/path/to/bin/querly:25:in `load'
/path/to/bin/querly:25:in `<main>'
```
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A block pattern raises an error on a method call without the receiver.
For example:
This patch fixes this problem