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

Anchor at the end of the search pattern for s/// doesn't find stopper in some cases. #3456

Closed
p6rt opened this issue Jul 20, 2014 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 20, 2014

Migrated from rt.perl.org#122349 (status was 'resolved')

Searchable as RT122349$

@p6rt
Copy link
Author

p6rt commented Apr 16, 2014

From @grondilu

6​:26 grondilu m​: s/$/foo/; .say
16​:26 camelia rakudo-moar 8bac4d​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m Error while compiling /tmp/_dDWO_1OC0â�¤Malformed replacement part; couldn't find final /â�¤at /tmp/_dDWO_1OC0​:1â�¤------> �[32ms/$/foo/; .say�[33mâ���[31m<EOL>�[0mâ�¤ expecting any of​:â�¤ statement listâ�¤ p…»
16​:26 grondilu std​: s/$/foo/; .say
16​:26 camelia std e347792​: OUTPUT«ok 00​:01 123m␤»
16​:27 grondilu j​: s/$/foo/; .say
16​:27 camelia rakudo-jvm 8bac4d​: ( no output )
16​:27 TimToady rakudobug
16​:27 TimToady n​: s/$/foo/; .say
16​:27 camelia niecza v24-109-g48a8de3​: OUTPUT«Unhandled exception​: Unable to resolve method subst in type Any␤ at /tmp/JwT5W2q6lI line 1 (mainline @​ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @​ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4596 (module-CORE @​ 576) …»

@p6rt
Copy link
Author

p6rt commented Jul 20, 2014

From @peschwa

22​:58 < psch> m​: my $a ="abc"; $a ~~ s/c$/i/; say $a
22​:58 <+camelia> rakudo-moar fc0cbb​: OUTPUT«===SORRY!=== Error while compiling /tmp/VYmw2fyuzc␤Malformed replacement part; couldn't find
  final /␤at /tmp/VYmw2fyuzc​:1␤------> my $a ="abc"; $a ~~ s/c$/i/; say $a⏏<EOL>␤ expecting any of​:␤ postf…»
22​:58 < psch> aha
22​:59 < psch> suddenly $/
22​:59 < psch> m​: my $a ="abc"; $a ~~ s/c$ /i/; say $a
22​:59 <+camelia> rakudo-moar fc0cbb​: OUTPUT«abi␤»
23​:01 < psch> for reference, that came from RT #​82108 but clearly has another problem than the one in the ticket
23​:01 < synopsebot> Link​: https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=82108
23​:02 <+dalek> roast​: 2946712 | (David Warring david.warring@​gmail.com)++ | integration/advent2009-day17.t​:
23​:02 <+dalek> roast​: tweak. 'our' no longer needed
23​:02 <+dalek> roast​: review​: https://github.com/perl6/roast/commit/2946712f21
23​:03 -!- akaseki [~akaseki@​unaffiliated/akaseki] has joined #perl6
23​:08 -!- nbrown [~nbrown@​2601​:6​:7f00​:18a​:9137​:2e6a​:e149​:3210] has joined #perl6
23​:14 -!- tgt [~tgt@​97e5a98c.skybroadband.com] has quit [Quit​: Textual IRC Client​: www.textualapp.com]
23​:19 < masak> m​: my $a = "abc"; say $a ~~ /c$/
23​:19 <+camelia> rakudo-moar fc0cbb​: OUTPUT«「c」␤␤»
23​:19 < masak> arguably, that's a bit inconsistent.
23​:19 < masak> if // can handle $ appearing right by the end of the pattern, why not s/// ?
23​:28 < psch> m​: my $a = 'abc'; $a ~~ s/c$/ /; say $a.perl # this is fine too
23​:28 <+camelia> rakudo-moar fc0cbb​: OUTPUT«"ab "␤»
23​:29 < psch> masak​: i agree, it should work
23​:32 < masak> psch​: feel free to submit a rakudobug about it.

@p6rt
Copy link
Author

p6rt commented Jul 21, 2014

From @peschwa

Am So 20. Jul 2014, 14​:40​:01, peschwa@​gmail.com schrieb​:

22​:58 < psch> m​: my $a ="abc"; $a ~~ s/c$/i/; say $a
22​:58 <+camelia> rakudo-moar fc0cbb​: OUTPUT«===SORRY!=== Error while
compiling /tmp/VYmw2fyuzc␤Malformed replacement part; couldn't find
final /␤at /tmp/VYmw2fyuzc​:1␤------> my $a ="abc"; $a
~~ s/c$/i/; say $a⏏<EOL>␤ expecting any of​:␤ postf…»
22​:58 < psch> aha
22​:59 < psch> suddenly $/
22​:59 < psch> m​: my $a ="abc"; $a ~~ s/c$ /i/; say $a
22​:59 <+camelia> rakudo-moar fc0cbb​: OUTPUT«abi␤»
23​:01 < psch> for reference, that came from RT #​82108 but clearly has
another problem than the one in the ticket
23​:01 < synopsebot> Link​:
https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=82108
23​:02 <+dalek> roast​: 2946712 | (David Warring
david.warring@​gmail.com)++ | integration/advent2009-day17.t​:
23​:02 <+dalek> roast​: tweak. 'our' no longer needed
23​:02 <+dalek> roast​: review​:
https://github.com/perl6/roast/commit/2946712f21
23​:03 -!- akaseki [~akaseki@​unaffiliated/akaseki] has joined #perl6
23​:08 -!- nbrown [~nbrown@​2601​:6​:7f00​:18a​:9137​:2e6a​:e149​:3210] has
joined #perl6
23​:14 -!- tgt [~tgt@​97e5a98c.skybroadband.com] has quit [Quit​: Textual
IRC Client​: www.textualapp.com]
23​:19 < masak> m​: my $a = "abc"; say $a ~~ /c$/
23​:19 <+camelia> rakudo-moar fc0cbb​: OUTPUT«「c」␤␤»
23​:19 < masak> arguably, that's a bit inconsistent.
23​:19 < masak> if // can handle $ appearing right by the end of the
pattern, why not s/// ?
23​:28 < psch> m​: my $a = 'abc'; $a ~~ s/c$/ /; say $a.perl # this is
fine too
23​:28 <+camelia> rakudo-moar fc0cbb​: OUTPUT«"ab "␤»
23​:29 < psch> masak​: i agree, it should work
23​:32 < masak> psch​: feel free to submit a rakudobug about it.

A PR for this ticket exists at [1]. Spectests as of today were clean.

[1] rakudo/rakudo#293

@p6rt
Copy link
Author

p6rt commented Jul 21, 2014

From @peschwa

On Mon Jul 21 13​:14​:16 2014, peschwa@​gmail.com wrote​:

Am So 20. Jul 2014, 14​:40​:01, peschwa@​gmail.com schrieb​:

22​:58 < psch> m​: my $a ="abc"; $a ~~ s/c$/i/; say $a
22​:58 <+camelia> rakudo-moar fc0cbb​: OUTPUT«===SORRY!=== Error while
compiling /tmp/VYmw2fyuzc␤Malformed replacement part; couldn't find
final /␤at /tmp/VYmw2fyuzc​:1␤------> my $a ="abc"; $a
~~ s/c$/i/; say $a⏏<EOL>␤ expecting any of​:␤ postf…»
22​:58 < psch> aha
22​:59 < psch> suddenly $/
22​:59 < psch> m​: my $a ="abc"; $a ~~ s/c$ /i/; say $a
22​:59 <+camelia> rakudo-moar fc0cbb​: OUTPUT«abi␤»
23​:01 < psch> for reference, that came from RT #​82108 but clearly has
another problem than the one in the ticket
23​:01 < synopsebot> Link​:
https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=82108
23​:02 <+dalek> roast​: 2946712 | (David Warring
david.warring@​gmail.com)++ | integration/advent2009-day17.t​:
23​:02 <+dalek> roast​: tweak. 'our' no longer needed
23​:02 <+dalek> roast​: review​:
https://github.com/perl6/roast/commit/2946712f21
23​:03 -!- akaseki [~akaseki@​unaffiliated/akaseki] has joined #perl6
23​:08 -!- nbrown [~nbrown@​2601​:6​:7f00​:18a​:9137​:2e6a​:e149​:3210] has
joined #perl6
23​:14 -!- tgt [~tgt@​97e5a98c.skybroadband.com] has quit [Quit​: Textual
IRC Client​: www.textualapp.com]
23​:19 < masak> m​: my $a = "abc"; say $a ~~ /c$/
23​:19 <+camelia> rakudo-moar fc0cbb​: OUTPUT«「c」␤␤»
23​:19 < masak> arguably, that's a bit inconsistent.
23​:19 < masak> if // can handle $ appearing right by the end of the
pattern, why not s/// ?
23​:28 < psch> m​: my $a = 'abc'; $a ~~ s/c$/ /; say $a.perl # this is
fine too
23​:28 <+camelia> rakudo-moar fc0cbb​: OUTPUT«"ab "␤»
23​:29 < psch> masak​: i agree, it should work
23​:32 < masak> psch​: feel free to submit a rakudobug about it.

A PR for this ticket exists at [1]. Spectests as of today were clean.

[1] rakudo/rakudo#293

The PR has been merged by FROGGS++, tests have been added to roast in commit 8a4306996, resolving.

@p6rt p6rt closed this as completed Jul 21, 2014
@p6rt
Copy link
Author

p6rt commented Jul 21, 2014

@peschwa - Status changed from 'new' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Aug 9, 2014

From @peschwa

Am Mi 16. Apr 2014, 09​:36​:03, grondilu@​yahoo.fr schrieb​:

6​:26 grondilu m​: s/$/foo/; .say
16​:26 camelia rakudo-moar 8bac4d​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m Error while compiling
/tmp/_dDWO_1OC0�Malformed replacement part; couldn't find final
/â�¤at /tmp/_dDWO_1OC0​:1â�¤------> �[32ms/$/foo/;
.say�[33mâ���[31m<EOL>�[0mâ�¤ expecting any of​:â�¤ statement
list� p…»
16​:26 grondilu std​: s/$/foo/; .say
16​:26 camelia std e347792​: OUTPUT«ok 00​:01 123m␤»
16​:27 grondilu j​: s/$/foo/; .say
16​:27 camelia rakudo-jvm 8bac4d​: ( no output )
16​:27 TimToady rakudobug
16​:27 TimToady n​: s/$/foo/; .say
16​:27 camelia niecza v24-109-g48a8de3​: OUTPUT«Unhandled
exception​: Unable to resolve method subst in type Any␤ at
/tmp/JwT5W2q6lI line 1 (mainline @​ 3) ␤ at
/home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @​ 3) ␤ at
/home/p6eval/niecza/lib/CORE.setting line 4596 (module-CORE @​ 576) …»

DUP​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=122349

This has been fixed in Rakudo PR #​293 (rakudo/rakudo#293) and tests have been added to roast as well.

@p6rt
Copy link
Author

p6rt commented Aug 9, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant