Acme-Comment

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

----------------
Added PREREQ for Text::Balanced 1.99 as per RT #1443
Removed the MY override of test_via_harness, fails on Strawberry RT #50225

1.02 04 Sep 2002
----------------
Removed some debug information that would show up if the module died.
Also applied a patch from Jouke Visser to preserve the original scripts
line numbering.
This means that if you have a script that uses Acme::Comment and that
script emits a warning or an error, the line numbering will now be
correct.


1.01 13 Aug 2002
----------------
Fixed a bug in the passing of parameters that would not always
'quotemeta' regex metacharacters
Added 'Foxbase' as a language we support.

1.00 12 May 2002

lib/Acme/Comment.pm  view on Meta::CPAN

        ### check if the user requested a certain type of comments ###
        if( $args{type} ) {

            ### and check if it even exists ###
            if( $Conf->{ uc $args{type} } ) {
                $Type = uc $args{type};

                $Conf->{$Type}->{own_line} = $args{own_line} if defined $args{own_line};
                $Conf->{$Type}->{one_line} = $args{one_line} if defined $args{one_line};

            ### otherwise die with an error ###
            } else {
                die "Requested an unsupported type $args{type} for Acme::Comment\n";
            }

        ### otherwise, define a new type for the user ###
        } else {
            $Type = ++$TypeCount;

            unless( (defined $args{start} and defined $args{end}) or defined $args{single} ) {
                die "You need to specify both start and end tags OR a single line comment!\n";

lib/Acme/Comment.pm  view on Meta::CPAN


            ### if we find an opening tag, add to the counter
            ### and mark the line number
            if( $line =~ /$ldel/ ) {
                $lastopen = $i;
                $counter++;
		        push @return, "";
                next;

            ### if we find a closing tag, decreate the counter
            ### if counter was already at zero, there's a syntax error
            } elsif ( $line =~  /$rdel/ ) {
                unless($counter) {
                    die "Missing opening comment for closing comment on line $i\n";
                }
                $counter--;
		        push @return, "";
                next;
            }
        }

lib/Acme/Comment.pm  view on Meta::CPAN

Styles may be specified by the C<types> argument, or by C<start> and
C<end> and manipulated with C<own_line> and C<one_line>.

Styles may contain multi-line comments and single-line comments.
Perl, for example, has single-line comments in the form of C<#>.

C, on the other hand, has multi-line comments which begin with
C</*> and end with C<*/>.

With multi-line comments, leaving out a begin or an end comment
will cause an error.

Both types of comments may only be preceded on a line by whitespace.

=head2 own_line

By default, C<own_line> is true, which means that multi-line comments may not
be followed by any characters other than whitespace on the same line.
This is the safest option if you think your code may contain the
comment characters (perhaps in a regex).  If you disable it, other
characters are allowed on the line after the starting delimiter, but these

lib/Acme/Comment.pm  view on Meta::CPAN


Because of the way source filters work, it is not possible to eval
code containing comments and have them correctly removed.

=head1 NOTE

Some of these programming languages may be spelled incorrectly, or
may have the wrong quote characters noted.  The majority of this
information was found by searches for language specifications.

So please report errors, as well as obscure commenting syntax you
know of.

=head1 Acknowledgements

Thanks to Abigail and Glenn Maciag for their suggestions.

=head1 BUG REPORTS

Please report bugs or other issues to E<lt>bug-acme-comment@rt.cpan.orgE<gt>.



( run in 0.687 second using v1.01-cache-2.11-cpan-74e6d1fb12f )