View difference between Paste ID: DC9HNiHy and AdSuGJ0F
SHOW: | | - or go back to the newest paste.
1
my $input = '(((';
2
3
grammar Test {
4
    token TOP {
5
        ^<down>*$
6
    }
7
8
    token down {
9
        ^\($
10
    }
11
}
12
13
class TestActions {
14
    method TOP ($/) {
15-
        $/.make($<down>.map({.made}));
15+
         make @<down>>>.ast;
16
    }
17
    method down ($/) {
18-
        $/.make(1);
18+
        make 1;
19
    }
20
}
21
22
my $actions = TestActions.new;
23
my $res = Test.parse($input, :$actions);
24
say $res.made;