[Jifty-commit] r3834 - in Template-Declare/lib: HTML MyApp Template/Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Aug 10 04:29:59 EDT 2007


Author: agentz
Date: Fri Aug 10 04:29:59 2007
New Revision: 3834

Removed:
   Template-Declare/lib/MyApp/
   Template-Declare/lib/Wifty/
Modified:
   Template-Declare/lib/HTML/TagSet.pm
   Template-Declare/lib/Template/Declare/Tags.pm

Log:
TD - removed bogus directories

Modified: Template-Declare/lib/HTML/TagSet.pm
==============================================================================
--- Template-Declare/lib/HTML/TagSet.pm	(original)
+++ Template-Declare/lib/HTML/TagSet.pm	Fri Aug 10 04:29:59 2007
@@ -10,7 +10,7 @@
 our %AlternateSpelling = (
     tr   => 'row',
     td   => 'cell',
-    base => '',    # Currently 'base' has no alternate spellings; simply ignore it;
+    base => 'html_base',
 );
 
 sub get_alternate_spelling {
@@ -81,13 +81,16 @@
 =item C<< $bool = __PACKAGE__->get_alternate_spelling($tag) >>
 
 Returns the alternative spelling for a given tag if any or
-undef otherwise. Currently, C<tr> is mapped to C<row>
-and C<td> is mapped to C<cell>.
+undef otherwise. Currently, C<tr> is mapped to C<row>,
+C<td> is mapped to C<cell>, and C<base> is mapped to
+C<html_base>.
 
 Because C<tr> is reserved by the perl interpreter for
 the operator of that name. We can't override it. And
 we override C<td> as well so as to keep consistent.
 
+For similar reasons, 'base' often gives us trouble too ;)
+
 =item C<< $bool = __PACKAGE__->can_combine_empty_tags($tag) >>
 
 =back

Modified: Template-Declare/lib/Template/Declare/Tags.pm
==============================================================================
--- Template-Declare/lib/Template/Declare/Tags.pm	(original)
+++ Template-Declare/lib/Template/Declare/Tags.pm	Fri Aug 10 04:29:59 2007
@@ -46,6 +46,8 @@
 sub _install {
     my ($no_override, $package, $subname, $coderef) = @_;
 
+    ### Installing sub: $subname
+
     my $name = $package . '::' . $subname;
     my $slot = qualify_to_ref($name);
     return if $no_override and *$slot{CODE};
@@ -276,12 +278,13 @@
         _install(
             1, # do not override
             scalar(caller), $tag,
-            sub (&;$) {
+            sub (&) {
                 die "$tag {...} is invalid; use $alternative {...} instead.\n";
             }
         );
         #### Exporting place-holder sub: $name
-        push @EXPORT, $name;
+        # XXX TODO: more checking here
+        push @EXPORT, $name unless $name =~ /^(?:base|tr)$/;
         $name = $alternative or return;
     }
 
@@ -289,6 +292,8 @@
 
     no strict 'refs';
     no warnings 'redefine';
+    #warn "Installing tag $name..." if $name eq 'base';
+    # XXX TODO: use sub _install to insert subs into the caller's package so as to support XML packages
     *$name = sub (&;$) {
         local *__ANON__ = $tag;
         if ( defined wantarray and not wantarray ) {


More information about the Jifty-commit mailing list