Last active
December 18, 2015 21:29
-
-
Save samuraisam/5847807 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
use Hello; | |
thingy(); |
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
use PB 'omg.proto'; |
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
use PB::Grammar; | |
use PB::Actions; | |
module PB; | |
sub parse-idl-str($protofile) is export { | |
my $actions = PB::Actions.new(); | |
my $result; | |
die "unable to parse file" | |
unless $result = PB::Grammar.parse($protofile, :actions($actions)); | |
$result.ast; | |
} | |
sub parse-idl-file($filename) is export { | |
my $protofile = slurp(open $filename); | |
parse-idl-str($protofile); | |
} | |
our sub EXPORT(*@args) { | |
say "args: ", @args.perl; | |
EXPORT_SYMBOL('&thingy', [<ALL DEFAULT>], sub { say "hello" }); | |
return {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment