Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Rakudo allows reversed ranges in character classes in regexes, shouldn't #1458

Closed p6rt closed 12 years ago

p6rt commented 14 years ago

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

Searchable as RT71702$

p6rt commented 14 years ago

From @masak

\ mberends​: I made great strides with GGE yesterday on the bus. \ \o/ \ the funniest things to implement are things marked TODO in PGE. :) \ rakudo​: say "foo" ~~ /\<[d..b]>? foo/ \ rakudo 8dc189​: foo␤ \ GGE dies on the reverse range in the enum char class. \ ooh! * masak submits rakudobug \ :P \ ng​: say "foo" ~~ /\<[d..b]>? foo/ \ ng 06c947​: foo␤ \ heh.

p6rt commented 14 years ago

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S05-metasyntax/charset.t

commit 8cf9ce6e75dec38eaf2e2c5c5474bc1336d468d2 Author​: kyle \kyle@&#8203;c213334d\-75ef\-0310\-aa23\-eaa082d1ae64 Date​: Tue Dec 29 17​:02​:28 2009 +0000

  [t/spec] Test for RT 71702​: lethal reverse range in charset  
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;29417 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch ```diff diff --git a/t/spec/S05-metasyntax/charset.t b/t/spec/S05-metasyntax/charset.t index 1aeba3f..329348c 100644 --- a/t/spec/S05-metasyntax/charset.t +++ b/t/spec/S05-metasyntax/charset.t @@ -12,7 +12,7 @@ be valid perl6. =end pod -plan 25; +plan *; if !eval('("a" ~~ /a/)') { skip_rest "skipped tests - rules support appears to be missing"; @@ -60,6 +60,12 @@ ok( "foo" ~~ /<[f] #`[comment] + [o]>/, 'comment embedded in charset works' ); #?rakudo skip 'large \\x char spec in regex (RT #67122) (noauto)' ok "\x[10001]" ~~ /<[\x10000..\xEFFFF]>/, 'large \\x char spec'; +#?rakudo todo 'RT 71702: lethal reverse range in charset' +eval_dies_ok( "'RT 71702' ~~ /<[d..b]>? RT/", + 'reverse range in charset is lethal (RT 71702)' ); + } +done_testing; + # vim: ft=perl6 ```
p6rt commented 14 years ago

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

p6rt commented 14 years ago

From @bbkr

[13​:26] \ std​: say "foo" ~~ /\<[d..b]>? foo/ [13​:26] \ std 31887​: OUTPUT«ok 00​:01 119m␤»

I'm not sure if reversed ranges are allowed in current spec, so I leave it unchanged

p6rt commented 12 years ago

From @jnthn

On Tue Dec 29 03​:14​:18 2009, masak wrote​:

\ mberends​: I made great strides with GGE yesterday on the bus. \ \o/ \ the funniest things to implement are things marked TODO in PGE. :) \ rakudo​: say "foo" ~~ /\<[d..b]>? foo/ \ rakudo 8dc189​: foo␤ \ GGE dies on the reverse range in the enum char class. \ ooh! * masak submits rakudobug \ :P \ ng​: say "foo" ~~ /\<[d..b]>? foo/ \ ng 06c947​: foo␤ \ heh.

Dies now​:

say "foo" ~~ /\<[d..b]>? foo/ Illegal reversed character range in regex​: d..b at line 1, near ">? foo/\n"

Tagging testneeded.

/jnthn

p6rt commented 12 years ago

From @diakopter

On Fri Apr 20 06​:02​:21 2012, jnthn@​jnthn.net wrote​:

On Tue Dec 29 03​:14​:18 2009, masak wrote​:

\ mberends​: I made great strides with GGE yesterday on the bus. \ \o/ \ the funniest things to implement are things marked TODO in PGE. :) \ rakudo​: say "foo" ~~ /\<[d..b]>? foo/ \ rakudo 8dc189​: foo␤ \ GGE dies on the reverse range in the enum char class. \ ooh! * masak submits rakudobug \ :P \ ng​: say "foo" ~~ /\<[d..b]>? foo/ \ ng 06c947​: foo␤ \ heh.

Dies now​:

say "foo" ~~ /\<[d..b]>? foo/ Illegal reversed character range in regex​: d..b at line 1, near ">? foo/\n"

Tagging testneeded.

/jnthn

19​:27 \<+dalek> roast​: 6a03ec5 | diakopter++ | S05-mass/rx.t​: 19​:27 \<+dalek> roast​: test RT #​71702. resolves ticket 19​:27 \<+dalek> roast​: review​: https://github.com/perl6/roast/commit/6a03ec52c3

p6rt commented 12 years ago

@diakopter - Status changed from 'open' to 'resolved'