r28457 - in /branches/upstream/libhtml-template-pro-perl/current: Changes META.yml Pro.xs lib/HTML/Template/PerlInterface.pod lib/HTML/Template/Pro.pm perl-HTML-Template-Pro.spec procore.c procore.h pstring.h

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Dec 21 22:10:39 UTC 2008


Author: gregoa
Date: Sun Dec 21 22:10:36 2008
New Revision: 28457

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28457
Log:
[svn-upgrade] Integrating new upstream version, libhtml-template-pro-perl (0.72)

Modified:
    branches/upstream/libhtml-template-pro-perl/current/Changes
    branches/upstream/libhtml-template-pro-perl/current/META.yml
    branches/upstream/libhtml-template-pro-perl/current/Pro.xs
    branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod
    branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
    branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
    branches/upstream/libhtml-template-pro-perl/current/procore.c
    branches/upstream/libhtml-template-pro-perl/current/procore.h
    branches/upstream/libhtml-template-pro-perl/current/pstring.h

Modified: branches/upstream/libhtml-template-pro-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Changes?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Changes (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Changes Sun Dec 21 22:10:36 2008
@@ -153,3 +153,9 @@
 0.71 Sat Aug 16 15:05:01 EEST 2008
 	- fixed evaluation of variables in 'if' even in shadow context
 	- fixed misconfig on Darvin (CPAN #38013)
+
+0.72 Thu Dec 18 21:22:45 EET 2008
+	- added support of path through variable scope 
+	(by Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>)
+
+

Modified: branches/upstream/libhtml-template-pro-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/META.yml?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/META.yml (original)
+++ branches/upstream/libhtml-template-pro-perl/current/META.yml Sun Dec 21 22:10:36 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                HTML-Template-Pro
-version:             0.71
+version:             0.72
 abstract:            Perl/XS module to use HTML Templates from CGI scripts
 license:             ~
 generated_by:        ExtUtils::MakeMaker version 6.32

Modified: branches/upstream/libhtml-template-pro-perl/current/Pro.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Pro.xs?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Pro.xs (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Pro.xs Sun Dec 21 22:10:36 2008
@@ -396,6 +396,7 @@
   param->debug=get_integer_from_hash(SelfHash,"debug");
   param->loop_context_vars=get_integer_from_hash(SelfHash,"loop_context_vars");
   param->case_sensitive=get_integer_from_hash(SelfHash,"case_sensitive");
+  param->path_like_variable_scope=get_integer_from_hash(SelfHash,"path_like_variable_scope");
   /* still unsupported */
   param->strict=get_integer_from_hash(SelfHash,"strict");
   param->die_on_bad_params=get_integer_from_hash(SelfHash,"die_on_bad_params");

Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/PerlInterface.pod Sun Dec 21 22:10:36 2008
@@ -442,6 +442,25 @@
 B<NOTE>: C<global_vars> is not C<global_loops> (which does not exist).
 That means that loops you declare at one scope are not available
 inside other loops even when C<global_vars> is on.
+
+=item *
+
+path_like_variable_scope - this option switches on a Shigeki Morimoto 
+extension to HTML::Template::Pro that allows access to variables that
+are outside the current loop scope using path-like expressions.
+
+Example:
+{{{
+<TMPL_LOOP NAME=class>
+  <TMPL_LOOP NAME=person>
+    <TMPL_VAR NAME="../teacher_name">  <!-- access to class.teacher_name -->
+    <TMPL_VAR NAME="name">
+    <TMPL_VAR NAME="age">
+    <TMPL_VAR NAME="age">
+    <TMPL_VAR NAME="/top_level_value"> <!-- access to top level value -->
+  </TMPL_LOOP>
+</TMPL_LOOP>
+}}}
 
 =item *
 

Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm Sun Dec 21 22:10:36 2008
@@ -9,7 +9,7 @@
 use vars qw($VERSION @ISA);
 @ISA = qw(DynaLoader);
 
-$VERSION = '0.71';
+$VERSION = '0.72';
 
 bootstrap HTML::Template::Pro $VERSION;
 

Modified: branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec (original)
+++ branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec Sun Dec 21 22:10:36 2008
@@ -6,7 +6,7 @@
 %define module HTML-Template-Pro
 
 Name: perl-%module
-Version: 0.71
+Version: 0.72
 Release: alt1
 
 Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
 %perl_vendor_man3dir/*
 
 %changelog
+* Thu Dec 18 2008 Igor Vlasenko <viy at altlinux.ru> 0.72-alt1
+- new version; see Changes
+
 * Sat Aug 16 2008 Igor Vlasenko <viy at altlinux.ru> 0.71-alt1
 - new version; see Changes
 

Modified: branches/upstream/libhtml-template-pro-perl/current/procore.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/procore.c?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.c Sun Dec 21 22:10:36 2008
@@ -278,8 +278,34 @@
 static
 ABSTRACT_VALUE* walk_through_nested_loops (struct tmplpro_state *state, PSTRING name) {
   int PrevHash;
-  struct ProLoopState* currentScope = getCurrentScope(&state->param->var_scope_stack);
-  ABSTRACT_VALUE* valptr= state->param->getAbstractValFuncPtr(currentScope->param_HV, name);
+  struct ProLoopState* currentScope;
+  ABSTRACT_VALUE* valptr;
+  /* Shigeki Morimoto path_like_variable_scope extension */
+  if (state->param->path_like_variable_scope) {
+    if(*(name.begin) == '/' || strncmp(name.begin, "../", 3) == 0){
+      PSTRING tmp_name;
+      int GoalHash;
+      if(*(name.begin) == '/'){
+	tmp_name.begin   = name.begin+1; // skip '/'
+	tmp_name.endnext = name.endnext;
+	GoalHash = 0;
+      }else{
+	tmp_name.begin   = name.begin;
+	tmp_name.endnext = name.endnext;
+	GoalHash = curScopeLevel(&state->param->var_scope_stack);
+	while(strncmp(tmp_name.begin, "../", 3) == 0){
+	  tmp_name.begin   = tmp_name.begin + 3; // skip '../'
+	  GoalHash --;
+	}
+      }
+      valptr = state->param->getAbstractValFuncPtr(getScope(&state->param->var_scope_stack, GoalHash)->param_HV, tmp_name);
+      return valptr;
+    }
+  }
+  /* end Shigeki Morimoto path_like_variable_scope extension */
+
+  currentScope = getCurrentScope(&state->param->var_scope_stack);
+  valptr= state->param->getAbstractValFuncPtr(currentScope->param_HV, name);
   if ((0==state->param->global_vars) || (valptr)) return valptr;
   PrevHash=curScopeLevel(&state->param->var_scope_stack)-1;
   while (PrevHash>=0) {

Modified: branches/upstream/libhtml-template-pro-perl/current/procore.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/procore.h?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.h Sun Dec 21 22:10:36 2008
@@ -91,10 +91,10 @@
   const char* filename; /* template file */
   PSTRING scalarref; /* memory area */
   /* currently used in Perl code */
-  /* int search_path_on_include; */
+  /* flag search_path_on_include; */
   /* still unsupported  */
   flag die_on_bad_params;
-  /* int vanguard_compatibility_mode; */
+  /* flag vanguard_compatibility_mode; */
   /* hooks to perl or other container */
   /* HTML::Template hooks */
   writerfunc WriterFuncPtr;
@@ -119,6 +119,7 @@
   is_expr_userfnc_func   IsExprUserfncFuncPtr;
   void* ExprFuncHash;
   void* ExprFuncArglist;
+  flag path_like_variable_scope;
   /* private */
   int cur_includes; /* internal counter of include depth */
   const char* selfpath; /* file that has included this file, or empty string */

Modified: branches/upstream/libhtml-template-pro-perl/current/pstring.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/pstring.h?rev=28457&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/pstring.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/pstring.h Sun Dec 21 22:10:36 2008
@@ -9,7 +9,7 @@
 #ifndef _PSTRING_H
 #define _PSTRING_H	1
 
-#include<pbuffer.h>
+#include "pbuffer.h"
 
 typedef struct PSTRING {
   char* begin;




More information about the Pkg-perl-cvs-commits mailing list