Comments (4)
Indeed, this is surprising 😅
This was noted in whitequark/parser#184: "Note that {associate} produces unexpected result for nodes which are equal but have distinct locations; comments for these nodes are merged."
The proposed fix was associate_locations
that does the same but uses the location as key.
IMO, a better method than either of them would be associate_by_identity
, which does not use eql?
but equal?
. I'm proposing a PR for this: whitequark/parser#798
I believe that we could modify our ast_with_comments
to use that without any incompatibility, but I didn't double check yet.
from rubocop-ast.
As I expected, tests pass on master
.
Released in 1.4.2 👍
from rubocop-ast.
Released 1.5.0...
from rubocop-ast.
Thanks for the quick work @marcandre! 🎉
from rubocop-ast.
Related Issues (20)
- rubocop-ast-0.4.0 has broken Layout/LineLength HOT 4
- Fix `traversal`
- Changelog link is a 404 HOT 3
- CI: check JRuby and other platforms
- Broken links in "Using Node Matcher Macros" documentation HOT 1
- Request: allow method calls on constants HOT 5
- NodePattern for numblock "count" element HOT 6
- `global_const?` and some other matchers should be available to cops
- Documentation for named `_` and backreferences in node pattern HOT 3
- Undefined method emit_forward_arg= in AST::Builder:Class HOT 3
- Issues with `parent_module_name`
- Missing files when attempting to do a gem build HOT 3
- `send_node.block_node` does not handle `numblock`s
- Long-shot parser -> lib-ruby-parser transition for performance boost? HOT 1
- Basic documentation of Node Pattern HOT 1
- Why is the live debugger not online anymore ? https://nodepattern.herokuapp.com/ HOT 4
- Do we need an MasgnNode ? HOT 2
- Experimental Prism feature listed as runtime dependency HOT 11
- Changelog for v1.31.2 is missing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubocop-ast.