The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use Test::More;

plan tests => 4;


use Regexp::Grammars;

my $grammar_implicit_ws = qr{
    <foo (arg => 42)>
    <rule:  foo>  foo bar  <param=(?{ $ARG{arg} })>
};

my $grammar_explicit_ws = qr{
    <foo (arg => 42)>
    <rule:  foo>  foo bar  <param=(?{ $ARG{arg} })>
    <token: ws>   \s*
};

ok 'foo bar' =~ $grammar_implicit_ws => 'Implicit grammar matched';
is $/{foo}{param}, 42                => 'Implicit grammar remembered param';

ok 'foo bar' =~ $grammar_explicit_ws => 'Explicit grammar matched';
is $/{foo}{param}, 42                => 'Explicit grammar remembered param';