Created
November 8, 2014 07:01
-
-
Save anonymous/e6daa08077bbef203f1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> cat foo | |
grammar WHOLEFILE { | |
regex TOP { <marker> <inside> <marker> }; | |
regex marker { '{' | '}' }; | |
regex inside { <things>+ }; | |
regex things { \S+ | \s+ }; | |
}; | |
my $r = WHOLEFILE.parse( '{' ~ "\nsasdf daqwd\ndwesdd\ndadsd\ndssadw dwesad\n" ~ '}' ); | |
say $r; | |
> perl6 foo | |
「{ | |
sasdf daqwd | |
dwesdd | |
dadsd | |
dssadw dwesad | |
}」 | |
marker => 「{」 | |
inside => 「 | |
sasdf daqwd | |
dwesdd | |
dadsd | |
dssadw dwesad | |
」 | |
things => 「 | |
」 | |
things => 「sasdf」 | |
things => 「 」 | |
things => 「daqwd」 | |
things => 「 | |
」 | |
things => 「dwesdd」 | |
things => 「 | |
」 | |
things => 「dadsd」 | |
things => 「 | |
」 | |
things => 「dssadw」 | |
things => 「 」 | |
things => 「dwesad」 | |
things => 「 | |
」 | |
marker => 「}」 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment