r39564 - in /trunk/libhtml-template-pro-perl: ./ debian/ lib/HTML/Template/ t/ templates-Pro/

ghostbar-guest at users.alioth.debian.org ghostbar-guest at users.alioth.debian.org
Thu Jul 9 18:45:39 UTC 2009


Author: ghostbar-guest
Date: Thu Jul  9 18:45:28 2009
New Revision: 39564

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39564
Log:
new upstream version

Added:
    trunk/libhtml-template-pro-perl/provalue.c
      - copied unchanged from r39563, branches/upstream/libhtml-template-pro-perl/current/provalue.c
    trunk/libhtml-template-pro-perl/provalue.h
      - copied unchanged from r39563, branches/upstream/libhtml-template-pro-perl/current/provalue.h
    trunk/libhtml-template-pro-perl/t/05path_like_variable_scope.t
      - copied unchanged from r39563, branches/upstream/libhtml-template-pro-perl/current/t/05path_like_variable_scope.t
    trunk/libhtml-template-pro-perl/templates-Pro/test_loop6.out
      - copied unchanged from r39563, branches/upstream/libhtml-template-pro-perl/current/templates-Pro/test_loop6.out
    trunk/libhtml-template-pro-perl/templates-Pro/test_loop6.tmpl
      - copied unchanged from r39563, branches/upstream/libhtml-template-pro-perl/current/templates-Pro/test_loop6.tmpl
Modified:
    trunk/libhtml-template-pro-perl/Changes
    trunk/libhtml-template-pro-perl/MANIFEST
    trunk/libhtml-template-pro-perl/META.yml
    trunk/libhtml-template-pro-perl/Makefile.PL
    trunk/libhtml-template-pro-perl/Pro.xs
    trunk/libhtml-template-pro-perl/README
    trunk/libhtml-template-pro-perl/debian/changelog
    trunk/libhtml-template-pro-perl/expr.c
    trunk/libhtml-template-pro-perl/expr.y
    trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm
    trunk/libhtml-template-pro-perl/pbuffer.c
    trunk/libhtml-template-pro-perl/pbuffer.h
    trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec
    trunk/libhtml-template-pro-perl/procore.c
    trunk/libhtml-template-pro-perl/procore.h
    trunk/libhtml-template-pro-perl/t/HTML-Template-Pro.t

Modified: trunk/libhtml-template-pro-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/Changes?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/Changes (original)
+++ trunk/libhtml-template-pro-perl/Changes Thu Jul  9 18:45:28 2009
@@ -167,4 +167,7 @@
 	- memory leaks fix 
 	(by Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>)
 
-
+0.75 Wed Jul  1 23:23:36 EEST 2009
+	- pos value in log message.
+	(Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>).
+	- fixed cpan rt #38486 (mixed loops && global_var=1)

Modified: trunk/libhtml-template-pro-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/MANIFEST?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/MANIFEST (original)
+++ trunk/libhtml-template-pro-perl/MANIFEST Thu Jul  9 18:45:28 2009
@@ -35,6 +35,8 @@
 proscope.c
 proscope.h
 prostate.h
+provalue.c
+provalue.h
 pstring.c
 pstring.h
 t/01coderefs.t
@@ -42,6 +44,7 @@
 t/02random.t
 t/03complex.t
 t/04register.t
+t/05path_like_variable_scope.t
 t/HTML-Template-Expr.t
 t/HTML-Template-Pro.t
 t/HTML-Template.t
@@ -120,6 +123,8 @@
 templates-Pro/test_loop4.tmpl
 templates-Pro/test_loop5.out
 templates-Pro/test_loop5.tmpl
+templates-Pro/test_loop6.out
+templates-Pro/test_loop6.tmpl
 templates-Pro/test_malloc.tmpl
 templates-Pro/test_var1.out
 templates-Pro/test_var1.tmpl

