Acme-Pythonic

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      more in the line of Perl forgiveness IMHO.

0.14
    - "while:" is now correctly converted to "while ()"
    - Added support for &-prototyped subroutines

0.13 Sun May 30 00:37:12 2004
    - Added manhattan_intersection() implementation to t/algorithms.t
    - Fixed: Broken code was being generated in lines with comments
      following a Pythonic colon.
    - Better conformance to perlstyle in some foreach patterns.
    - Handling of continuation lines simplified.

0.12 Sat May 29 02:23:53 2004
    - Added bubblesort in t/algorithms.t
    - The code that inserts " {"s was breaking $#array, fixed.
    - Changed SYNOPSIS.
    - Fixed the documentation about backslashes in lines with comments.
    - Fixed the link to LIMITATIONS.

0.11 Fri May 28 01:09:45 2004
    - Regexps slightly more robust.
    - Fixed: There was a bug that might prevent the stack from being emptied.
    - Fixed: Whitespace after backlashes in comments could be modified.

0.1
    - More tests
    - Implicit line joining is more Pythonic
    - Comments and blank lines are preserved
    - Genereated code tries to follow perlstyle
    - Refactoring

0.03 Mon May 24 23:36:55 2004
    - More tests
    - pass wasn't being ignored at the beginning of line
    - Fixed a bug handling fors
    - More documentation fixes

0.02 Mon May 24 15:31:42 2004
	- Minor fixes in documentation

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

    my $id_at_sob = shift;
    return 0 if !$id_at_sob;
    return 1 if $id_at_sob =~ /^(do|sub|eval)$/;

    my $proto = $id_at_sob =~ /::/ ? prototype($id_at_sob) : prototype("${CALLER}::$id_at_sob");
    return 0 if not defined $proto;
    return $proto =~ /^;?&$/;
}


# We follow perlstyle here, as we did until now.
sub cuddle_elses_and_friends {
    s/^([ \t]*})\s*(?=(?:elsif|else|continue)\b)/$1 /gm;
    s/^([ \t]*})\s*(?=(?:if|unless|while|until|for|foreach)\b(?!.*{$tc?$))/$1 /gm;
}

1;


__END__

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


    use Acme::Pythonic debug => 1;

In debug mode the module prints to standard output the code it has
generated, and passes just a dummy C<1;> to L<Filter::Simple>.

This happens I<before> L<Filter::Simple> undoes the blanking out of
PODs, strings, and regexps. Those parts are marked with the label
C<BLANKED_OUT> for easy identification.

Acme::Pythonic generates human readable Perl following L<perlstyle>, and
tries meticulously to be respectful with the original source code.
Blank lines and comments are preserved.


=head1 BUGS

This module uses a regexp approach and the superb help of
Filter::Simple. The regexp part of this means it is broken from the
start, though I've tried hard to make it as robust as I could. Bug
reports will be very welcome, just drop me a line!



( run in 0.321 second using v1.01-cache-2.11-cpan-26ccb49234f )