#!/home/rir/rakudo/parrot_install/bin/perl6 grammar OP { token TOP { + } token op { | | } token cop { # constrained
+ } token sop { # string
} token bop { # bool } token long { \w+ } token short { \w } token char { # XXX Rename flag. Eliminate '_'. \w } rule sep { ':' } rule div { '/' } } my $s = 'a:aaa b:bbb/ c:ccccc/def'; my $match = OP.parse($s); die "failed" unless $match; say '$match: ', $match; say '$match.from: ', $match.from, ' $match.to: ', $match.to; say '$match.chars: ', $match.chars; say '$match.orig: ', $match.orig; say '$match.Str: ', $match.Str; say '$match.ast: ', $match.ast; say '$match.caps: is not found'; say '$match.pos: is not found'; my @array = $match; say '@array = $match; then @array: ['; for @array -> $i { say $i ; } say "]";