| 1 | package Decl::Semantics::Text; | ||||||||||
| 2 | |||||||||||
| 3 | 13 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 13 | ▶ | use base qw(Decl::Node); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | =head1 NAME | ||||||||||
| 9 | |||||||||||
| 10 | Decl::Semantics::Text - implements a section of text (presumed human-readable) | ||||||||||
| 11 | |||||||||||
| 12 | =head1 VERSION | ||||||||||
| 13 | |||||||||||
| 14 | Version 0.02 | ||||||||||
| 15 | |||||||||||
| 16 | =cut | ||||||||||
| 17 | |||||||||||
| 18 | 13 | our $VERSION = '0.01'; | |||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | =head1 SYNOPSIS | ||||||||||
| 22 | |||||||||||
| 23 | Text doesn't do anything, except that it can output itself. Later, there will be a generalized output mechanism, but that's still | ||||||||||
| 24 | on the drawing board, so really, text just ... holds text. | ||||||||||
| 25 | |||||||||||
| 26 | =head2 defines(), tags_defined() | ||||||||||
| 27 | |||||||||||
| 28 | Called by Decl::Semantics during import, to find out what xmlapi tags this plugin claims to implement. | ||||||||||
| 29 | The asterisk means indented lines will all be put into the body of this tag even if not surrounded by curly braces. | ||||||||||
| 30 | |||||||||||
| 31 | =cut | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub defines { ('text'); } | ||||||||
|
Subroutine
defines: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 0 | ▶ | our %build_handlers = ( text => { node => sub { Decl::Semantics::Text->new (@_) }, body => 'none' } ); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 35 | 12 | ▶ | sub tags_defined { Decl->new_data(<<EOF); } | ||||||||
|
Subroutine
tags_defined: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 36 | text (body=text) | ||||||||||
| 37 | EOF | ||||||||||
| 38 | |||||||||||
| 39 | =head2 parse_body | ||||||||||
| 40 | |||||||||||
| 41 | When used outside the parser, a Text.pm node can have any tag - but it still doesn't ever parse its body. | ||||||||||
| 42 | |||||||||||
| 43 | It has ambiguous callability. | ||||||||||
| 44 | |||||||||||
| 45 | =cut | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub parse_body { | ||||||||
|
Subroutine
parse_body: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 48 | 0 | my ($self) = @_; | |||||||||
| 49 | 0 | $self->{callable} = '?'; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | =head2 go | ||||||||||
| 53 | |||||||||||
| 54 | When called, Text writes to itself. By default, that propagates up the tree until an output handler is found. | ||||||||||
| 55 | |||||||||||
| 56 | =cut | ||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | sub go { | ||||||||
|
Subroutine
go: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 59 | 0 | my ($self) = @_; | |||||||||
| 60 | 0 | ▶ | if ($self->label) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | 0 | $self->write($self->label); | |||||||||
| 62 | } else { | ||||||||||
| 63 | 0 | $self->write($self->body); | |||||||||
| 64 | } | ||||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | =head1 AUTHOR | ||||||||||
| 68 | |||||||||||
| 69 | Michael Roberts, C<< <michael at vivtek.com> >> | ||||||||||
| 70 | |||||||||||
| 71 | =head1 BUGS | ||||||||||
| 72 | |||||||||||
| 73 | Please report any bugs or feature requests to C<bug-decl at rt.cpan.org>, or through | ||||||||||
| 74 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Decl>. I will be notified, and then you'll | ||||||||||
| 75 | automatically be notified of progress on your bug as I make changes. | ||||||||||
| 76 | |||||||||||
| 77 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 78 | |||||||||||
| 79 | Copyright 2010 Michael Roberts. | ||||||||||
| 80 | |||||||||||
| 81 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 82 | under the terms of either: the GNU General Public License as published | ||||||||||
| 83 | by the Free Software Foundation; or the Artistic License. | ||||||||||
| 84 | |||||||||||
| 85 | See http://dev.perl.org/licenses/ for more information. | ||||||||||
| 86 | |||||||||||
| 87 | =cut | ||||||||||
| 88 | |||||||||||
| 89 | 13 | 1; # End of Decl::Semantics::Text | |||||||||