rubocop-ast
rubocop-ast copied to clipboard
Documentation for named `_` and backreferences in node pattern
(block _ $(args (arg _var)) (send (lvar _var) $_))
I was not aware that in a pattern like this, _var acts as a backreference when repeated (ie. the second _var has to match the first _var), which caused the issue in rubocop-hq/rubocop#9257.
It'd be great to have something in the node pattern docs to explain that.
Oh, indeed, it seems to be missing in the main doc 😅
PR welcome, or I'll handle it after Xmas
My fault btw, I was tired of the repetition between the source code's doc and the official doc, so I removed the code's doc in 2ca9c08 but didn't notice that was missing.
Thanks @marcandre! I’ll take a look if I get a chance. Happy holidays!!