App-QuoteCC

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - Use the not-so-well-known dong string delimiting syntax in the
      Perl emitter.

0.08 2010-09-22 13:46:28

    - Replace horridly complex Lua string escaping with something that
      just uses Lua's multiline string
      syntax. http://www.wellho.net/resources/ex.php4?item=u104/mlx

    - Don't mark any strings coming into the program as UTF-8. Just
      apply binmode() to the filehandles. Garbage in/garbage out.

    - Test UTF-8 output of C programs, and test Lua if we have it

0.07 2010-09-21 19:07:44

    - FIX UTF-8 output & tests.

    - Add App::QuoteCC::Input::Text for line-delimited text input.

0.06 2010-09-21 17:14:08

lib/App/QuoteCC/Role/Input.pm  view on Meta::CPAN

    is            => 'ro',
    documentation => 'The quotes file to compile from. - for STDIN',
);

sub file_handle {
    my ($self) = @_;
    my $file   = $self->file;

    given ($file) {
        when ('-') {
            binmode STDIN;
            return *STDIN;
        }
        default {
            open my $fh, '<', $file;
            binmode $fh;
            return $fh;
        }
    }
}

requires 'quotes';

1;

=encoding utf8

lib/App/QuoteCC/Role/Output.pm  view on Meta::CPAN

    is            => 'ro',
    documentation => 'The quotes to compile to',
);

sub file_handle {
    my ($self) = @_;
    my $file   = $self->file;

    given ($file) {
        when ('-') {
            binmode STDOUT, ":encoding(UTF-8)";
            return *STDOUT;
        }
        default {
            open my $fh, '>:encoding(UTF-8)', $file;
            return $fh;
        }
    }
}

requires 'output';

sub spew_output {
    my ($self, $out) = @_;

    given ($self->file) {
        when ('-') {
            binmode STDOUT;
            print $out;
        }
        default {
            open my $fh, ">", $_;
            binmode $fh;
            print $fh $out;
        }
    }

    return;
}

1;

=encoding utf8



( run in 0.828 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )