[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Jul 28 14:21:42 EDT 2004


User:      heins
Date:      2004-07-28 18:21:42 GMT
Modified:  lib/Vend Interpolate.pm
Log:
* Fix incompatibility in new "[if ..]" stuff. Retrieves the old behavior
  of

	 [value name=testval set=1]
	 [if value testval == "1"]
		 yes!
	 [else]
		 no!
	 [/else]
	 [/if]

  Ugh. In any case, we now strip quotelike-operators from all
  incoming compare operands.

  The reason this would work before was that it was evaled by
  Perl.

  It passes all regression tests, though I think there are some
  new border cases that will get us in the other direction.

Revision  Changes    Path
2.219     +5 -19     interchange/lib/Vend/Interpolate.pm


rev 2.219, prev_rev 2.218
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.218
retrieving revision 2.219
diff -u -r2.218 -r2.219
--- Interpolate.pm	24 Jul 2004 17:34:32 -0000	2.218
+++ Interpolate.pm	28 Jul 2004 18:21:41 -0000	2.219
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.218 2004/07/24 17:34:32 mheins Exp $
+# $Id: Interpolate.pm,v 2.219 2004/07/28 18:21:41 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.218 $, 10);
+$VERSION = substr(q$Revision: 2.219 $, 10);
 
 @EXPORT = qw (
 
@@ -1352,29 +1352,15 @@
 		$noop = 1;
 		$newcomp = $comp;
 		undef $comp;
+		$newcomp =~ s/^(["'])(.*)\1$/$2/s or
+			$newcomp =~ s/^qq?([{(])(.*)[})]$/$2/s or
+				$newcomp =~ s/^qq?(\S)(.*)\1$/$2/s;
 	}
 
 	local($^W) = 0;
 	undef $@;
 #::logDebug("cond: base=$base term=$term op=$operator comp=$comp newcomp=$newcomp nooop=$noop\n");
 #::logDebug (($reverse ? '!' : '') . "cond: base=$base term=$term op=$operator comp=$comp");
-	my %stringop = ( qw! eq 1 ne 1 gt 1 lt 1! );
-
-	if(defined $stringop{$operator}) {
-		if(! $noop) {
-			$comp =~ /^(["']).*\1$/ or
-			$comp =~ /^qq?([{(]).*[})]$/ or
-			$comp =~ /^qq?(\S).*\1$/ or
-			(index ($comp, '}') == -1 and $comp = 'q{' . $comp . '}')
-				or
-			(index ($comp, '!') == -1 and $comp = 'q!' . $comp . '!')
-		}
-	    else {
-			$newcomp =~ s/^(["'])(.*)\1$/$2/s or
-				$newcomp =~ s/^qq?([{(])(.*)[})]$/$2/s or
-					$newcomp =~ s/^qq?(\S)(.*)\1$/$2/s;
-		}
-	}
 
 #::logDebug ("cond: base=$base term=$term op=$operator comp=$comp\n");
 








More information about the interchange-cvs mailing list