Skip to content
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

Documentation for named _ and backreferences in node pattern #161

Open
dvandersluis opened this issue Dec 19, 2020 · 3 comments
Open

Documentation for named _ and backreferences in node pattern #161

dvandersluis opened this issue Dec 19, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@dvandersluis
Copy link
Member

(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/rubocop#9257.

It'd be great to have something in the node pattern docs to explain that.

@marcandre
Copy link
Contributor

Oh, indeed, it seems to be missing in the main doc 😅

PR welcome, or I'll handle it after Xmas

@marcandre marcandre added the documentation Improvements or additions to documentation label Dec 19, 2020
@marcandre
Copy link
Contributor

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.

@dvandersluis
Copy link
Member Author

Thanks @marcandre! I’ll take a look if I get a chance. Happy holidays!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants