Acme-Comment

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

        },
        RUBY    => {
            start       => '=begin',
            end         => '=end',
            single      => '#',
        },
        JAVA    => {
            start       => '/*',
            end         => '*/',
            single      => '//',
        },
        PASCAL  => {
            start       => '(*',
            end         => '*)',
        },

        ALGOL  => {
            start       => "'comment'",
            end         => ';',
        },

        HUGO    => {
            start       => '!\\',
            end         => '\!',
        },

        BASIC   =>  {
            single      =>  q['],
        },
        PILOT   =>  {
            single      => '\/\/',
        },
        #BLUE   =>  {
        #    single      => '(?:==)|(?:--)',
        #},
        #INTERCAL    => {
        #    single  => '(?:\(\d+\)\s*)?DO NOTE THAT',
        #},
        FORTRAN     => {
            single  => '!',
        },
        PERL        => {
            single      => q[#],
        },
        ALAN        => {
            single      => "--",
        },
        ORTHOGONAL  => {
            single      => ";",
        },
        FOCAL  => {
            single      => "comment",
        },
        LATEX  => {
            single      => "%",
        },
        FOXBASE => {
            single      => '(?:\*)|(?:&&)',
        }     
};
### the comment styles for ADA and Basic are the same ###
for my $type(qw|ADA|)                               { $Conf->{$type} = $Conf->{'BASIC'} }

for my $type(qw|POSTSCRIPT|)                        { $Conf->{$type} = $Conf->{'LATEX'} }

for my $type(qw|ADVSYS LISP SCHEME|)                { $Conf->{$type} = $Conf->{'ORTHOGONAL'} }

for my $type(qw|EIFFEL HASKELL|)                    { $Conf->{$type} = $Conf->{'ALAN'} }

for my $type(qw|BETA BLISS JOY VAR'AQ|)             { $Conf->{$type} = $Conf->{'PASCAL'} }

for my $type(qw|B PL/I CHILL|)                      { $Conf->{$type} = $Conf->{'C'} }

for my $type(qw|C++ PHP C# CLEAN ELASTIC GUILE|)    { $Conf->{$type} = $Conf->{'JAVA'} }

for my $type(qw|PYTHON PARROT AWK UNLAMBDA E ICON|) { $Conf->{$type} = $Conf->{'PERL'} }

my $To_Test = [
    { one_line => 0, own_line => 1 },
    { one_line => 1, own_line => 1 },
    { one_line => 0, own_line => 0 },
    { one_line => 1, own_line => 0 },
];

### write our test suite dynamically ###
my $cwd = cwd();
for my $type (keys %$Conf) {

    my $name = $type;
    $name =~ s/\W//g;

    for my $test (@$To_Test) {

        ### filename to write to
        my $file = File::Spec->catfile(
                                    $cwd,
                                    "t",
                                    $name
                                    . '-' .
                                    'one_line_' .
                                    scalar $test->{one_line}
                                    . '-' .
                                    'own_line_' .
                                    scalar $test->{own_line}
                                    . '.t'
                                );

        ### status indication for Test::More ###
        my $what = "own_line: $test->{own_line}, one_line: $test->{one_line}";


        my $fh;
        unless(-e $file and -s $file) {

            open $fh, ">$file" or die qq[Could not open file $file for writing: $!];


            ### perl get's confused if we type 'use' like this, so we put it in a var.
            my $u = 'use';
            
            ### the dir to include to find our latest Acme::Comment ###



( run in 0.652 second using v1.01-cache-2.11-cpan-39bf76dae61 )