use v6-alpha; use Test; plan 3; rule schedule { [ <talk> ]+ } token title { '<title>' <speaker> '' } regex ws { .*? } token talk { '' '' } token speaker { \w+ } =pod Use rules from a grammar. =cut if !eval('("a" ~~ /a/)') { skip_rest "skipped tests - rules support appears to be missing"; exit; } my $content = ' 8:30 Conferences for Beginners
Jim Brandt, brian d foy — 9:00 Opening Ceremonies
Josh McAdams — '; is($content ~~ m//, 'tr', 'read token from grammar namespace'); $content = 'Exactly aosihdas A aosidh B aosidh C aosidh D'; is($content ~~ m//, '<title>Exactly', 'match token'); is($content ~~ m//, $content, 'match rule', :todo);