method make

Documentation for method make assembled from the following types:

class Match

From Match

(Match) method make

Defined as

method make(Match:D: Mu $payload)
sub make(Mu $payload)

Sets the .ast attribute, which will be retrieved using .made.

$/.make("your payload here");

That is, it stores an arbitrary payload into the Match object that can later be retrieved via .made method.

This is typically used in a grammar's actions class methods, where a piece of data is stored by one method and then later retrieved by another. It's up to you what data you store. It could be a tree node, result of a calculation, or a list of values.

The sub form operates on the current Match $/, which can be a convenient shortcut:

method my-action ($/{
    make "foo: $/";