[interchange-cvs] interchange - kwalsh modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Sep 17 01:37:31 EDT 2007


User:      kwalsh
Date:      2007-09-17 05:37:31 GMT
Modified:  .        WHATSNEW-5.5
Modified:  lib/Vend Interpolate.pm
Log:
    * Created a new [PREFIX-include] loop sub-tag.  This works just like
      the [include] tag, except that it allows other [PREFIX-*] sub-tags
      to be parsed from within the included file.

      Note: Files included with [PREFIX-include] cannot contain further
      [PREFIX-include] sub-tags.  This could be easily created (respecting
      the "include_depth" Limit etc.) but I felt that that was an
      unnecessary overhead.

Revision  Changes    Path
1.65      +9 -0      interchange/WHATSNEW-5.5


rev 1.65, prev_rev 1.64
Index: WHATSNEW-5.5
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.5,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- WHATSNEW-5.5	14 Sep 2007 16:38:45 -0000	1.64
+++ WHATSNEW-5.5	17 Sep 2007 05:37:30 -0000	1.65
@@ -27,6 +27,15 @@
   The idea is that you might have an "on hand" quantity and an "on order"
   quantity that you want to consider when allowing orders.
 
+* Created a new [PREFIX-include] loop sub-tag.  This works just like the
+  [include] tag, except that it allows other [PREFIX-*] sub-tags to be
+  parsed from within the included file.
+  
+  Note: Files included with [PREFIX-include] cannot contain further
+  [PREFIX-include] sub-tags.  This could be easily created (respecting
+  the "include_depth" Limit etc.) but I felt that that was an unnecessary
+  overhead.
+
 
 Interchange 5.5.1 released on 2007-08-21.
 



2.285     +17 -2     interchange/lib/Vend/Interpolate.pm


rev 2.285, prev_rev 2.284
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.284
retrieving revision 2.285
diff -u -r2.284 -r2.285
--- Interpolate.pm	20 Aug 2007 23:57:34 -0000	2.284
+++ Interpolate.pm	17 Sep 2007 05:37:31 -0000	2.285
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.284 2007/08/20 23:57:34 kwalsh Exp $
+# $Id: Interpolate.pm,v 2.285 2007/09/17 05:37:31 kwalsh Exp $
 #
 # Copyright (C) 2002-2007 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.284 $, 10);
+$VERSION = substr(q$Revision: 2.285 $, 10);
 
 @EXPORT = qw (
 
@@ -307,6 +307,7 @@
 my $Some = '[\000-\377]*?';
 my $Codere = '[-\w#/.]+';
 my $Coderex = '[-\w:#=/.%]+';
+my $Filef = '(?:%20|\s)+([^]]+)';
 my $Mandx = '\s+([-\w:#=/.%]+)';
 my $Mandf = '(?:%20|\s)+([-\w#/.]+)';
 my $Spacef = '(?:%20|\s)+';
@@ -373,6 +374,7 @@
 		_field
 		_filter
 		_header_param
+		_include
 		_increment
 		_last
 		_line
@@ -467,6 +469,7 @@
 	'_field_if_wo'	=> qr($T{_field}$Spacef(!?)\s*($Codere$Optr)\]),
 	'_field'		=> qr($T{_field}$Mandf\]),
 	'_common'		=> qr($T{_common}$Mandf\]),
+	'_include'		=> qr($T{_include}$Filef\]),
 	'_increment'	=> qr($T{_increment}\]),
 	'_last'			=> qr($T{_last}\]\s*($Some)\s*),
 	'_line'			=> qr($T{_line}$Opt\]),
@@ -4064,6 +4067,18 @@
 	my ($run, $row, $code, $return);
 my $once = 0;
 #::logDebug("iterating array $i to $end. count=$count opt_select=$opt_select ary=" . uneval($ary));
+
+	$text =~ s{
+		$B$QR{_include}
+	}{
+		my $filename = $1;
+
+		$Data_cache{"/$filename"} or do {
+		    my $content = Vend::Util::readfile($filename);
+		    vars_and_comments(\$content);
+		    $Data_cache{"/$filename"} = $content;
+		};
+	}igex;
 
 	if($text =~ m/^$B$QR{_line}\s*$/is) {
 		my $i = $1 || 0;








More information about the interchange-cvs mailing list