Skip to content

Commit 3f08f8f

Browse files
committed
improve message for listop TTIAR
1 parent 937241d commit 3f08f8f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

STD.pm6

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,7 +3268,7 @@ grammar P6 is STD {
32683268
]
32693269
']' ['«'|<?>]
32703270
)
3271-
{ $op = $<s><op>; }
3271+
{ $op = $<s><op>; @*MEMOS[$¢.pos]<listop> = 1; }
32723272

32733273
<.can_meta($op, "reduce with")>
32743274

@@ -4027,7 +4027,8 @@ grammar P6 is STD {
40274027
# | :dba('argument list') '.(' ~ ')' <semiarglist>
40284028
| :dba('argument list') '(' ~ ')' <semiarglist>
40294029
| :dba('argument list') <.unsp> '(' ~ ')' <semiarglist>
4030-
| { $listopish = 1 } [<?before \s> <!{ $istype }> <.ws> <!infixstopper> <arglist>]?
4030+
| { $listopish = 1; @*MEMOS[$¢.pos]<listop> = 1; }
4031+
[<?before \s> <!{ $istype }> <.ws> <!infixstopper> <arglist>]?
40314032
]
40324033
$<invocant> = {$*INVOCANT_IS}
40334034

@@ -6055,6 +6056,9 @@ method panic (Str $s) {
60556056
if self.lineof($startpos) != self.lineof($endpos) {
60566057
$m ~~ s|Confused|Two terms in a row (previous line missing its semicolon?)|;
60576058
}
6059+
elsif @*MEMOS[$here.pos]<listop> {
6060+
$m ~~ s|Confused|Two terms in a row (listop with args requires whitespace or parens)|;
6061+
}
60586062
elsif @*MEMOS[$here.pos - 1]<baremeth> {
60596063
$m ~~ s|Confused|Two terms in a row (method call requires colon or parens to take arguments)|;
60606064
}

0 commit comments

Comments
 (0)