Create a gist now

Instantly share code, notes, and snippets.

@smls /grammar-test.pl6 Secret
Created Aug 20, 2016

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