summaryrefslogtreecommitdiffstats
path: root/t/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-23 13:58:23 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-23 13:58:23 -0400
commitbff8a47c7872d34f41a22573dcf9cea0497c8ecc (patch)
tree868decc401a268a8c3bdd6cfa565ee391ee7b436 /t/lib
parent310ba62c846379ad914942e36b9111084a364899 (diff)
downloadparse-keyword-bff8a47c7872d34f41a22573dcf9cea0497c8ecc.tar.gz
parse-keyword-bff8a47c7872d34f41a22573dcf9cea0497c8ecc.zip
actually, don't throw an error
Diffstat (limited to 't/lib')
-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;