Skip to content

Commit 28401ee

Browse files
committed
[S03] update to current parsing reality (postfix after listop)
1 parent 392d905 commit 28401ee

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

S03-operators.pod

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Synopsis 3: Perl 6 Operators
1515
Created: 8 Mar 2004
1616

1717
Last Modified: 9 Apr 2012
18-
Version: 247
18+
Version: 248
1919

2020
=head1 Overview
2121

@@ -3066,35 +3066,33 @@ the return value of the listop.
30663066
foo.() # same as foo()()
30673067
foo++ # legal (if foo() is rw)
30683068

3069-
If the next item after the list operator is either an infix operator
3070-
or a term, a syntax error is reported. [Conjecture: this may be relaxed in
3071-
non-strict mode.]
3069+
If the next item after the list operator is either an infix operator,
3070+
a syntax error is reported.
30723071

30733072
Examples:
30743073

30753074
say foo + 1; say(foo(+1));
30763075
say foo $x; say(foo($x));
30773076
say foo$x; ILLEGAL, need space or parens
30783077
say foo+1; ILLEGAL, need space or parens
3079-
say foo++; ILLEGAL, need parens
30803078

30813079
say foo($bar+1),$baz say(foo($bar+1), $baz);
3082-
say foo.($bar+1),$baz ILLEGAL, need space or parens
3080+
say foo.($bar+1),$baz say(foo().($bar+1), $baz);
30833081
say foo ($bar+1),$baz say(foo($bar+1, $baz));
30843082
say foo .($bar+1),$baz say(foo($_.($bar+1), $baz));
30853083

3086-
say foo[$bar+1],$baz ILLEGAL, need foo()[]
3087-
say foo.[$bar+1],$baz ILLEGAL, need foo().[]
3084+
say foo[$bar+1],$baz say((foo()[$bar+1]), $baz);
3085+
say foo.[$bar+1],$baz say((foo()[$bar+1]), $baz);
30883086
say foo [$bar+1],$baz say(foo([$bar+1], $baz));
30893087
say foo .[$bar+1],$baz say(foo($_.[$bar+1], $baz));
30903088

3091-
say foo{$bar+1},$baz ILLEGAL, need foo(){}
3092-
say foo.{$bar+1},$baz ILLEGAL, need foo().{}
3089+
say foo{$bar+1},$baz say((foo(){$bar+1}), $baz);
3090+
say foo.{$bar+1},$baz say((foo(){$bar+1}), $baz);
30933091
say foo {$bar+1},$baz say(foo({$bar+1}, $baz));
30943092
say foo .{$bar+1},$baz say(foo($_.{$bar+1}, $baz));
30953093

3096-
say foo<$bar+1>,$baz ILLEGAL, need foo()<>
3097-
say foo.<$bar+1>,$baz ILLEGAL, need foo().<>
3094+
say foo<$bar+1>,$baz say(foo()<$bar+1>, $baz);
3095+
say foo.<$bar+1>,$baz say(foo()<$bar+1>, $baz);
30983096
say foo <$bar+1>,$baz say(foo(<$bar+1>, $baz));
30993097
say foo .<$bar+1>,$baz say(foo($_.<$bar+1>, $baz));
31003098

0 commit comments

Comments
 (0)