Skip to content

Instantly share code, notes, and snippets.

@softmoth
Created September 29, 2017 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softmoth/99ec805b291f10307aef62904b562bed to your computer and use it in GitHub Desktop.
Save softmoth/99ec805b291f10307aef62904b562bed to your computer and use it in GitHub Desktop.
Results of `.parse()` as an async Seq?
grammar G {
token TOP { <a-line>* }
token a-line { (\V*) \n }
}
class A {
method TOP($/) {
note "!TOP ", $/<a-line>».made.perl, $/;
}
method a-line($/) {
note "!A-LINE";
take ~$0;
make $/.pos;
}
}
for gather G.parse($*IN.slurp, :actions(A.new)) {
note "(($_))";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment