diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-04 11:37:29 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-04 11:37:29 -0500 |
commit | f090ae8a745f8d17016033ae452e6383ba63a973 (patch) | |
tree | 7cb5561a1c008a5c6e420feb9289d955907754fb | |
parent | d28fe9e9d3799aa5eb32801d8fa511e2bbdc5c6f (diff) | |
download | text-handlebars-f090ae8a745f8d17016033ae452e6383ba63a973.tar.gz text-handlebars-f090ae8a745f8d17016033ae452e6383ba63a973.zip |
make XSLATE='dump=proto' work with my custom parser
-rw-r--r-- | lib/Text/Xslate/Syntax/Handlebars.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Text/Xslate/Syntax/Handlebars.pm b/lib/Text/Xslate/Syntax/Handlebars.pm index c857a47..3c5af87 100644 --- a/lib/Text/Xslate/Syntax/Handlebars.pm +++ b/lib/Text/Xslate/Syntax/Handlebars.pm @@ -2,10 +2,12 @@ package Text::Xslate::Syntax::Handlebars; use Any::Moose; use Carp 'confess'; -use Text::Xslate::Util qw($STRING neat p); +use Text::Xslate::Util qw($DEBUG $STRING neat p); extends 'Text::Xslate::Parser'; +use constant _DUMP_PROTO => scalar($DEBUG =~ /\b dump=proto \b/xmsi); + my $nl = qr/\x0d?\x0a/; sub _build_identity_pattern { qr/[A-Za-z_][A-Za-z0-9_?]*/ } @@ -181,6 +183,7 @@ sub preprocess { } } + print STDOUT $code, "\n" if _DUMP_PROTO; return $code; } |