Modified: trunk/libhtml-template-pro-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/META.yml?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/META.yml (original)
+++ trunk/libhtml-template-pro-perl/META.yml Thu Jul  9 18:45:28 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                HTML-Template-Pro
-version:             0.74
+version:             0.75
 abstract:            Perl/XS module to use HTML Templates from CGI scripts
 license:             ~
 author:              

Modified: trunk/libhtml-template-pro-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/Makefile.PL?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/Makefile.PL (original)
+++ trunk/libhtml-template-pro-perl/Makefile.PL Thu Jul  9 18:45:28 2009
@@ -4,7 +4,7 @@
 use File::Spec;
 $Verbose = 1;
 
-$O_FILES=qw/procore.o pbuffer.o proscope.o expr.o pstring.o tmpllog.o/;
+$O_FILES=qw/procore.o provalue.o pbuffer.o proscope.o expr.o pstring.o tmpllog.o/;
 #  loadfile.o calc.o exprtool.o tagstack.o
 
 my $INC='-I.';
@@ -25,11 +25,14 @@
     # win 32 mmap is disabled by default
 #    $DEF{MMAP}=1;
     $DEF{MMAP}=0;
+    # no, compiler is yet unknown here;
+    # and some creepy M**soft tools may not understand long long :(
+    # $DEF{INT64_NAME} = "long long";?
 } else {
     $DEF{MMAP}=has_mmap();
 }
 
-$DEF{INT64_NAME} = find_int64();
+$DEF{INT64_NAME} ||= find_int64();
 $DEF{INT64_NAME} ||= $Config{i64type};
 
 my $i;
