r21079 - in /branches/upstream/libhtml-template-pro-perl/current: ./ lib/HTML/Template/ t/ templates-Pro/include/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Jun 14 20:15:47 UTC 2008
Author: gregoa
Date: Sat Jun 14 20:15:46 2008
New Revision: 21079
URL: http://svn.debian.org/wsvn/?sc=1&rev=21079
Log:
[svn-upgrade] Integrating new upstream version, libhtml-template-pro-perl (0.70)
Added:
branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/
branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.out
branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.tmpl
branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/3.tmpl
branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/4.tmpl
Modified:
branches/upstream/libhtml-template-pro-perl/current/Changes
branches/upstream/libhtml-template-pro-perl/current/MANIFEST
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/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/proscope.c
branches/upstream/libhtml-template-pro-perl/current/proscope.h
branches/upstream/libhtml-template-pro-perl/current/prostate.h
branches/upstream/libhtml-template-pro-perl/current/t/HTML-Template-Pro.t
Modified: branches/upstream/libhtml-template-pro-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/Changes?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Changes (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Changes Sat Jun 14 20:15:46 2008
@@ -145,4 +145,7 @@
- fixed Windows compilation thanks to Vyacheslav Shevelyov
0.69 Thu Feb 28 06:46:17 EET 2008
- - added elsif tag (requested by koha.org project)
+ - added elsif tag (requested by koha.org project)
+
+0.70 Thu Apr 3 22:12:33 EEST 2008
+ - fixed regression in include scope (reported by Naxim Babych)
Modified: branches/upstream/libhtml-template-pro-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/MANIFEST?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/MANIFEST (original)
+++ branches/upstream/libhtml-template-pro-perl/current/MANIFEST Sat Jun 14 20:15:46 2008
@@ -57,6 +57,10 @@
tagstack.h
tagstack.inc
templates-Pro/empty.incl
+templates-Pro/include/2.out
+templates-Pro/include/2.tmpl
+templates-Pro/include/3.tmpl
+templates-Pro/include/4.tmpl
templates-Pro/test_broken.tmpl
templates-Pro/test_broken1.out
templates-Pro/test_broken1.tmpl
Modified: branches/upstream/libhtml-template-pro-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/META.yml?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/META.yml (original)
+++ branches/upstream/libhtml-template-pro-perl/current/META.yml Sat Jun 14 20:15:46 2008
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: HTML-Template-Pro
-version: 0.69
+version: 0.70
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/branches/upstream/libhtml-template-pro-perl/current/Pro.xs?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Pro.xs (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Pro.xs Sat Jun 14 20:15:46 2008
@@ -374,7 +374,6 @@
if (!hashvalptr || !SvROK(*hashvalptr) || (SvTYPE(SvRV(*hashvalptr)) != SVt_PVHV))
die("FATAL:output:param_map not found");
- //setRootScope((HV *)SvRV(*hashvalptr));
param->rootHV = (HV *)SvRV(*hashvalptr);
/* end setting param_map */
Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm?rev=21079&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 Sat Jun 14 20:15:46 2008
@@ -9,7 +9,7 @@
use vars qw($VERSION @ISA);
@ISA = qw(DynaLoader);
-$VERSION = '0.69';
+$VERSION = '0.70';
bootstrap HTML::Template::Pro $VERSION;
Modified: branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec?rev=21079&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 Sat Jun 14 20:15:46 2008
@@ -6,7 +6,7 @@
%define module HTML-Template-Pro
Name: perl-%module
-Version: 0.69
+Version: 0.70
Release: alt1
Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
%perl_vendor_man3dir/*
%changelog
+* Thu Apr 03 2008 Igor Vlasenko <viy at altlinux.ru> 0.70-alt1
+- new version; see Changes
+
* Thu Feb 28 2008 Igor Vlasenko <viy at altlinux.ru> 0.69-alt1
- new version; see Changes
Modified: branches/upstream/libhtml-template-pro-perl/current/procore.c
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/procore.c?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.c Sat Jun 14 20:15:46 2008
@@ -103,7 +103,7 @@
static char buffer[20]; /* for snprintf %d */
int loop;
PSTRING retval={NULL,NULL};
- if (curScopeLevel(&state->var_scope_stack)>0
+ if (curScopeLevel(&state->param->var_scope_stack)>0
&& name.endnext-name.begin>4
&& '_'==*(name.begin)
&& '_'==*(name.begin+1)
@@ -111,7 +111,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->var_scope_stack);
+ struct ProLoopState* currentScope = getCurrentScope(&state->param->var_scope_stack);
PSTRING shiftedname; /* (PSTRING) {name.begin+2,name.endnext} */
shiftedname.begin=name.begin+2;
shiftedname.endnext=name.endnext;
@@ -278,12 +278,12 @@
static
ABSTRACT_VALUE* walk_through_nested_loops (struct tmplpro_state *state, PSTRING name) {
int PrevHash;
- struct ProLoopState* currentScope = getCurrentScope(&state->var_scope_stack);
+ struct ProLoopState* currentScope = getCurrentScope(&state->param->var_scope_stack);
ABSTRACT_VALUE* valptr= state->param->getAbstractValFuncPtr(currentScope->param_HV, name);
if ((0==state->param->global_vars) || (valptr)) return valptr;
- PrevHash=curScopeLevel(&state->var_scope_stack)-1;
+ PrevHash=curScopeLevel(&state->param->var_scope_stack)-1;
while (PrevHash>=0) {
- valptr=state->param->getAbstractValFuncPtr(getScope(&state->var_scope_stack, PrevHash)->param_HV,name);
+ valptr=state->param->getAbstractValFuncPtr(getScope(&state->param->var_scope_stack, PrevHash)->param_HV,name);
if (valptr!=NULL) return valptr;
PrevHash--;
}
@@ -538,9 +538,9 @@
#ifdef DEBUG
tmpl_log(state,TMPL_LOG_DEBUG2,"next_loop:before NextLoopFuncPtr\n");
#endif
- struct ProLoopState* currentScope = getCurrentScope(&state->var_scope_stack);
+ struct ProLoopState* currentScope = getCurrentScope(&state->param->var_scope_stack);
if (++currentScope->loop >currentScope->maxloop || !(state->param->NextLoopFuncPtr)(currentScope)) {
- popScope(&state->var_scope_stack);
+ popScope(&state->param->var_scope_stack);
return 0;
} else return 1;
}
@@ -557,7 +557,7 @@
#ifdef DEBUG
tmpl_log(state,TMPL_LOG_DEBUG2,"tag_handler_loop:before InitLoopFuncPtr\n");
#endif
- if (state->is_visible && (*state->param->InitLoopFuncPtr)(&state->var_scope_stack,name) && next_loop(state)) {
+ if (state->is_visible && (*state->param->InitLoopFuncPtr)(&state->param->var_scope_stack,name) && next_loop(state)) {
iftag.value=1; /* the loop is non - empty */
} else {
/* empty loop is equal to <if false> ... </if> */
@@ -848,12 +848,11 @@
flag is_tag_closed;
flag is_tag_commented;
char* last_safe_pos=state->next_to_end-TAG_WIDTH_OFFSET;
+ if (debuglevel) tmpl_log(NULL,TMPL_LOG_DEBUG,"process_state:initiated\n");
tagstack_init(&(state->tag_stack));
pbuffer_init(&(state->str_buffer));
pbuffer_init(&(state->expr_pusharg_buffer));
- Scope_init(&state->var_scope_stack);
- // hack (until param and state will merge ???)
- setRootScope(&state->var_scope_stack,state->param->rootHV);
+ Scope_init_root(&state->param->var_scope_stack,state->param->rootHV);
while (state->cur_pos < last_safe_pos) {
@@ -881,7 +880,7 @@
}
(state->param->WriterFuncPtr)(state->last_processed_pos,state->next_to_end);
- Scope_free(&state->var_scope_stack);
+ Scope_free(&state->param->var_scope_stack);
pbuffer_free(&(state->expr_pusharg_buffer));
pbuffer_free(&(state->str_buffer));
tagstack_free(&(state->tag_stack));
Modified: branches/upstream/libhtml-template-pro-perl/current/procore.h
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/procore.h?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/procore.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/procore.h Sat Jun 14 20:15:46 2008
@@ -124,8 +124,9 @@
const char* selfpath; /* file that has included this file, or empty string */
/* hack until param and state will be merged */
ABSTRACT_MAP* rootHV;
-
-
+ /* moved from state; are passed to include */
+ /* variable scope (nested loops) */
+ struct scope_stack var_scope_stack;
};
int tmplpro_exec_tmpl (const char* filename, struct tmplpro_param* ProParams);
Modified: branches/upstream/libhtml-template-pro-perl/current/proscope.c
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/proscope.c?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/proscope.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/proscope.c Sat Jun 14 20:15:46 2008
@@ -12,20 +12,23 @@
#define START_NUMBER_OF_NESTED_LOOPS 64
-
+static
void
Scope_init(struct scope_stack* scopestack) {
- scopestack->max=START_NUMBER_OF_NESTED_LOOPS;
- scopestack->root=(struct ProLoopState*) malloc ((scopestack->max) * sizeof(struct ProLoopState));
- if (NULL==scopestack->root) tmpl_log(NULL,TMPL_LOG_ERROR, "DIE:Scope_init:internal error:not enough memory\n");
- scopestack->level=-1;
+ scopestack->max=START_NUMBER_OF_NESTED_LOOPS;
+ scopestack->root=(struct ProLoopState*) malloc ((scopestack->max) * sizeof(struct ProLoopState));
+ if (NULL==scopestack->root) tmpl_log(NULL,TMPL_LOG_ERROR, "DIE:Scope_init:internal error:not enough memory\n");
+ scopestack->level=-1;
}
void
Scope_free(struct scope_stack* scopestack) {
- free(scopestack->root);
- scopestack->max=-1;
- scopestack->level=-1;
+ if (scopestack->_init_count--<=0) {
+ free(scopestack->root);
+ scopestack->max=-1;
+ scopestack->level=-1;
+ scopestack->_init_count=0;
+ }
}
int curScopeLevel(struct scope_stack* scopestack) {
@@ -70,11 +73,10 @@
}
void
-setRootScope(struct scope_stack* scopestack, void* param_HV) {
- if (scopestack->max<0) {
- tmpl_log(NULL,TMPL_LOG_ERROR, "WARN:SetRootScope:internal warning:why scope is empty?\n");
+Scope_init_root(struct scope_stack* scopestack, void* param_HV) {
+ if (scopestack->_init_count++==0) {
Scope_init(scopestack);
+ scopestack->level=0;
+ scopestack->root->param_HV=param_HV;
}
- scopestack->level=0;
- scopestack->root->param_HV=param_HV;
}
Modified: branches/upstream/libhtml-template-pro-perl/current/proscope.h
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/proscope.h?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/proscope.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/proscope.h Sat Jun 14 20:15:46 2008
@@ -16,6 +16,7 @@
struct scope_stack {
int level;
int max;
+ int _init_count;
struct ProLoopState* root;
};
@@ -30,11 +31,10 @@
int curScopeLevel(struct scope_stack*);
struct ProLoopState* getCurrentScope(struct scope_stack*);
struct ProLoopState* getScope(struct scope_stack*, int depth);
-void popScope();
+void popScope(struct scope_stack* scopestack);
/* maxloop = number of loops - 1 in * loops_AV */
void pushScope2(struct scope_stack*, int maxloop, void *loops_AV);
-void setRootScope(struct scope_stack*, void* param_HV);
-void Scope_init(struct scope_stack* scopestack);
+void Scope_init_root(struct scope_stack*, void* param_HV);
void Scope_free(struct scope_stack* scopestack);
#endif /* _PROSCOPE_H */
Modified: branches/upstream/libhtml-template-pro-perl/current/prostate.h
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/prostate.h?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/prostate.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/prostate.h Sat Jun 14 20:15:46 2008
@@ -27,11 +27,13 @@
pbuffer str_buffer;
/* tag stack */
struct tagstack tag_stack;
+
+ /* moved from state; are passed to include */
/* variable scope (nested loops) */
- struct scope_stack var_scope_stack;
-
+ /* struct scope_stack var_scope_stack;*/
/* expr state variables */
/* expr string buffer; used to unescape pstring arg */
+ /* TODO: test and move it too (otherwise it will cause bugs in included exprs?) */
pbuffer expr_pusharg_buffer;
char* expr_curpos;
Modified: branches/upstream/libhtml-template-pro-perl/current/t/HTML-Template-Pro.t
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/t/HTML-Template-Pro.t?rev=21079&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/t/HTML-Template-Pro.t (original)
+++ branches/upstream/libhtml-template-pro-perl/current/t/HTML-Template-Pro.t Sat Jun 14 20:15:46 2008
@@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test;
-BEGIN {plan tests => 1+2*(18+4) };
+BEGIN {plan tests => 1+2*(18+4+1) };
use File::Spec;
#use HTML::Template;
use HTML::Template::Pro;
@@ -64,6 +64,10 @@
# if IMITATE==1 (-DCOMPAT_ALLOW_NAME_IN_CLOSING_TAG)
#test_tmpl('test_if6', @varset1);
#
+
+
+test_tmpl('include/2', 'list', [{test => 1}, {test=>2}]);
+
my $devnull=File::Spec->devnull();
if (defined $devnull) {
Added: branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.out
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.out?rev=21079&op=file
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.out (added)
+++ branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.out Sat Jun 14 20:15:46 2008
@@ -1,0 +1,3 @@
+01!
+02!
+
Added: branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.tmpl
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.tmpl?rev=21079&op=file
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.tmpl (added)
+++ branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/2.tmpl Sat Jun 14 20:15:46 2008
@@ -1,0 +1,1 @@
+<tmpl_loop list><tmpl_include "include/3.tmpl"></tmpl_loop>
Added: branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/3.tmpl
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/3.tmpl?rev=21079&op=file
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/3.tmpl (added)
+++ branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/3.tmpl Sat Jun 14 20:15:46 2008
@@ -1,0 +1,1 @@
+<tmpl_include "include/4.tmpl">
Added: branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/4.tmpl
URL: http://svn.debian.org/wsvn/branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/4.tmpl?rev=21079&op=file
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/4.tmpl (added)
+++ branches/upstream/libhtml-template-pro-perl/current/templates-Pro/include/4.tmpl Sat Jun 14 20:15:46 2008
@@ -1,0 +1,1 @@
+0<tmpl_var test>!
More information about the Pkg-perl-cvs-commits
mailing list