Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S03] update to current parsing reality (postfix after listop)
  • Loading branch information
moritz committed Apr 9, 2012
1 parent 392d905 commit 28401ee
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions S03-operators.pod
Expand Up @@ -15,7 +15,7 @@ Synopsis 3: Perl 6 Operators
Created: 8 Mar 2004

Last Modified: 9 Apr 2012
Version: 247
Version: 248

=head1 Overview

Expand Down Expand Up @@ -3066,35 +3066,33 @@ the return value of the listop.
foo.() # same as foo()()
foo++ # legal (if foo() is rw)

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

Examples:

say foo + 1; say(foo(+1));
say foo $x; say(foo($x));
say foo$x; ILLEGAL, need space or parens
say foo+1; ILLEGAL, need space or parens
say foo++; ILLEGAL, need parens

say foo($bar+1),$baz say(foo($bar+1), $baz);
say foo.($bar+1),$baz ILLEGAL, need space or parens
say foo.($bar+1),$baz say(foo().($bar+1), $baz);
say foo ($bar+1),$baz say(foo($bar+1, $baz));
say foo .($bar+1),$baz say(foo($_.($bar+1), $baz));

say foo[$bar+1],$baz ILLEGAL, need foo()[]
say foo.[$bar+1],$baz ILLEGAL, need foo().[]
say foo[$bar+1],$baz say((foo()[$bar+1]), $baz);
say foo.[$bar+1],$baz say((foo()[$bar+1]), $baz);
say foo [$bar+1],$baz say(foo([$bar+1], $baz));
say foo .[$bar+1],$baz say(foo($_.[$bar+1], $baz));

say foo{$bar+1},$baz ILLEGAL, need foo(){}
say foo.{$bar+1},$baz ILLEGAL, need foo().{}
say foo{$bar+1},$baz say((foo(){$bar+1}), $baz);
say foo.{$bar+1},$baz say((foo(){$bar+1}), $baz);
say foo {$bar+1},$baz say(foo({$bar+1}, $baz));
say foo .{$bar+1},$baz say(foo($_.{$bar+1}, $baz));

say foo<$bar+1>,$baz ILLEGAL, need foo()<>
say foo.<$bar+1>,$baz ILLEGAL, need foo().<>
say foo<$bar+1>,$baz say(foo()<$bar+1>, $baz);
say foo.<$bar+1>,$baz say(foo()<$bar+1>, $baz);
say foo <$bar+1>,$baz say(foo(<$bar+1>, $baz));
say foo .<$bar+1>,$baz say(foo($_.<$bar+1>, $baz));

Expand Down

0 comments on commit 28401ee

Please sign in to comment.