@@ -1527,10 +1527,6 @@ grammar P6 is STD {
1527
1527
<xblock >
1528
1528
}
1529
1529
1530
- token statement_control :foreach {
1531
- <sym > <.obs (" 'foreach'" , " 'for'" )>
1532
- }
1533
-
1534
1530
token statement_control :given {
1535
1531
<sym > :s
1536
1532
<xblock >
@@ -2688,17 +2684,9 @@ grammar P6 is STD {
2688
2684
<!old_tr_mods >
2689
2685
}
2690
2686
2691
- token quote :y {
2692
- <sym > »
2693
- # could be defined as a function or constant
2694
- <!{ self . is_known(' &y' ) or self . is_known(' y' ) }>
2695
- <! before '(' > <? before \h * \W >
2696
- <.obs (' y///' ,' tr///' )>
2697
- }
2698
-
2699
2687
token old_rx_mods {
2700
2688
<! after \s >
2701
- (< i g s m x c e > + )
2689
+ (\w + )
2702
2690
{
2703
2691
given $0 . Str {
2704
2692
$ _ ~~ /i / and $¢. worryobs(' /i' ,' :i' );
@@ -2708,6 +2696,12 @@ grammar P6 is STD {
2708
2696
$ _ ~~ /x / and $¢. worryobs(' /x' ,' normal default whitespace' );
2709
2697
$ _ ~~ /c / and $¢. worryobs(' /c' ,' :c or :p' );
2710
2698
$ _ ~~ /e / and $¢. worryobs(' /e' ,' interpolated {...} or s{} = ... form' );
2699
+ $ _ ~~ /r / and $¢. worryobs(' /c' ,' .subst' );
2700
+ $ _ ~~ /a / and $¢. worryobs(' /a' ,' Unicode' );
2701
+ $ _ ~~ /d / and $¢. worryobs(' /d' ,' Unicode' );
2702
+ $ _ ~~ /l / and $¢. worryobs(' /l' ,' Unicode' );
2703
+ $ _ ~~ /u / and $¢. worryobs(' /l' ,' normal regex' );
2704
+ $ _ ~~ /p / and $¢. worryobs(' /c' ,' substr or /$<PREMATCH>=[...] <(...)> $<POSTMATCH>=[...]' );
2711
2705
$¢. obs(' suffix regex modifiers' ,' prefix adverbs' );
2712
2706
}
2713
2707
}
@@ -3103,11 +3097,6 @@ grammar P6 is STD {
3103
3097
<O (| % term )>
3104
3098
}
3105
3099
3106
- token term :sym <Object > {
3107
- <sym > » { }
3108
- <.obs (' Object' , ' Mu as the "most universal" object type' )>
3109
- }
3110
-
3111
3100
token term :sym <undef > {
3112
3101
<sym > » { }
3113
3102
[ <? before \h * '$/' >
@@ -5732,13 +5721,22 @@ method explain_mystery() {
5732
5721
$ m ~ = " Undeclared name" ~ (' s' x (@ tmp != 1 )) ~ " :\n " ;
5733
5722
for @ tmp {
5734
5723
$ m ~ = " \t '$ _ ' used at line " ~ % unk_types {$ _ }. <line > ~ " \n " ;
5724
+ $ m ~ = " \t (in Perl 6 please use Mu as the most universal type)\n " if $ _ eq ' Object' ;
5735
5725
}
5736
5726
}
5737
5727
if % unk_routines {
5738
5728
my @ tmp = sort keys (% unk_routines );
5739
5729
$ m ~ = " Undeclared routine" ~ (' s' x (@ tmp != 1 )) ~ " :\n " ;
5730
+ my $ obs = {
5731
+ y => " tr" ,
5732
+ qr => " rx" ,
5733
+ local => " temp (or dynamic var)" ,
5734
+ new => " method call syntax" ,
5735
+ foreach => " for" ,
5736
+ }
5740
5737
for @ tmp {
5741
5738
$ m ~ = " \t '$ _ ' used at line " ~ % unk_routines {$ _ }. <line > ~ " \n " ;
5739
+ $ m ~ = " \t (in Perl 6 please use " ~ $ obs {$ _ } ~ " instead)\n " if $ obs {$ _ };
5742
5740
}
5743
5741
}
5744
5742
self . sorry($ m ) if $ m ;
0 commit comments