Skip to content

Commit e5a3ea2

Browse files
committed
Document sub form of make()
1 parent 4d94829 commit e5a3ea2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Type/Match.pod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,18 @@ Returns the part of the original string following the match.
7777
=head2 method make
7878
7979
method make(Match:D: Mu $ast)
80+
sub make(Mu $ast)
8081
8182
Sets the AST to C<$ast>, and returns it.
8283
8384
This is just a little sugar for C<$/.made = $ast> which is a very common
8485
operation in actions. C<$ast> may be anything that makes sense for the
8586
use case. It's typically some tree node.
8687
88+
The sub form operates on the current C<$/>, which can be a convenient shortcut:
89+
90+
method my-action ($/) {
91+
make "foo: $/";
92+
}
93+
8794
=end pod

0 commit comments

Comments
 (0)