Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement