Acme-Comment
view release on metacpan or search on metacpan
lib/Acme/Comment.pm view on Meta::CPAN
}
sub import {
my $package = shift;
my %args = @_;
if(@_%2){
die "Incomplete set of arguments to $package\n"
}
### see if there are any arguments, if not, we default to the C comment style ###
if( keys %args ) {
### 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};
lib/Acme/Comment.pm view on Meta::CPAN
$Conf->{$TypeCount}->{own_line} = defined $args{own_line}
? $args{own_line}
: 1;
$Conf->{$TypeCount}->{one_line} = defined $args{one_line}
? $args{one_line}
: 0;
}
### no arguments, Let's take the default C comment style ###
}
}
sub parse {
#use Data::Dumper;
#print scalar @_;
#die Dumper \@_;
my $str = shift;
lib/Acme/Comment.pm view on Meta::CPAN
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
characters will be ignored. The closing delimiter cannot be followed by
any other characters.
Thus, in the following example, C<$foo> would be set to 1.
/* This is my real comment.
*/
$foo = 1;
If you wish to change this option, you must specify either a C<type> or
C<start> and C<end>.
=head2 one_line
By default, this is set to false, which means that multi-line comments
may not end on the same line in which they begin. Turning this on
allows the following syntax:
/* comment */
If you wish to change this option, you must specify either a C<type> or
C<start> and C<end>.
=head2 C<start> and C<end>
lib/Acme/Comment.pm view on Meta::CPAN
=item * Bliss
Multi-line comments use C<(*> and C<*)>.
=item * Blue
Single-line comments use either C<==> or C<-->.
=item * C
The default for Acme::Comment is C-style multi-line commenting
with C</*> and C<*/>. However, if you wish to change C<one_line>
or C<own_line>, you must explicitly specify the type.
=item * C++
C++ multi-line style uses C</*> and C<*/>. Single-line uses C<//>.
=item * C#
C# multi-line style uses C</*> and C<*/>. Single-line uses C<//>.
( run in 0.631 second using v1.01-cache-2.11-cpan-0a6323c29d9 )