Skip to content
Browse files

Revert "Perlito5 - add Perlito5X namespace"

This reverts commit 828649a.
this breaks 'make'
  • Loading branch information...
1 parent b62fba5 commit 1f09a806cac684620b40716f904202317d45f6cb @fglock committed Oct 18, 2012
View
4 html/perlito5.html
@@ -129,8 +129,8 @@
return true;
};
p5pkg["main"]["v_^O"] = "browser";
- p5pkg["main"]["Hash_INC"]["strict.pm"] = "Perlito5X/strict.pm";
- p5pkg["main"]["Hash_INC"]["warnings.pm"] = "Perlito5X/warnings.pm";
+ p5pkg["main"]["Hash_INC"]["Perlito5/strict.pm"] = "Perlito5/strict.pm";
+ p5pkg["main"]["Hash_INC"]["Perlito5/warnings.pm"] = "Perlito5/warnings.pm";
var source = document.getElementById('source').value;
var pos = 0;
View
44 html/perlito5.js
@@ -1770,30 +1770,30 @@ var p5100 = p5pkg['main'];
(function () {
var p5101 = p5make_package("Perlito5");
(function () {
- var p5102 = p5make_package("strict");
- p5make_sub("strict", "import", function (List__, p5want) {
+ var p5102 = p5make_package("Perlito5::strict");
+ p5make_sub("Perlito5::strict", "import", function (List__, p5want) {
return ((p5pkg["Perlito5"]["v_STRICT"] = (1)));
});
- p5make_sub("strict", "unimport", function (List__, p5want) {
+ p5make_sub("Perlito5::strict", "unimport", function (List__, p5want) {
return ((p5pkg["Perlito5"]["v_STRICT"] = (0)));
});
1;
})()
;
- // use strict
+ // use Perlito5::strict
;
(function () {
- var p5103 = p5make_package("warnings");
- p5make_sub("warnings", "import", function (List__, p5want) {
+ var p5103 = p5make_package("Perlito5::warnings");
+ p5make_sub("Perlito5::warnings", "import", function (List__, p5want) {
return ((p5pkg["Perlito5"]["v_WARNINGS"] = (1)));
});
- p5make_sub("warnings", "unimport", function (List__, p5want) {
+ p5make_sub("Perlito5::warnings", "unimport", function (List__, p5want) {
return ((p5pkg["Perlito5"]["v_WARNINGS"] = (0)));
});
1;
})()
;
- // use warnings
+ // use Perlito5::warnings
;
(function () {
null;
@@ -9790,6 +9790,8 @@ var p5100 = p5pkg['main'];
p5pkg["Perlito5::Precedence"].add_term(['use', function (List__, p5want) {
return (p5call(p5pkg["Perlito5::Grammar::Use"], "term_use", p5list_to_a(List__.p5aget(0), List__.p5aget(1)), p5want));
}], null);
+ var Hash_Perlito_internal_module = {};
+ (Hash_Perlito_internal_module = {'strict' : 'Perlito5::strict', 'warnings' : 'Perlito5::warnings', 'utf8' : 'Perlito5::utf8', 'bytes' : 'Perlito5::bytes', 'encoding' : 'Perlito5::encoding'});
p5make_sub("Perlito5::Grammar::Use", "use_decl", function (List__, p5want) {
var v_grammar;
(v_grammar = (List__.p5aget(0)));
@@ -9943,7 +9945,7 @@ var p5100 = p5pkg['main'];
var r;
p5pkg["main"]["v_@"] = "";
try {
-r = eval(perl5_to_js(p5str(v_list_code), "Perlito5::Grammar::Use", (new p5ArrayRef(p5list_to_a((new p5HashRef(p5a_to_h(p5list_to_a('$list_code', (new p5HashRef({'decl' : 'my'})), '$m', (new p5HashRef({'decl' : 'my'})), '@list', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$list', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef({})), (new p5HashRef(p5a_to_h(p5list_to_a('$pos1', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef({})), (new p5HashRef(p5a_to_h(p5list_to_a('$pos1', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$MATCH', (new p5HashRef({'decl' : 'my'})), '$grammar', (new p5HashRef({'decl' : 'my'})), '$pos', (new p5HashRef({'decl' : 'my'})), '$str', (new p5HashRef({'decl' : 'my'})), '$tmp', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$@', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$^O', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$|', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%ENV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@#', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@ARGV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@_', (new p5HashRef({'decl' : 'my'}))))))))), "list"))
+r = eval(perl5_to_js(p5str(v_list_code), "Perlito5::Grammar::Use", (new p5ArrayRef(p5list_to_a((new p5HashRef(p5a_to_h(p5list_to_a('$list_code', (new p5HashRef({'decl' : 'my'})), '$m', (new p5HashRef({'decl' : 'my'})), '@list', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$list', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef({})), (new p5HashRef(p5a_to_h(p5list_to_a('$pos1', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef({})), (new p5HashRef(p5a_to_h(p5list_to_a('$pos1', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$MATCH', (new p5HashRef({'decl' : 'my'})), '$grammar', (new p5HashRef({'decl' : 'my'})), '$pos', (new p5HashRef({'decl' : 'my'})), '$str', (new p5HashRef({'decl' : 'my'})), '$tmp', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '%Perlito_internal_module', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$@', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$^O', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$|', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%ENV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@#', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@ARGV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@_', (new p5HashRef({'decl' : 'my'}))))))))), "list"))
}
catch(err) {
if ( err instanceof p5_error || err instanceof Error ) {
@@ -10006,6 +10008,9 @@ return r;
else {
if ( p5bool(p5pkg["Perlito5"]["v_EXPAND_USE"]) ) {
+ if ( (Hash_Perlito_internal_module).hasOwnProperty(v_module_name) ) {
+ (v_module_name = (Hash_Perlito_internal_module.p5hget(p5str(v_module_name))));
+ };
var v_filename;
(v_filename = (p5pkg["Perlito5::Grammar::Use"].modulename_to_filename([v_module_name], 0)));
p5pkg["Perlito5::Grammar::Use"]["require"]([p5str(v_filename), 0]);
@@ -10056,12 +10061,12 @@ return r;
(v_self = (List__.shift()));
if ( (p5str(p5call(v_self, "mod", [], 0)) == 'strict') ) {
if ( (p5str(p5call(v_self, "code", [], 0)) == 'use') ) {
- return (p5call(p5pkg["strict"], "import", [], p5want));
+ return (p5call(p5pkg["Perlito5::strict"], "import", [], p5want));
}
else {
if ( (p5str(p5call(v_self, "code", [], 0)) == 'no') ) {
- return (p5call(p5pkg["strict"], "unimport", [], p5want));
+ return (p5call(p5pkg["Perlito5::strict"], "unimport", [], p5want));
}
else {
@@ -10092,14 +10097,6 @@ return r;
};
p5for_lex(function (v_prefix) {
var v_realfilename;
- (v_realfilename = ((p5str(v_prefix) + '/Perlito5X/' + p5str(v_filename))));
- if ( p5bool(p5is_file(p5str(v_realfilename))) ) {
- p5pkg["main"]["Hash_INC"].p5hset(p5str(v_filename), (v_realfilename));
- throw(p5context(['todo'], p5want));
- };
- }, p5list_to_a(p5pkg["main"]["List_INC"], '.'), false, "");
- p5for_lex(function (v_prefix) {
- var v_realfilename;
(v_realfilename = ((p5str(v_prefix) + '/' + p5str(v_filename))));
if ( p5bool(p5is_file(p5str(v_realfilename))) ) {
p5pkg["main"]["Hash_INC"].p5hset(p5str(v_filename), (v_realfilename));
@@ -10125,9 +10122,12 @@ return r;
(v_stmt = (List__.shift()));
var v_module_name;
(v_module_name = (p5call(v_stmt, "mod", [], 0)));
- if ( (p5str(v_module_name) == 'feature') ) {
+ if ( (((p5str(v_module_name) == 'strict') || (p5str(v_module_name) == 'warnings')) || (p5str(v_module_name) == 'feature')) ) {
throw(p5context([], p5want));
};
+ if ( (Hash_Perlito_internal_module).hasOwnProperty(v_module_name) ) {
+ (v_module_name = (Hash_Perlito_internal_module.p5hget(p5str(v_module_name))));
+ };
var v_filename;
(v_filename = (p5pkg["Perlito5::Grammar::Use"].modulename_to_filename([v_module_name], 0)));
if ( (p5str(p5pkg["Perlito5::Grammar::Use"].filename_lookup([v_filename], 0)) == 'done') ) {
@@ -10193,7 +10193,7 @@ return r;
var r;
p5pkg["main"]["v_@"] = "";
try {
-r = eval(perl5_to_js(p5str(p5pkg["Perlito5::IO"].slurp(p5list_to_a(p5pkg["main"]["Hash_INC"].p5hget(p5str(v_filename))), 0)), "Perlito5::Grammar::Use", (new p5ArrayRef(p5list_to_a((new p5HashRef(p5a_to_h(p5list_to_a('$filename', (new p5HashRef({'decl' : 'my'})), '$is_bareword', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$@', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$^O', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$|', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%ENV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@#', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@ARGV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@_', (new p5HashRef({'decl' : 'my'}))))))))), ""))
+r = eval(perl5_to_js(p5str(p5pkg["Perlito5::IO"].slurp(p5list_to_a(p5pkg["main"]["Hash_INC"].p5hget(p5str(v_filename))), 0)), "Perlito5::Grammar::Use", (new p5ArrayRef(p5list_to_a((new p5HashRef(p5a_to_h(p5list_to_a('$filename', (new p5HashRef({'decl' : 'my'})), '$is_bareword', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5::Grammar::Use'})), '%Perlito_internal_module', (new p5HashRef({'decl' : 'my'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'Perlito5'})))))), (new p5HashRef(p5a_to_h(p5list_to_a('$@', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$AUTOLOAD', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$^O', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$_', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$a', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$b', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '$|', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%ENV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '%INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@#', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@ARGV', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@INC', (new p5HashRef({'decl' : 'our', 'namespace' : 'main'})), '@_', (new p5HashRef({'decl' : 'my'}))))))))), ""))
}
catch(err) {
if ( err instanceof p5_error || err instanceof Error ) {
@@ -12684,7 +12684,7 @@ return r;
;
(function () {
var p5159 = p5make_package("Perlito5::Runtime");
- // use strict
+ // use Perlito5::strict
;
if ( p5bool(p5pkg["main"]["v_]"]) ) {
null;
View
33 perlito5.pl
@@ -5257,6 +5257,7 @@ package Perlito5::Grammar::Use;
Perlito5::Precedence::add_term('use', sub {
Perlito5::Grammar::Use->term_use($_[0], $_[1])
});
+((my %Perlito_internal_module) = ('strict', 'Perlito5::strict', 'warnings', 'Perlito5::warnings', 'utf8', 'Perlito5::utf8', 'bytes', 'Perlito5::bytes', 'encoding', 'Perlito5::encoding'));
sub Perlito5::Grammar::Use::use_decl {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
@@ -5406,6 +5407,9 @@ sub Perlito5::Grammar::Use::parse_time_eval {
}
else {
if ($Perlito5::EXPAND_USE) {
+ if (exists($Perlito_internal_module{$module_name})) {
+ ($module_name = $Perlito_internal_module{$module_name})
+ };
((my $filename) = modulename_to_filename($module_name));
Perlito5::Grammar::Use::require($filename);
if (!($skip_import)) {
@@ -5433,11 +5437,11 @@ sub Perlito5::Grammar::Use::emit_time_eval {
((my $self) = shift());
if (($self->mod() eq 'strict')) {
if (($self->code() eq 'use')) {
- strict->import()
+ Perlito5::strict->import()
}
else {
if (($self->code() eq 'no')) {
- strict->unimport()
+ Perlito5::strict->unimport()
}
}
}
@@ -5456,13 +5460,6 @@ sub Perlito5::Grammar::Use::filename_lookup {
die('Compilation failed in require')
};
for my $prefix ((@INC, '.')) {
- ((my $realfilename) = ($prefix . '/Perlito5X/' . $filename));
- if (-f($realfilename)) {
- ($INC{$filename} = $realfilename);
- return ('todo')
- }
- };
- for my $prefix ((@INC, '.')) {
((my $realfilename) = ($prefix . '/' . $filename));
if (-f($realfilename)) {
($INC{$filename} = $realfilename);
@@ -5475,9 +5472,12 @@ sub Perlito5::Grammar::Use::expand_use {
((my $comp_units) = shift());
((my $stmt) = shift());
((my $module_name) = $stmt->mod());
- if (($module_name eq 'feature')) {
+ if (((($module_name eq 'strict') || ($module_name eq 'warnings')) || ($module_name eq 'feature'))) {
return ()
};
+ if (exists($Perlito_internal_module{$module_name})) {
+ ($module_name = $Perlito_internal_module{$module_name})
+ };
((my $filename) = modulename_to_filename($module_name));
if ((filename_lookup($filename) eq 'done')) {
return ()
@@ -11718,9 +11718,20 @@ package Perlito5::AST::Use;
# use Perlito5::Precedence
;
package main;
+package Perlito5::strict;
+sub Perlito5::strict::import {
+ ($Perlito5::STRICT = 1)
+};
+sub Perlito5::strict::unimport {
+ ($Perlito5::STRICT = 0)
+};
+1;
+
+;
+package main;
package Perlito5::Runtime;
-# use strict
+# use Perlito5::strict
;
if (${'main::]'}) {
View
34 src5/lib/Perlito5/Grammar/Use.pm
@@ -7,6 +7,16 @@ use Perlito5::Grammar;
Perlito5::Precedence::add_term( 'no' => sub { Perlito5::Grammar::Use->term_use($_[0], $_[1]) } );
Perlito5::Precedence::add_term( 'use' => sub { Perlito5::Grammar::Use->term_use($_[0], $_[1]) } );
+
+my %Perlito_internal_module = (
+ strict => 'Perlito5::strict',
+ warnings => 'Perlito5::warnings',
+ utf8 => 'Perlito5::utf8',
+ bytes => 'Perlito5::bytes',
+ encoding => 'Perlito5::encoding',
+);
+
+
token use_decl { 'use' | 'no' };
token term_use {
@@ -78,6 +88,9 @@ sub parse_time_eval {
if ( $Perlito5::EXPAND_USE ) {
# normal "use" is not disabled, go for it
+ $module_name = $Perlito_internal_module{$module_name}
+ if exists $Perlito_internal_module{$module_name};
+
# "require" the module
my $filename = modulename_to_filename($module_name);
# warn "# require $filename\n";
@@ -112,10 +125,10 @@ sub emit_time_eval {
if ($self->mod eq 'strict') {
if ($self->code eq 'use') {
- strict->import();
+ Perlito5::strict->import();
}
elsif ($self->code eq 'no') {
- strict->unimport();
+ Perlito5::strict->unimport();
}
}
}
@@ -135,14 +148,6 @@ sub filename_lookup {
}
for my $prefix (@INC, '.') {
- my $realfilename = "$prefix/Perlito5X/$filename";
- if (-f $realfilename) {
- $INC{$filename} = $realfilename;
- return "todo";
- }
- }
-
- for my $prefix (@INC, '.') {
my $realfilename = "$prefix/$filename";
if (-f $realfilename) {
$INC{$filename} = $realfilename;
@@ -157,10 +162,13 @@ sub expand_use {
my $stmt = shift;
my $module_name = $stmt->mod;
-
- # TODO - support 'use feature'
return
- if $module_name eq 'feature';
+ if $module_name eq 'strict'
+ || $module_name eq 'warnings'
+ || $module_name eq 'feature';
+
+ $module_name = $Perlito_internal_module{$module_name}
+ if exists $Perlito_internal_module{$module_name};
my $filename = modulename_to_filename($module_name);
View
2 src5/lib/Perlito5/Runtime.pm
@@ -1,6 +1,6 @@
package Perlito5::Runtime;
-use strict;
+use Perlito5::strict;
$] = 5.014001
unless $];
View
38 src5/lib/Perlito5X/Test.pm → src5/lib/Perlito5/Test.pm
@@ -1,4 +1,4 @@
-package Test;
+package Perlito5::Test;
### GLOBALS
@@ -26,7 +26,7 @@ sub ok {
my $desc = shift;
my $todo = shift;
my $depends = shift;
- Test::proclaim( $cond, 'ok! ' . $desc, $todo, $depends );
+ Perlito5::Test::proclaim( $cond, 'ok! ' . $desc, $todo, $depends );
}
sub is {
@@ -37,7 +37,7 @@ sub is {
my $depends = shift;
my $test = $got eq $expected;
- Test::proclaim( $test, 'is! ' . $desc, $todo, $got, $expected, $depends );
+ Perlito5::Test::proclaim( $test, 'is! ' . $desc, $todo, $got, $expected, $depends );
}
sub is_deeply {
@@ -52,7 +52,7 @@ sub is_deeply {
my $expected_perl = $expected;
my $test = ( $got_perl eq $expected_perl );
- Test::proclaim( $test, "is deeply! $desc", $todo, $got_perl, $expected_perl, $depends );
+ Perlito5::Test::proclaim( $test, "is deeply! $desc", $todo, $got_perl, $expected_perl, $depends );
}
sub isnt {
@@ -63,7 +63,7 @@ sub isnt {
my $depends = shift;
my $test = !( $got eq $expected );
- Test::proclaim( $test, "isnt! $desc", $todo, $got, $expected, $depends, { negate => 1 } );
+ Perlito5::Test::proclaim( $test, "isnt! $desc", $todo, $got, $expected, $depends, { negate => 1 } );
}
sub cmp_ok {
@@ -74,60 +74,60 @@ sub cmp_ok {
my $todo = shift;
my $depends = shift;
- say "### Test::cmp_ok not implemented";
+ say "### Perlito5::Test::cmp_ok not implemented";
}
sub like {
- say "### Test::like not implemented";
+ say "### Perlito5::Test::like not implemented";
}
sub unlike {
- say "### Test::unlike not implemented";
+ say "### Perlito5::Test::unlike not implemented";
}
sub eval_dies_ok {
- say "### Test::eval_dies_ok not implemented";
+ say "### Perlito5::Test::eval_dies_ok not implemented";
}
sub isa_ok {
- say "### Test::isa_ok not implemented";
+ say "### Perlito5::Test::isa_ok not implemented";
}
sub use_ok {
- say "### Test::use_ok not implemented";
+ say "### Perlito5::Test::use_ok not implemented";
}
sub throws_ok {
- say "### Test::throws_ok not implemented";
+ say "### Perlito5::Test::throws_ok not implemented";
}
sub dies_ok {
- say "### Test::dies_ok not implemented";
+ say "### Perlito5::Test::dies_ok not implemented";
}
sub lives_ok {
- say "### Test::lives_ok not implemented";
+ say "### Perlito5::Test::lives_ok not implemented";
}
## misc. test utilities
sub skip {
my $reason = shift;
my $depends = shift;
- Test::proclaim( 1, '', "skip " . $reason, $depends );
+ Perlito5::Test::proclaim( 1, '', "skip " . $reason, $depends );
}
sub pass {
my $desc = shift;
- Test::proclaim( 1, 'pass! ' . $desc );
+ Perlito5::Test::proclaim( 1, 'pass! ' . $desc );
}
sub flunk {
my $desc = shift;
my $todo = shift;
my $depends = shift;
- Test::proclaim( 0, 'flunk! ' . $desc, $todo, $depends );
+ Perlito5::Test::proclaim( 0, 'flunk! ' . $desc, $todo, $depends );
}
## 'private' subs
@@ -149,7 +149,7 @@ sub proclaim {
}
else {
say "not ok ", $num_of_tests_run;
- Test::report_failure( $todo, $got, $expected, $negate );
+ Perlito5::Test::report_failure( $todo, $got, $expected, $negate );
}
return $cond;
@@ -161,7 +161,7 @@ sub report_failure {
my $expected = shift;
my $negate = shift;
- say "### Test::report_failure not implemented";
+ say "### Perlito5::Test::report_failure not implemented";
}
sub test_ends {
View
2 src5/lib/Perlito5X/bytes.pm → src5/lib/Perlito5/bytes.pm
@@ -1,4 +1,4 @@
-package bytes;
+package Perlito5::bytes;
sub import {
$Perlito5::BYTES = 1;
View
2 src5/lib/Perlito5X/encoding.pm → src5/lib/Perlito5/encoding.pm
@@ -1,4 +1,4 @@
-package encoding;
+package Perlito5::encoding;
sub import {
$Perlito5::ENCODING = undef;
View
2 src5/lib/Perlito5X/strict.pm → src5/lib/Perlito5/strict.pm
@@ -1,4 +1,4 @@
-package strict;
+package Perlito5::strict;
sub import {
$Perlito5::STRICT = 1;
View
2 src5/lib/Perlito5X/utf8.pm → src5/lib/Perlito5/utf8.pm
@@ -1,4 +1,4 @@
-package utf8;
+package Perlito5::utf8;
sub import {
$Perlito5::UTF8 = 1;
View
2 src5/lib/Perlito5X/warnings.pm → src5/lib/Perlito5/warnings.pm
@@ -1,4 +1,4 @@
-package warnings;
+package Perlito5::warnings;
sub import {
$Perlito5::WARNINGS = 1;
View
4 src5/util/perlito5-browser.pl
@@ -1,7 +1,7 @@
package Perlito5;
-use strict ();
-use warnings ();
+use Perlito5::strict ();
+use Perlito5::warnings ();
use Perlito5::Match;
use Perlito5::Javascript2::Emitter;
View
7 t5/01-perlito/21-test.t
@@ -1,5 +1,4 @@
-use Test;
-
-Test::plan 1;
-Test::ok( 1==1, "Test.pm works");
+use Perlito5::Test;
+Perlito5::Test::plan 1;
+Perlito5::Test::ok( 1==1, "Perlito::Test works");

0 comments on commit 1f09a80

Please sign in to comment.
Something went wrong with that request. Please try again.