Permalink
Browse files

Applied a patch from Norbert Buchmüller to prevent the #line markers

  from being whitespaced away from the first column.
  https://rt.cpan.org/Ticket/Display.html?id=46269


git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@1218 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent fb36f90 commit 2cb5f1c2895fdc1ba16e77633106fe8d92f15efc @abw committed May 21, 2009
Showing with 51 additions and 20 deletions.
  1. +5 −1 Changes
  2. +1 −1 lib/Template/Document.pm
  3. +16 −16 lib/Template/Manual/Credits.pod
  4. +6 −2 t/compile1.t
  5. +5 −0 t/compile2.t
  6. +9 −0 t/compile4.t
  7. +9 −0 t/compile5.t
View
@@ -11,7 +11,7 @@
#========================================================================
#-----------------------------------------------------------------------
-# Version 2.20_4 (2.21 candidate) - 20th May 2009
+# Version 2.20_4 (2.21 candidate) - 21st May 2009
#------------------------------------------------------------------------
* Added the even(), odd() and parity() methods to Template::Iterator to
@@ -22,6 +22,10 @@
* Replaced a whle bunch of UNIVERSAL::isa() calls with blessed/isa
+* Applied a patch from Norbert Buchm�ller to prevent the #line markers
+ from being whitespaced away from the first column.
+ https://rt.cpan.org/Ticket/Display.html?id=46269
+
#-----------------------------------------------------------------------
# Version 2.20_3 (2.21 candidate) - 20th May 2009
View
@@ -231,7 +231,7 @@ sub as_perl {
my ($class, $content) = @_;
my ($block, $defblocks, $metadata) = @$content{ qw( BLOCK DEFBLOCKS METADATA ) };
- $block =~ s/\n/\n /g;
+ $block =~ s/\n(?!#line)/\n /g;
$block =~ s/\s+$//;
$defblocks = join('', map {
@@ -75,22 +75,22 @@ Please let me know if you think anyone is missing from this list.
Chuck Adams, Stephen Adkins, Ivan Adzhubey, Mark Anderson, Bradley Baetz,
Thierry-Michel Barral, Craig Barratt, Stas Bekman, Robin Berjon, Tony Bowden,
-Neil Bowers, Leon Brocard, Lyle Brooks, Dave Cash, Piers Cawley, Darren
-Chamberlain, Timmy Chan, Eric Cholet, Nik Clayton, Tosh Cooey, Dave Cross,
-Chris Dean, Francois Desarmenien, Horst Dumcke, Mark Fowler, Michael Fowler,
-Kenny Gatdula, Axel Gerstmair, Dylan William Hardison, Perrin Harkins, Bryce
-Harrington, Dave Hodgkinson, Lubomir Host, Dave Howorth, Harald Joerg, Colin
-Johnson, Adam Kennedy, Vivek Khera, Alexey A. Kiritchun, Rafael Kitover, Ivan
-Kurmanov, Hans von Lengerke, Jonas Liljegren, Simon Luff, Andy Maas, Paul
-Makepeace, Gervase Markham, Sergey Martynoff, Simon Matthews, Robert McArthur,
-Craig McLane, Myk Melez, Eugene Miretskiy, Tatsuhiko Miyagawa, Bill Moseley,
-Keith G. Murphy, Chris Nandor, Breno G. de Oliveira, Leslie Michael Orchard,
-Paul Orrock, Jonathon Padfield, Steve Peters, Briac PilprE<eacute>, Yuri
-Pimenov, Martin Portman, Slaven Rezic, Jess Robinson, Josh Rosenbaum,
-Christian Schaffner, Mike Schilli, Randal L. Schwartz, Paul Seamons, Paul
-Sharpe, Ville SkyttE<auml>, Barrie Slaymaker, Doug Steinwand, Michael Stevens,
-Autrijus Tang, Drew Taylor, Swen Thuemmler, Richard Tietjen, Ben Tilly, Stathy
-G. Touloumis, Jim Vaughan, Simon Wilcox, Chris Winters
+Neil Bowers, Leon Brocard, Lyle Brooks, Norbert Buchmüller, Dave Cash, Piers
+Cawley, Darren Chamberlain, Timmy Chan, Eric Cholet, Nik Clayton, Tosh Cooey,
+Dave Cross, Chris Dean, Francois Desarmenien, Horst Dumcke, Mark Fowler,
+Michael Fowler, Kenny Gatdula, Axel Gerstmair, Dylan William Hardison, Perrin
+Harkins, Bryce Harrington, Dave Hodgkinson, Lubomir Host, Dave Howorth, Harald
+Joerg, Colin Johnson, Adam Kennedy, Vivek Khera, Alexey A. Kiritchun, Rafael
+Kitover, Ivan Kurmanov, Hans von Lengerke, Jonas Liljegren, Simon Luff, Andy
+Maas, Paul Makepeace, Gervase Markham, Sergey Martynoff, Simon Matthews,
+Robert McArthur, Craig McLane, Myk Melez, Eugene Miretskiy, Tatsuhiko
+Miyagawa, Bill Moseley, Keith G. Murphy, Chris Nandor, Breno G. de Oliveira,
+Leslie Michael Orchard, Paul Orrock, Jonathon Padfield, Steve Peters, Briac
+PilprE<eacute>, Yuri Pimenov, Martin Portman, Slaven Rezic, Jess Robinson,
+Josh Rosenbaum, Christian Schaffner, Mike Schilli, Randal L. Schwartz, Paul
+Seamons, Paul Sharpe, Ville SkyttE<auml>, Barrie Slaymaker, Doug Steinwand,
+Michael Stevens, Autrijus Tang, Drew Taylor, Swen Thuemmler, Richard Tietjen,
+Ben Tilly, Stathy G. Touloumis, Jim Vaughan, Simon Wilcox, Chris Winters
=cut
View
@@ -35,7 +35,7 @@ my $ttcfg = {
};
# delete any existing files
-foreach my $f ( "$dir/foo.ttc", "$dir/complex.ttc" ) {
+foreach my $f ( "$dir/foo.ttc", "$dir/complex.ttc", "$dir/divisionbyzero.ttc" ) {
ok( unlink($f) ) if -f $f;
}
@@ -76,4 +76,8 @@ This is the footer, author: abw, version: 3.14
This is the baz file, a:
-
+-- test --
+[%- # first pass, writes the compiled code to cache -%]
+[% INCLUDE divisionbyzero -%]
+-- expect --
+undef error - Illegal division by zero at t/test/src/divisionbyzero line 1.
View
@@ -90,3 +90,8 @@ This is the footer, author: billg, version: 6.66
- 3 - 2 - 1
+-- test --
+[%- # second pass, reads the compiled code from cache -%]
+[% INCLUDE divisionbyzero -%]
+-- expect --
+undef error - Illegal division by zero at t/test/src/divisionbyzero line 1, <DATA> chunk 1.
View
@@ -38,6 +38,9 @@ my $ttcfg = {
COMPILE_DIR => $cdir,
COMPILE_EXT => '.ttc',
ABSOLUTE => 1,
+ CONSTANTS => {
+ dir => $dir,
+ },
};
# delete any existing cache files
@@ -80,3 +83,9 @@ The word is 'wibble'
[% INCLUDE "$root/src/blam" %]
-- expect --
This is the blam file
+-- test --
+[%- # first pass, writes the compiled code to cache -%]
+[% INCLUDE divisionbyzero -%]
+-- expect --
+-- process --
+undef error - Illegal division by zero at [% constants.dir %]/src/divisionbyzero line 1.
View
@@ -34,6 +34,9 @@ my $ttcfg = {
COMPILE_DIR => "$cdir/", # note trailing slash - should be handled OK
COMPILE_EXT => '.ttc',
ABSOLUTE => 1,
+ CONSTANTS => {
+ dir => $dir,
+ },
};
# check compiled template files exist
@@ -108,3 +111,9 @@ This is the footer, author: billg, version: 6.66
[% INCLUDE "$root/src/blam" %]
-- expect --
This is the wam-bam file
+-- test --
+[%- # second pass, reads the compiled code from cache -%]
+[% INCLUDE divisionbyzero -%]
+-- expect --
+-- process --
+undef error - Illegal division by zero at [% constants.dir %]/src/divisionbyzero line 1, <DATA> chunk 1.

0 comments on commit 2cb5f1c

Please sign in to comment.