Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
grammar G {
rule TOP { ^ <definition>* $ }
rule definition {
'block' '{' <line>+ '}'
}
rule line {
['line' ]+ % "&"
}
}
my $text = q<
block {
line
line & line
line
}
>;
say G.parse($text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment