#!/usr/bin/perl6
sub MAIN {
grammar TcronGrammar {
token TOP { \n* <crontask>+ }
token crontask { <recursive>? <path> }
token recursive { \*\s+ }
token path { .* }
};
class TcronGrammar-actions {
method TOP ($/) {
make { path => $<path>.Str,
recursive => $<recursive>.made.Bool}
}
method recursive($/) { make $/.trim.Str eq '*'; }
}
my $conf-match = TcronGrammar.parse("* /tmp/sdl/SDL2-2.0.5\n/tmp/sdl/SDL2-2.0.5"); #, actions => TcronGrammar-actions.new).made;
say $conf-match;
}
IyEvdXNyL2Jpbi9wZXJsNgpzdWIgTUFJTiB7CiAgICBncmFtbWFyIFRjcm9uR3JhbW1hciB7CiAgICAgICAgdG9rZW4gVE9QICAgICAgIHsgXG4qIDxjcm9udGFzaz4rIH0KICAgICAgICB0b2tlbiBjcm9udGFzayAgeyA8cmVjdXJzaXZlPj8gPHBhdGg+IH0KICAgICAgICB0b2tlbiByZWN1cnNpdmUgeyBcKlxzKyB9CiAgICAgICAgdG9rZW4gcGF0aCAgICAgIHsgLiogfQogICAgfTsKCiAgICBjbGFzcyBUY3JvbkdyYW1tYXItYWN0aW9ucyB7CiAgICAgICAgbWV0aG9kIFRPUCAoJC8pIHsKICAgICAgICAgICAgbWFrZSB7IHBhdGggICAgICA9PiAkPHBhdGg+LlN0ciwKICAgICAgICAgICAgICAgICAgIHJlY3Vyc2l2ZSA9PiAkPHJlY3Vyc2l2ZT4ubWFkZS5Cb29sfQogICAgICAgIH0KCiAgICAgICAgbWV0aG9kIHJlY3Vyc2l2ZSgkLykgeyBtYWtlICQvLnRyaW0uU3RyIGVxICcqJzsgfQogICAgfQoKICAgIG15ICRjb25mLW1hdGNoID0gVGNyb25HcmFtbWFyLnBhcnNlKCIqIC90bXAvc2RsL1NETDItMi4wLjVcbi90bXAvc2RsL1NETDItMi4wLjUiKTsgIywgYWN0aW9ucyA9PiBUY3JvbkdyYW1tYXItYWN0aW9ucy5uZXcpLm1hZGU7CiAgICBzYXkgJGNvbmYtbWF0Y2g7Cn0K