Skip to content

Instantly share code, notes, and snippets.

Created December 10, 2016 00:25
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 anonymous/60831794599431708de947de975139b8 to your computer and use it in GitHub Desktop.
Save anonymous/60831794599431708de947de975139b8 to your computer and use it in GitHub Desktop.
Program
use v6;
grammar JavascriptFunc {
rule TOP { <InsertFunc> }
rule InsertFunc { \s* 'insertNewLines' }
}
#my rule InsFunc { \s* 'insertNewLines' }
for dir(test => 'inputgrid.html') -> $file {
if ($file.f) {
convert($file);
}
}
sub convert(IO::Path $f) {
for $f.lines -> $line {
my $m = JavascriptFunc.parse($line);
say $m if $m;
#my $s = $line ~~ /<InsFunc>/;
#say $s if $s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment