my grammar Grammar
{
token TOP { <option>* %% \n }
proto token option { * }
token option:sym<database-path> { <sym> ‘=’ ( \N* ) }
token option:sym<invidious-mirror> { <sym> ‘=’ ( \N* ) }
}
my class Actions
{
method TOP($/) { make(%($<option>».made)) }
method option:sym<database-path>($/) { $<sym> => $0.IO }
method option:sym<invidious-mirror>($/) { $<sym> => ~$0 }
}
my $match := Grammar.parse(q:to/INPUT/, actions => Actions);
database-path=/var/lib/infobox.sqlite3
invidious-mirror=file:///home/r/infobox/t/testdata/invidious
INPUT
note $match.made.perl;