From bff8a47c7872d34f41a22573dcf9cea0497c8ecc Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 23 Jul 2013 13:58:23 -0400 Subject: actually, don't throw an error --- t/lib/My/Parser.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/lib/My/Parser.pm (limited to 't/lib') 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; -- cgit v1.2.3-54-g00ecf