Skip Menu |

This queue is for tickets about the Text-MicroMason CPAN distribution.

Report information
The Basics
Id: 18435
Status: resolved
Priority: 0/
Queue: Text-MicroMason

People
Owner: FERRENCY [...] cpan.org
Requestors: Dan [...] DWright.Org
Cc: alan [...] pair.com
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.992
Fixed in: (no value)



CC: alan [...] pair.com
Subject: Recent filter feature breaks expresions that use logical or: '||'
The recent addition to Text::MicroMason, which permits filters to be added to the end of <% %> blocks, has caused expressions inside templates such as this to break: <% $foo || 0 %> The problem is that MicroMason is seeing the '| 0' at the end of the string and ignoring its context. I have attached a diff to the 33-filters.t test file, which demonstrates this failure condition. Also attached is a diff for Text::MicroMason::Filters, which I believe corrects this bug.
Subject: 33-filters.t.diff
14a15,23 > # Test an expression inside a template using logical or. > > { > my $src = q(Var is <% $ARGS{foo} || 0 %>); > > $m->execute( text => $src ); > } > > ######################################################################
Subject: Filters.pm.diff
34c34 < my $filt_flags = ($token =~ s/\|\s*(\w+(?:[\s\,]+\w+)*)\s*\z//) ? $1 : ''; --- > my $filt_flags = ($token =~ s/[^\|]\|\s*(\w+(?:[\s\,]+\w+)*)\s*\z//) ? $1 : '';
This should be fixed in developer version 1.993_01. Please respond if you have any other problems.