#!/usr/bin/perl
#!/usr/bin/perl

my $input = '(((';

grammar Test {
    token TOP {
        <down>*
    }

    token down {
        ^\($
    }
}

class TestActions {
    method TOP ($/) {
         make @<down>>>.ast;
    }
    method down ($/) {
        make 1;
    }
}

my $actions = TestActions.new;
my $res = Test.parse($input, :$actions);
say $res.made;