@@ -260,7 +263,7 @@
 }
 
 sub find_int64 {
-    foreach my $type ('long long','long','int') {
+    foreach my $type ('__int64','long long','long','int') {
 	return $type if try_as_int64($type);
     }
     return;

Modified: trunk/libhtml-template-pro-perl/Pro.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/Pro.xs?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/Pro.xs (original)
+++ trunk/libhtml-template-pro-perl/Pro.xs Thu Jul  9 18:45:28 2009
@@ -16,6 +16,7 @@
 #include "ppport.h"
 
 #include "tmplpro.h"
+#include "provalue.h"
 
 typedef PerlIO *        OutputStream;
 
@@ -96,11 +97,10 @@
 }
 
 static 
-int perl_init_loop (struct scope_stack* variable_scope, PSTRING name) {
+int perl_init_loop (struct tmplpro_param *param, PSTRING name) {
   AV* loops_AV;
   int maxloop;
-  struct ProLoopState* currentScope = getCurrentScope(variable_scope);
-  SV** hashvalptr=hv_fetch((HV*)currentScope->param_HV,name.begin, name.endnext-name.begin, 0);
+  SV** hashvalptr=(SV**) walk_through_nested_loops(param,name);
   if (hashvalptr==NULL) {
     return 0;
   } else {
@@ -113,7 +113,7 @@
     loops_AV=(AV *)SvRV(*hashvalptr);
     maxloop=av_len(loops_AV);
     if (maxloop < 0) return 0; 
-    pushScope2(variable_scope, maxloop, loops_AV);
+    pushScope2(&param->var_scope_stack, maxloop, loops_AV);
     return 1;
   }
 }

Modified: trunk/libhtml-template-pro-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/README?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/README (original)
+++ trunk/libhtml-template-pro-perl/README Thu Jul  9 18:45:28 2009
@@ -1,4 +1,4 @@
-HTML-Template-Pro version 0.69
+HTML-Template-Pro version 0.75
 ==============================
 
 DESCRIPTION
@@ -11,7 +11,7 @@
 available or in case of disk usage and memory limitations.
 
 HTML::Template::Pro is a fast lightweight C/Perl+XS reimplementation
-of HTML::Template (as of 2.8) and HTML::Template::Expr (as of 0.0.5). 
+of HTML::Template (as of 2.9) and HTML::Template::Expr (as of 0.0.5). 
 It is not intended to be a complete replacement, 
 but to be a fast implementation of HTML::Template if you don't need 
 quering, the extended facility of HTML::Template.
@@ -91,9 +91,10 @@
 
 COPYRIGHT AND LICENCE
 
-Copyright (C) 2005-2008 by I. Yu. Vlasenko.
+Copyright (C) 2005-2009 by I. Yu. Vlasenko.
 Pieces of code in Pro.pm and documentation of HTML::Template are
-copyright (C) 2000-2006 Sam Tregar (sam at tregar.com)
+copyright (C) 2000-2009 Sam Tregar (sam at tregar.com)
+Other contributors to the code base are listed in Changes.
 
 The template syntax, interface conventions and a large piece of documentation 
 of HTML::Template::Pro are based on CPAN module HTML::Template 

Modified: trunk/libhtml-template-pro-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/debian/changelog?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/debian/changelog (original)
+++ trunk/libhtml-template-pro-perl/debian/changelog Thu Jul  9 18:45:28 2009
@@ -1,8 +1,12 @@
-libhtml-template-pro-perl (0.74-2) UNRELEASED; urgency=low
+libhtml-template-pro-perl (0.75-1) UNRELEASED; urgency=low
 
+  [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
 
- -- Nathan Handler <nhandler at ubuntu.com>  Sat, 06 Jun 2009 01:34:28 +0000
+  [ Jose Luis Rivas ]
+  * New upstream release
+
+ -- Jose Luis Rivas <ghostbar38 at gmail.com>  Thu, 09 Jul 2009 14:13:01 -0430
 
 libhtml-template-pro-perl (0.74-1) unstable; urgency=low
 

Modified: trunk/libhtml-template-pro-perl/expr.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/expr.c?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/expr.c (original)
+++ trunk/libhtml-template-pro-perl/expr.c Thu Jul  9 18:45:28 2009
@@ -1971,7 +1971,7 @@
 static
 void 
 expr_debug(struct tmplpro_state* state, char const *msg1, char const *msg2) {
-  tmpl_log(NULL, TMPL_LOG_ERROR, "EXPR:at pos %d: %s %s\n", (state->expr_curpos)-(state->expr).begin,msg1,msg2);
+  tmpl_log(NULL, TMPL_LOG_ERROR, "EXPR:at pos %td [%td]: %s %s\n", (state->expr_curpos)-(state->top),(state->expr_curpos)-(state->expr).begin,msg1,msg2);
 }
 
 static
@@ -2107,7 +2107,7 @@
 	if (! state->param->case_sensitive) {
 	  lowercase_pstring_inplace(name);
 	}
-	varvalue=get_variable_value(state, name);
+	varvalue=get_variable_value(state->param, name);
 	/* tmpl_log(NULL, TMPL_LOG_ERROR, "lex:detected var %s=%s\n", name.begin,varvalue.begin); */
 	if (varvalue.begin==NULL) {
 	  /*(*lvalp).numval.val.strval=(PSTRING) {(state->expr_curpos), (state->expr_curpos)};*/

Modified: trunk/libhtml-template-pro-perl/expr.y
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/expr.y?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/expr.y (original)
+++ trunk/libhtml-template-pro-perl/expr.y Thu Jul  9 18:45:28 2009
@@ -224,7 +224,7 @@
 static
 void 
 expr_debug(struct tmplpro_state* state, char const *msg1, char const *msg2) {
-  tmpl_log(NULL, TMPL_LOG_ERROR, "EXPR:at pos %d: %s %s\n", (state->expr_curpos)-(state->expr).begin,msg1,msg2);
+  tmpl_log(NULL, TMPL_LOG_ERROR, "EXPR:at pos %td [%td]: %s %s\n", (state->expr_curpos)-(state->top),(state->expr_curpos)-(state->expr).begin,msg1,msg2);
 }
 
 static
@@ -360,7 +360,7 @@
 	if (! state->param->case_sensitive) {
 	  lowercase_pstring_inplace(name);
 	}
-	varvalue=get_variable_value(state, name);
+	varvalue=get_variable_value(state->param, name);
 	/* tmpl_log(NULL, TMPL_LOG_ERROR, "lex:detected var %s=%s\n", name.begin,varvalue.begin); */
 	if (varvalue.begin==NULL) {
 	  /*(*lvalp).numval.val.strval=(PSTRING) {(state->expr_curpos), (state->expr_curpos)};*/

Modified: trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm (original)
+++ trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm Thu Jul  9 18:45:28 2009
@@ -9,7 +9,7 @@
 use vars qw($VERSION @ISA);
 @ISA = qw(DynaLoader);
 
-$VERSION = '0.74';
+$VERSION = '0.75';
 
 bootstrap HTML::Template::Pro $VERSION;
 

Modified: trunk/libhtml-template-pro-perl/pbuffer.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/pbuffer.c?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/pbuffer.c (original)
+++ trunk/libhtml-template-pro-perl/pbuffer.c Thu Jul  9 18:45:28 2009
@@ -29,6 +29,5 @@
 /*
  * Local Variables:
  * mode: c
- * coding: cp1251
  * End:
  */

Modified: trunk/libhtml-template-pro-perl/pbuffer.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/pbuffer.h?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/pbuffer.h (original)
+++ trunk/libhtml-template-pro-perl/pbuffer.h Thu Jul  9 18:45:28 2009
@@ -19,6 +19,5 @@
 /*
  * Local Variables:
  * mode: c
- * coding: cp1251
  * End:
  */

Modified: trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec (original)
+++ trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec Thu Jul  9 18:45:28 2009
@@ -6,7 +6,7 @@
 %define module HTML-Template-Pro
 
 Name: perl-%module
-Version: 0.74
+Version: 0.75
 Release: alt1
 
 Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
 %perl_vendor_man3dir/*
 
 %changelog
+* Wed Jul 01 2009 Igor Vlasenko <viy at altlinux.ru> 0.75-alt1
+- new version; see Changes
+
 * Fri Apr 03 2009 Igor Vlasenko <viy at altlinux.ru> 0.74-alt1
 - new version; see Changes
 

Modified: trunk/libhtml-template-pro-perl/procore.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/procore.c?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/procore.c (original)
+++ trunk/libhtml-template-pro-perl/procore.c Thu Jul  9 18:45:28 2009
@@ -8,6 +8,7 @@
 
 #include "procore.h"
 #include "prostate.h"
+#include "provalue.h"
 #include "tagstack.h"
 #include "pbuffer.h"
 #include "proscope.h"
@@ -97,13 +98,13 @@
 
 static 
 PSTRING 
-get_loop_context_vars_value (struct tmplpro_state *state, PSTRING name) {
+get_loop_context_vars_value (struct tmplpro_param *param, PSTRING name) {
   static char* FalseString="0";
   static char* TrueString ="1";
   static char buffer[20]; /* for snprintf %d */
   int loop;
   PSTRING retval={NULL,NULL};
-  if (curScopeLevel(&state->param->var_scope_stack)>0 
+  if (curScopeLevel(&param->var_scope_stack)>0 
       && name.endnext-name.begin>4
       && '_'==*(name.begin)
       && '_'==*(name.begin+1)
@@ -111,7 +112,7 @@
     /* we can meet loop variables here -- try it first */
     /* length of its name >4 */
     /* __first__ __last__ __inner__ __odd__ __counter__ */
-    struct ProLoopState* currentScope = getCurrentScope(&state->param->var_scope_stack);
+    struct ProLoopState* currentScope = getCurrentScope(&param->var_scope_stack);
     PSTRING shiftedname; /* (PSTRING) {name.begin+2,name.endnext} */
     shiftedname.begin=name.begin+2;
     shiftedname.endnext=name.endnext;
@@ -275,54 +276,13 @@
 	   state->tag_start - state->top);
 }
 
-static
-ABSTRACT_VALUE* walk_through_nested_loops (struct tmplpro_state *state, PSTRING name) {
-  int PrevHash;
-  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) {
-    valptr=state->param->getAbstractValFuncPtr(getScope(&state->param->var_scope_stack, PrevHash)->param_HV,name);
-    if (valptr!=NULL) return valptr;
-    PrevHash--;
-  }
-  return NULL;
-}
-
-PSTRING get_variable_value (struct tmplpro_state *state, PSTRING name) {
+PSTRING get_variable_value (struct tmplpro_param *param, PSTRING name) {
   PSTRING varvalue ={NULL, NULL};
-  if (state->param->loop_context_vars) {
-    varvalue=get_loop_context_vars_value(state, name);
+  if (param->loop_context_vars) {
+    varvalue=get_loop_context_vars_value(param, name);
   }
   if (varvalue.begin==NULL) {
-    varvalue=(state->param->abstractVal2pstringFuncPtr)(walk_through_nested_loops(state, name));
+    varvalue=(param->abstractVal2pstringFuncPtr)(walk_through_nested_loops(param, name));
   }
   return varvalue;
 }
@@ -337,7 +297,7 @@
   if (state->is_expr) {
     varvalue=parse_expr(name, state);
   } else 
-    varvalue=get_variable_value(state, name);
+    varvalue=get_variable_value(state->param, name);
   if (debuglevel>=TMPL_LOG_DEBUG) {
       if (varvalue.begin!=NULL) {
 	tmpl_log(state,TMPL_LOG_DEBUG,"variable value = %.*s\n",(int)(varvalue.endnext-varvalue.begin),varvalue.begin);
@@ -402,7 +362,7 @@
     ifval=is_pstring_true(parse_expr(name, state));
   } else
     if (state->param->loop_context_vars) {
-      PSTRING loop_var=get_loop_context_vars_value(state, name);
+      PSTRING loop_var=get_loop_context_vars_value(state->param, name);
       if (loop_var.begin!=NULL) {
 	ifval=is_pstring_true(loop_var);
       }
@@ -410,9 +370,9 @@
   if (ifval==-1) {
     userSuppliedIsTrueFunc = state->param->isAbstractValTrueFuncPtr;
     if (userSuppliedIsTrueFunc!=NULL) {
-      ifval=(userSuppliedIsTrueFunc)(walk_through_nested_loops(state, name));
+      ifval=(userSuppliedIsTrueFunc)(walk_through_nested_loops(state->param, name));
     } else {
-      ifval=is_pstring_true((state->param->abstractVal2pstringFuncPtr)(walk_through_nested_loops(state, name)));
+      ifval=is_pstring_true((state->param->abstractVal2pstringFuncPtr)(walk_through_nested_loops(state->param, name)));
     }
   }
   return ifval;
@@ -584,7 +544,7 @@
 #ifdef DEBUG
   tmpl_log(state,TMPL_LOG_DEBUG2,"tag_handler_loop:before InitLoopFuncPtr\n");
 #endif
-  if (state->is_visible && (*state->param->InitLoopFuncPtr)(&state->param->var_scope_stack,name) && next_loop(state)) {
+  if (state->is_visible && (*state->param->InitLoopFuncPtr)(state->param,name) && next_loop(state)) {
     iftag.value=1; /* the loop is non - empty */
   } else {
     /* empty loop is equal to <if false> ... </if> */
@@ -1021,6 +981,5 @@
 /*
  * Local Variables:
  * mode: c 
- * coding: cp1251
  * End: 
  */

Modified: trunk/libhtml-template-pro-perl/procore.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/procore.h?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/procore.h (original)
+++ trunk/libhtml-template-pro-perl/procore.h Thu Jul  9 18:45:28 2009
@@ -48,7 +48,7 @@
 
 typedef void    (*writerfunc) (char* begin, char* endnext);
 
-typedef int (*init_loop_func) (struct scope_stack*, PSTRING name);
+typedef int (*init_loop_func) (struct tmplpro_param *, PSTRING name);
 typedef int (*next_loop_func) (struct ProLoopState*);
 
 typedef ABSTRACT_VALUE* (*get_ABSTRACT_VALUE_func) (ABSTRACT_MAP*, PSTRING name);
@@ -134,10 +134,7 @@
 int tmplpro_exec_tmpl_in_memory (PSTRING memarea, struct tmplpro_param* param);
 
 
-/* private : to hide */
-struct tmplpro_state;
-
-PSTRING get_variable_value (struct tmplpro_state *state, PSTRING name);
+PSTRING get_variable_value (struct tmplpro_param *param, PSTRING name);
 
 
 /* 

Modified: trunk/libhtml-template-pro-perl/t/HTML-Template-Pro.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/t/HTML-Template-Pro.t?rev=39564&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/t/HTML-Template-Pro.t (original)
+++ trunk/libhtml-template-pro-perl/t/HTML-Template-Pro.t Thu Jul  9 18:45:28 2009
@@ -6,7 +6,7 @@
 # change 'tests => 1' to 'tests => last_test_to_print';
 
 use Test;
-BEGIN {plan tests => 1+2*(18+4+1) };
+BEGIN {plan tests => 1+2*(19+4+1) };
 use File::Spec;
 #use HTML::Template;
 use HTML::Template::Pro;
@@ -31,6 +31,8 @@
 {LOOPVAR1=>'LOOP3-VAR1',LOOPVAR2=>'LOOP3-VAR2',LOOPVAR3=>'LOOP3-VAR3',LOOPVAR10=>'LOOP3-VAR10'},
 {LOOPVAR1=>'LOOP4-VAR1',LOOPVAR2=>'LOOP4-VAR2',LOOPVAR3=>'LOOP4-VAR3',LOOPVAR10=>'LOOP4-VAR10'},
 ]);
+my @outer=({TEST=>'1'},{TEST=>'2'},{TEST=>'3'});
+my @inner=({TST=>'A'},{TST=>'B'});
 
 if ($ENV{HTMLTEMPLATEPROBROKEN}) {
     # manual test
@@ -59,6 +61,7 @@
 test_tmpl('test_loop3', @varset1, @refset1);
 test_tmpl('test_loop4', @varset1, @refset1);
 test_tmpl('test_loop5', @varset1, @refset1);
+test_tmpl_options('test_loop6',[loop_context_vars=>1,debug=>1,global_vars=>1,die_on_bad_params=>0], INNER=>\@inner, OUTER=>\@outer);
 
 # todo: use config.h and grep defines from here
 # if IMITATE==1 (-DCOMPAT_ALLOW_NAME_IN_CLOSING_TAG)
@@ -82,16 +85,27 @@
 
 # -------------------------
 
-sub test_tmpl {
+
+sub test_tmpl_options {
     my $file=shift;
+    my $optref=shift;
     my $tmpl;
     print "\n--------------- Test: $file ---------------------\n";
     chdir 'templates-Pro';
 #    $tmpl=HTML::Template->new(filename=>$file.'.tmpl', die_on_bad_params=>0, strict=>0);
-    $tmpl=HTML::Template::Pro->new(filename=>$file.'.tmpl', loop_context_vars=>1, case_sensitive=>0,debug=>$DEBUG);
+    $tmpl=HTML::Template::Pro->new(filename=>$file.'.tmpl', @$optref,debug=>$DEBUG);
     $tmpl->param(@_);
     &dryrun($tmpl,$file);
     chdir '..';
+}
+
+sub test_tmpl {
+    my ($file, at args)=@_;
+    &test_tmpl_options($file, [
+			   loop_context_vars=>1, 
+			   case_sensitive=>0,
+			   debug=>$DEBUG
+		       ], at args);
 }
 
 sub dryrun {




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