File: Exception.pm

package info (click to toggle)
libhtml-template-compiled-perl 1.003-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 772 kB
  • sloc: perl: 4,759; makefile: 5
file content (55 lines) | stat: -rw-r--r-- 993 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use strict;
use warnings;
{
package HTML::Template::Compiled::Exception;
our $VERSION = '1.003'; # VERSION
use Data::Dumper;
use Carp qw(croak carp);

use constant ATTR_TEXT   => 0;
use constant ATTR_FILE   => 1;
use constant ATTR_LINE   => 2;
use constant ATTR_PARSER => 3;
use constant ATTR_TOKENS => 4;
use constant ATTR_NEAR => 5;

use overload '""' => \&stringify;

sub new {
    my $class = shift;
    my $self = [];
    bless $self, $class;
    $self->init(@_);
    return $self;
}
sub init {
    my ($self, %args) = @_;
    $self->[ATTR_TEXT] = $args{text};
    $self->[ATTR_FILE] = $args{file};
    $self->[ATTR_LINE] = $args{line};
    $self->[ATTR_PARSER] = $args{parser};
    $self->[ATTR_TOKENS] = $args{tokens};
    $self->[ATTR_NEAR] = $args{near};
}
sub stringify {
    my ($self) = @_;
    my $text = $self->[ATTR_TEXT];
}

sub parser {
    return $_[0]->[ATTR_PARSER];
}


}
1;

__END__

=pod

=head1 NAME

HTML::Template::Compiled::Exception - Exception class for HTC

=cut