Skip to content

Commit

Permalink
RakuAST: streamline old-rx-modifiers token
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 10, 2023
1 parent b5fcda9 commit daec779
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/Raku/Grammar.nqp
Expand Up @@ -3718,13 +3718,20 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
(<[ i g s m x c e ]>)
{
my $m := $/[0].Str;
if $m eq 'i' { $/.obs('/i',':i'); }
elsif $m eq 'g' { $/.obs('/g',':g'); }
elsif $m eq 'm' { $/.obs('/m','^^ and $$ anchors'); }
elsif $m eq 's' { $/.obs('/s','. or \N'); }
elsif $m eq 'x' { $/.obs('/x','normal default whitespace'); }
elsif $m eq 'c' { $/.obs('/c',':c or :p'); }
elsif $m eq 'e' { $/.obs('/e','interpolated {...} or s{} = ... form'); }
$/.obs("/$m", $m eq 'i'
?? ':i'
!! $m eq 'g'
?? ':g'
!! $m eq 'm'
?? '^^ and $$ anchors'
!! $m eq 's'
?? '. or \N'
!! $m eq 'x'
?? 'normal default whitespace'
!! $m eq 'c'
?? ':c or :p'
!! 'interpolated {...} or s{} = ... form' # $m eq 'e'
);
}
}
Expand Down

0 comments on commit daec779

Please sign in to comment.