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

SubstituteAndReturn: contextual and chained substitute #7

Open
zmughal opened this issue Apr 1, 2022 · 0 comments · May be fixed by #8
Open

SubstituteAndReturn: contextual and chained substitute #7

zmughal opened this issue Apr 1, 2022 · 0 comments · May be fixed by #8

Comments

@zmughal
Copy link

zmughal commented Apr 1, 2022

The plugin does not currently support substitution with the r flag

  1. that uses $_, e.g.,
map { s/foo/bar/r } @list

which does not change the input

  1. and chained substitution, e.g.,
$foo =~ s/foo/bar/gr =~ s/(bar)+/baz/gr

which gives

(map { (my $__B_001 = $_) =~ s/foo/bar/g; $__B_001 } $foo)[0] =~ s/(bar)+/baz/gr
zmughal added a commit to zmughal/Babble that referenced this issue Apr 5, 2022
This add support for chained substitutions of the form

  ... =~ s///r =~ s///r =~ s///r

as well as substitutions that are contextually performed on the `$_`
variable (i.e., they do not have a binding operator `=~`).

Fixes <shadow-dot-cat#7>.
@zmughal zmughal linked a pull request Apr 5, 2022 that will close this issue
zmughal added a commit to zmughal/Babble that referenced this issue Apr 5, 2022
This add support for chained substitutions of the form

  ... =~ s///r =~ s///r =~ s///r

as well as substitutions that are contextually performed on the `$_`
variable (i.e., they do not have a binding operator `=~`).

Fixes <shadow-dot-cat#7>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant