Skip to content

Instantly share code, notes, and snippets.

Created December 10, 2016 00:37
Show Gist options
  • Save anonymous/516419b49436856c2b11aec92ec5acae to your computer and use it in GitHub Desktop.
Save anonymous/516419b49436856c2b11aec92ec5acae to your computer and use it in GitHub Desktop.
use v6;
grammar JavascriptFunc {
token TOP { \s* <InsertFunc> .+ }
token InsertFunc { 'insertNewLines' }
}
#my token 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