Acme-Aheui
view release on metacpan or search on metacpan
NAME
Acme::Aheui - an aheui interpreter
VERSION
Version 0.05
SYNOPSIS
use utf8;
use Acme::Aheui;
my $interpreter = Acme::Aheui->new( source => 'ìí¬' );
$interpreter->execute();
DESCRIPTION
An aheui interpreter.
See aheui language specification at
https://aheui.github.io/specification.en
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use Encode qw/decode/;
use Term::Encoding;
use Acme::Aheui;
my $encoding = Term::Encoding::get_encoding();
binmode STDIN, ":encoding($encoding)";
my ($filename) = @ARGV;
aheui : program read from stdin
__HELP__
die $help if ($filename && $filename =~ /^--?h(elp)?$/);
my $source;
if ($filename) {
open(FH, $filename) or die "cannot open $filename\n";
$source = join '', <FH>;
close(FH);
$source = decode('utf-8', $source); # expect utf8 by aheui spec
}
elsif (-t STDIN and -z STDIN) {
print "Acme::Aheui $Acme::Aheui::VERSION ($encoding)\n";
print "Type aheui commands or empty line for EOF.\n";
my @lines = ();
while (1) {
print '>>> ';
my $line = <>;
last if !$line or $line =~ /^\r?\n$/;
push @lines, $line;
lib/Acme/Aheui.pm view on Meta::CPAN
package Acme::Aheui;
use utf8;
use strict;
use warnings;
use Term::ReadKey;
use Term::Encoding;
use Encode qw/encode/;
=encoding utf8
=head1 NAME
Acme::Aheui - an aheui interpreter
=head1 VERSION
Version 0.05
=cut
our $VERSION = '0.05';
=head1 SYNOPSIS
use utf8;
use Acme::Aheui;
my $interpreter = Acme::Aheui->new( source => 'ìí¬' );
$interpreter->execute();
=head1 DESCRIPTION
An aheui interpreter.
See aheui language specification at L<https://aheui.github.io/specification.en>
t/01_aheui.t view on Meta::CPAN
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use Test::More;
use Capture::Tiny ':all';
use Encode qw/decode/;
BEGIN {
use_ok( 'Acme::Aheui' );
}
( run in 1.310 second using v1.01-cache-2.11-cpan-49f99fa48dc )