summaryrefslogtreecommitdiffstats
path: root/t/lib/My/Parser.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/lib/My/Parser.pm')
-rw-r--r--t/lib/My/Parser.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/lib/My/Parser.pm b/t/lib/My/Parser.pm
new file mode 100644
index 0000000..d8ef95d
--- /dev/null
+++ b/t/lib/My/Parser.pm
@@ -0,0 +1,28 @@
+package My::Parser;
+use Exporter 'import';
+our @EXPORT = ('foo', 'bar');
+
+use Parse::Keyword {
+ foo => \&parse_foo,
+ bar => \&parse_bar,
+};
+
+our $got_code;
+
+sub foo { 1 }
+sub parse_foo {
+ lex_read_space;
+ my $code = parse_block;
+ $got_code = $code ? 1 : 0;
+ return sub {};
+}
+
+sub bar { 1 }
+sub parse_bar {
+ lex_read_space;
+ my $code = eval { parse_block };
+ $got_code = $code ? 1 : 0;
+ return sub {};
+}
+
+1;