/[papo]/papo/neb/neb/Tree/Tag.pm
ViewVC logotype

Diff of /papo/neb/neb/Tree/Tag.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jlenton, Wed Apr 9 15:29:14 2003 UTC revision 1.4 by jlenton, Wed Apr 9 19:59:22 2003 UTC
# Line 4  use Carp; Line 4  use Carp;
4  use neb::Tree::Node;  use neb::Tree::Node;
5  use neb::Tree::Container;  use neb::Tree::Container;
6    
7  our @ISA = ('neb::Tree::Node');  our @ISA = ('neb::Tree::Container');
8  our $DEBUG;  our $DEBUG;
9    
10  sub init  sub init
# Line 12  sub init Line 12  sub init
12      my $self = shift;      my $self = shift;
13      $self->name(@_);      $self->name(@_);
14      $self->{ATTRS} = {};      $self->{ATTRS} = {};
     $self->{CONTAINER} = new neb::Tree::Container;  
     $self->{CONTAINER}->parent($self);  
   
15      $DEBUG = $main::DEBUG;      $DEBUG = $main::DEBUG;
16  }  }
17    
# Line 48  sub attributes Line 45  sub attributes
45      return %{$self->{ATTRS}};      return %{$self->{ATTRS}};
46  }  }
47    
 sub add_content  
 {  
     my $self = shift;  
     $self->container->add_content(@_);  
 }  
   
 sub container  
 {  
     my $self = shift;  
   
     return $self->{CONTAINER};  
 }  
   
48  sub canonical  sub canonical
49  {  {
50      my $self = shift;      my $self = shift;
51      my %h = $self->attributes;      my %h = $self->attributes;
52      return $self->canonical_start . $self->container->canonical . $self->canonical_end;      return $self->canonical_start . $self->canonical_middle . $self->canonical_end;
53  }  }
54    
55  my $attr_sorter = sub {  my $attr_sorter = sub {
# Line 90  sub canonical_start Line 74  sub canonical_start
74                  map(" $_='\Q$h{$_}\E'", sort $attr_sorter keys %h), '>');                  map(" $_='\Q$h{$_}\E'", sort $attr_sorter keys %h), '>');
75  }  }
76    
77    sub canonical_middle
78    {
79        my $self = shift;
80        return $self->SUPER::canonical;
81    }
82    
83  sub canonical_end  sub canonical_end
84  {  {
85      my $self = shift;      my $self = shift;
# Line 139  sub code_end Line 129  sub code_end
129  sub code  sub code
130  {  {
131      my $self = shift;      my $self = shift;
132      return $self->code_start . $self->container->code . $self->code_end;      return $self->code_start . $self->SUPER::code . $self->code_end;
133  }      }    
134    
135  1;  1;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26