Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #121266 show hints about obsolete y///, qr() and others
  • Loading branch information
FROGGS committed Jul 18, 2014
1 parent c63233a commit 27f20b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Perl6/Grammar.nqp
Expand Up @@ -3191,6 +3191,14 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
<.old_rx_mods>?
}

token quote:sym<y> {
<sym> »
# could be defined as a function or constant
<!{ $*W.is_lexical('&y') || $*W.is_lexical('y') }>
<!before '('> <?before \h*\W>
<.obs('y///','tr///')>
}

token old_rx_mods {
(<[ i g s m x c e ]>)
{
Expand Down
8 changes: 8 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -629,9 +629,17 @@ my class X::Undeclared::Symbols does X::Comp {
}
}
if %.unk_routines {
my $obs = {
y => "tr",
qr => "rx",
local => "temp (or dynamic var)",
new => "method call syntax",
foreach => "for",
}
$r ~= "Undeclared routine" ~ (%.unk_routines.elems == 1 ?? "" !! "s") ~ ":\n";
for %.unk_routines.sort(*.key) {
$r ~= " $_.key() &l($_.value)";
$r ~= " (in Perl 6 please use " ~ $obs{$_.key()} ~ " instead)" if $obs{$_.key()};
if +%.routine_suggestion{$_.key()} {
$r ~= ". " ~ s(%.routine_suggestion{$_.key()});
}
Expand Down

0 comments on commit 27f20b0

Please sign in to comment.