Browse files

Perlito5 - add $ENV{PERL5LIB} to @INC

  • Loading branch information...
1 parent 8d71fff commit 4d56b5d868f31484893502fe7e9d4d1bc0b9ea47 @fglock committed May 4, 2012
Showing with 15 additions and 7 deletions.
  1. +1 −0 ChangeLog
  2. +3 −6 TODO-perlito5
  3. +4 −0 html/perlito5.js
  4. +4 −1 perlito5.pl
  5. +1 −0 src5/lib/Perlito5/Javascript/CORE.pm
  6. +2 −0 src5/lib/Perlito5/Runtime.pm
View
1 ChangeLog
@@ -5,6 +5,7 @@ dev 2012-04-12
-- option "-B" is now the default; this executes immediately: perlito5 -e 'say "ok"'
-- option "-MO=Deparse":
$ node perlito5.js -Isrc5/lib -MO=Deparse -e ' while (1) { say "works" } '
+-- environment variable PERL5LIB=src5/lib now works
- parser:
View
9 TODO-perlito5
@@ -3,12 +3,6 @@ TODO list for Perlito5
* perlito5 command-line
--- search for modules in PERL5LIB
- perlito5 own directories must be searched first (perlito5 defines it's own strict.pm)
- maybe search PERLITO5LIB first
- alternately, check $^H for strictness - such that perl's own strict.pm just works
- and ${^WARNING_BITS} for warnings
-
* libraries
@@ -32,6 +26,9 @@ TODO list for Perlito5
Tie::Hash
Tie::Scalar
+ alternately, check $^H for strictness - such that perl's own strict.pm just works
+ and ${^WARNING_BITS} for warnings
+
* Parser
View
4 html/perlito5.js
@@ -993,6 +993,7 @@ CORE.split = function(List__) {
}
return res;
}
+ return s.split(pattern);
}
CORE.die(["not implemented"]);
};
@@ -11804,6 +11805,9 @@ return r;
(p5pkg["Perlito5"]["v_WARNINGS"] = (0));
(p5pkg["Perlito5"]["v_UTF8"] = (0));
(p5pkg["Perlito5"]["v_BYTES"] = (0));
+ p5for(p5pkg["Perlito5::Runtime"], function () {
+ p5pkg["Perlito5::Runtime"].push([p5pkg["main"]["List_INC"], [p5pkg["Perlito5::Runtime"]["v__"]]], null);
+ }, p5list_to_a(p5pkg["Perlito5::Runtime"].split(p5list_to_a(':', p5or(p5pkg["main"]["Hash_ENV"]['PERL5LIB'], function () { return '' })), 1)), false, "");
(p5pkg["Perlito5"]["v_SPECIAL_VAR"] = ((new p5HashRef(p5a_to_h(p5list_to_a('$_', 'ARG', '$&', '$MATCH', '$`', '$PREMATCH', '$' + String.fromCharCode(39), '$POSTMATCH', '$+', '$LAST_PAREN_MATCH', '@+', '@LAST_MATCH_END', '%+', '%LAST_PAREN_MATCH', '@-', '@LAST_MATCH_START', '$|', 'autoflush', '$/', '$RS', '@_', '@ARG', '< $', '$EUID', '$.', '$NR', '< $< ', '$UID', '$(', '$GID', '$#', null, '$@', '$EVAL_ERROR', '$=', '$FORMAT_LINES_PER_PAGE', '$,', '$OFS', '$?', '$CHILD_ERROR', '$*', null, '$[', null, '$$', '$PID', '%-', null, '$~', '$FORMAT_NAME', '$-', '$FORMAT_LINES_LEFT', '$&', '$MATCH', '$%', '$FORMAT_PAGE_NUMBER', '$)', '$EGID', '$]', null, '$!', '$ERRNO', '$;', '$SUBSEP', '$' + String.fromCharCode(92), '$ORS', '%!', null, '$"', '$LIST_SEPARATOR', '$_', '$ARG', '$:', 'FORMAT_LINE_BREAK_CHARACTERS'))))));
(p5pkg["Perlito5"]["v_CORE_PROTO"] = ((new p5HashRef(p5a_to_h(p5list_to_a('CORE::shutdown', '*$', 'CORE::chop', null, 'CORE::lstat', '*', 'CORE::rename', '$$', 'CORE::lock', String.fromCharCode(92) + '$', 'CORE::rand', ';$', 'CORE::gmtime', ';$', 'CORE::gethostbyname', '$', 'CORE::each', String.fromCharCode(92) + '[@%]', 'CORE::ref', '_', 'CORE::syswrite', '*$;$$', 'CORE::msgctl', '$$$', 'CORE::getnetbyname', '$', 'CORE::write', ';*', 'CORE::alarm', '_', 'CORE::print', null, 'CORE::getnetent', '', 'CORE::semget', '$$$', 'CORE::use', null, 'CORE::abs', '_', 'CORE::break', '', 'CORE::undef', null, 'CORE::no', null, 'CORE::eval', null, 'CORE::split', null, 'CORE::localtime', ';$', 'CORE::sort', null, 'CORE::chown', '@', 'CORE::endpwent', '', 'CORE::getpwent', '', 'CORE::pos', null, 'CORE::lcfirst', '_', 'CORE::kill', '@', 'CORE::send', '*$$;$', 'CORE::endprotoent', '', 'CORE::semctl', '$$$$', 'CORE::waitpid', '$$', 'CORE::utime', '@', 'CORE::dbmclose', String.fromCharCode(92) + '%', 'CORE::getpwnam', '$', 'CORE::substr', '$$;$$', 'CORE::listen', '*$', 'CORE::getprotoent', '', 'CORE::shmget', '$$$', 'CORE::our', null, 'CORE::readlink', '_', 'CORE::shmwrite', '$$$$', 'CORE::times', '', 'CORE::package', null, 'CORE::map', null, 'CORE::join', '$@', 'CORE::rmdir', '_', 'CORE::shmread', '$$$$', 'CORE::uc', '_', 'CORE::bless', '$;$', 'CORE::closedir', '*', 'CORE::getppid', '', 'CORE::tie', null, 'CORE::readdir', '*', 'CORE::gethostent', '', 'CORE::getlogin', '', 'CORE::last', null, 'CORE::gethostbyaddr', '$$', 'CORE::accept', '**', 'CORE::log', '_', 'CORE::tell', ';*', 'CORE::readline', ';*', 'CORE::tied', null, 'CORE::socket', '*$$$', 'CORE::umask', ';$', 'CORE::sysread', '*' + String.fromCharCode(92) + '$$;$', 'CORE::syscall', '$@', 'CORE::quotemeta', '_', 'CORE::dump', '', 'CORE::opendir', '*$', 'CORE::untie', null, 'CORE::truncate', '$$', 'CORE::select', ';*', 'CORE::sleep', ';$', 'CORE::seek', '*$$', 'CORE::read', '*' + String.fromCharCode(92) + '$$;$', 'CORE::rewinddir', '*', 'CORE::scalar', null, 'CORE::wantarray', '', 'CORE::oct', '_', 'CORE::bind', '*$', 'CORE::stat', '*', 'CORE::sqrt', '_', 'CORE::getc', ';*', 'CORE::fileno', '*', 'CORE::getpeername', '*', 'CORE::sin', '_', 'CORE::getnetbyaddr', '$$', 'CORE::grep', null, 'CORE::setservent', '$', 'CORE::sub', null, 'CORE::shmctl', '$$$', 'CORE::study', null, 'CORE::msgrcv', '$$$$$', 'CORE::setsockopt', '*$$$', 'CORE::int', '_', 'CORE::pop', ';' + String.fromCharCode(92) + '@', 'CORE::link', '$$', 'CORE::exec', null, 'CORE::setpwent', '', 'CORE::mkdir', '_;$', 'CORE::sysseek', '*$$', 'CORE::endservent', '', 'CORE::chr', '_', 'CORE::when', null, 'CORE::getpwuid', '$', 'CORE::setprotoent', '$', 'CORE::reverse', '@', 'CORE::say', null, 'CORE::goto', null, 'CORE::getgrent', '', 'CORE::endnetent', '', 'CORE::hex', '_', 'CORE::binmode', '*;$', 'CORE::formline', '$@', 'CORE::getgrnam', '$', 'CORE::ucfirst', '_', 'CORE::chdir', ';$', 'CORE::setnetent', '$', 'CORE::splice', String.fromCharCode(92) + '@;$$@', 'CORE::unlink', '@', 'CORE::time', '', 'CORE::push', String.fromCharCode(92) + '@@', 'CORE::exit', ';$', 'CORE::endgrent', '', 'CORE::unshift', String.fromCharCode(92) + '@@', 'CORE::local', null, 'CORE::my', null, 'CORE::cos', '_', 'CORE::redo', null, 'CORE::warn', '@', 'CORE::getsockname', '*', 'CORE::pipe', '**', 'CORE::sprintf', '$@', 'CORE::open', '*;$@', 'CORE::setpgrp', ';$$', 'CORE::exp', '_', 'CORE::seekdir', '*$', 'CORE::getservbyport', '$$', 'CORE::given', null, 'CORE::pack', '$@', 'CORE::msgget', '$$', 'CORE::rindex', '$$;$', 'CORE::srand', ';$', 'CORE::telldir', '*', 'CORE::connect', '*$', 'CORE::getprotobyname', '$', 'CORE::msgsnd', '$$$', 'CORE::length', '_', 'CORE::state', null, 'CORE::die', '@', 'CORE::delete', null, 'CORE::getservent', '', 'CORE::getservbyname', '$$', 'CORE::setpriority', '$$$', 'CORE::lc', '_', 'CORE::fcntl', '*$$', 'CORE::chroot', '_', 'CORE::recv', '*' + String.fromCharCode(92) + '$$$', 'CORE::dbmopen', String.fromCharCode(92) + '%$$', 'CORE::socketpair', '**$$$', 'CORE::vec', '$$$', 'CORE::system', null, 'CORE::defined', '_', 'CORE::index', '$$;$', 'CORE::caller', ';$', 'CORE::close', ';*', 'CORE::atan2', '$$', 'CORE::semop', '$$', 'CORE::unpack', '$;$', 'CORE::ord', '_', 'CORE::chmod', '@', 'CORE::prototype', null, 'CORE::getprotobynumber', '$', 'CORE::values', String.fromCharCode(92) + '[@%]', 'CORE::chomp', null, 'CORE::ioctl', '*$$', 'CORE::eof', ';*', 'CORE::crypt', '$$', 'CORE::do', null, 'CORE::flock', '*$', 'CORE::wait', '', 'CORE::sethostent', '$', 'CORE::return', null, 'CORE::getsockopt', '*$$', 'CORE::fork', '', 'CORE::require', null, 'CORE::format', null, 'CORE::readpipe', '_', 'CORE::endhostent', '', 'CORE::getpgrp', ';$', 'CORE::setgrent', '', 'CORE::keys', String.fromCharCode(92) + '[@%]', 'CORE::glob', null, 'CORE::getpriority', '$$', 'CORE::reset', ';$', 'CORE::sysopen', '*$$;$', 'CORE::continue', '', 'CORE::next', null, 'CORE::getgrgid', '$', 'CORE::default', null, 'CORE::shift', ';' + String.fromCharCode(92) + '@', 'CORE::symlink', '$$', 'CORE::exists', '$', 'CORE::printf', null))))));
1;
View
5 perlito5.pl
@@ -9145,7 +9145,7 @@ package main;
undef();
package Perlito5::Javascript::CORE;
sub Perlito5::Javascript::CORE::emit_javascript {
- return ((('//' . chr(10) . '//' . chr(10) . '// lib/Perlito5/Javascript/CORE.js' . chr(10) . '//' . chr(10) . '// CORE functions for "Perlito" Perl5-in-Javascript' . chr(10) . '//' . chr(10) . '// AUTHORS' . chr(10) . '//' . chr(10) . '// Flavio Soibelmann Glock fglock@gmail.com' . chr(10) . '//' . chr(10) . '// COPYRIGHT' . chr(10) . '//' . chr(10) . '// Copyright 2009, 2010, 2011, 2012 by Flavio Soibelmann Glock and others.' . chr(10) . '//' . chr(10) . '// This program is free software; you can redistribute it and/or modify it' . chr(10) . '// under the same terms as Perl itself.' . chr(10) . '//' . chr(10) . '// See http://www.perl.com/perl/misc/Artistic.html' . chr(10) . chr(10) . 'var CORE = p5pkg.CORE;' . chr(10) . chr(10) . 'var isNode = typeof require != "undefined";' . chr(10) . 'if (isNode) {' . chr(10) . ' CORE.print = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' process.stdout.write(p5str(List__[i]));' . chr(10) . ' }' . chr(10) . ' return 1;' . chr(10) . ' }' . chr(10) . '} else {' . chr(10) . ' CORE.print = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' write(p5str(List__[i]));' . chr(10) . ' }' . chr(10) . ' return 1;' . chr(10) . ' };' . chr(10) . '}' . chr(10) . chr(10) . 'CORE.say = function(List__) {' . chr(10) . ' CORE.print(List__);' . chr(10) . ' return CORE.print(["' . chr(92) . 'n"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.die = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' var s = "";' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' s = s + p5str(List__[i]);' . chr(10) . ' }' . chr(10) . ' p5pkg["main"]["v_@"] = "Died: " + s;' . chr(10) . ' throw(new p5_error("die", "Died: " + s));' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.warn = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' var s = "";' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' s = s + p5str(List__[i]);' . chr(10) . ' }' . chr(10) . ' CORE.print(["Warning: " + s + "' . chr(92) . 'n"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.bless = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var pkg_name = List__[1];' . chr(10) . ' if (typeof pkg_name === "object") {' . chr(10) . ' // bless {}, Class' . chr(10) . ' o._class_ = pkg_name;' . chr(10) . ' return o;' . chr(10) . ' }' . chr(10) . ' if (!p5pkg.hasOwnProperty(pkg_name)) {' . chr(10) . ' p5make_package(pkg_name);' . chr(10) . ' }' . chr(10) . ' o._class_ = p5pkg[pkg_name];' . chr(10) . ' return o;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.chr = function(List__) {' . chr(10) . ' var v = p5num(List__[0]);' . chr(10) . ' return String.fromCharCode(v >= 0 ? v : 65533);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.ord = function(List__) {' . chr(10) . ' return p5str(List__[0]).charCodeAt(0);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.oct = function(List__) {' . chr(10) . ' var v = List__[0];' . chr(10) . ' var b = v.substr(0,2);' . chr(10) . ' v = v.replace("_", "");' . chr(10) . ' if (b == "0b" || b == "0B") { return parseInt(v.substr(2), 2) }' . chr(10) . ' if (b == "0x" || b == "0X") { return parseInt(v.substr(2), 16) }' . chr(10) . ' return parseInt(v, 8);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.abs = function(List__) { return Math.abs(List__[0]) };' . chr(10) . 'CORE.exp = function(List__) { return Math.exp(List__[0]) };' . chr(10) . 'CORE.log = function(List__) { return Math.log(List__[0]) };' . chr(10) . 'CORE.cos = function(List__) { return Math.cos(List__[0]) };' . chr(10) . 'CORE.sin = function(List__) { return Math.sin(List__[0]) };' . chr(10) . 'CORE.sqrt = function(List__) { return Math.sqrt(List__[0]) };' . chr(10) . 'CORE.atan2 = function(List__) { return Math.atan2(List__[0], List__[1]) };' . chr(10) . 'CORE.int = function(List__) { return List__[0] > 0 ? Math.floor(List__[0]) : Math.ceil(List__[0]) };' . chr(10) . chr(10) . 'CORE.rand = function(List__) {' . chr(10) . ' var v = p5num(List__[0]) || 1;' . chr(10) . ' return Math.random() * v;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.lc = function(List__) { return p5str(List__[0]).toLowerCase() };' . chr(10) . 'CORE.uc = function(List__) { return p5str(List__[0]).toUpperCase() };' . chr(10) . chr(10) . 'CORE.lcfirst = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var c = s.length > 0 ? s.slice(0,1).toLowerCase() : "";' . chr(10) . ' s = s.length > 1 ? s.substr(1) : "";' . chr(10) . ' return c + s' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.ucfirst = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var c = s.length > 0 ? s.slice(0,1).toUpperCase() : "";' . chr(10) . ' s = s.length > 1 ? s.substr(1) : "";' . chr(10) . ' return c + s' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.quotemeta = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var out = [];' . chr(10) . ' for(var i = 0; i < s.length; i++) {' . chr(10) . ' if (s.substr(i, 1).match(/[^0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz]/)) {' . chr(10) . ' out.push(String.fromCharCode(92));' . chr(10) . ' }' . chr(10) . ' out.push(s.substr(i, 1));' . chr(10) . ' }' . chr(10) . ' return out.join(""); ' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.substr = function(List__) {' . chr(10) . ' var expr = List__[0];' . chr(10) . ' var offset = List__[1];' . chr(10) . ' var length = List__[2];' . chr(10) . ' var replacement = List__[3];' . chr(10) . ' if (length < 0) {' . chr(10) . ' var s = p5str(expr);' . chr(10) . ' length = s.length - offset + length;' . chr(10) . ' } ' . chr(10) . ' return p5str(expr).substr(offset, length);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.values = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' delete o["_each_"];' . chr(10) . ' if (p5want) {' . chr(10) . ' if (o == null) {' . chr(10) . ' return [];' . chr(10) . ' };' . chr(10) . ' if (typeof o.values === "function") {' . chr(10) . ' return o.values();' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for (var i in o) {' . chr(10) . ' out.push(o[i]);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . ' return CORE.keys(List__, p5want);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.keys = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' delete o["_each_"];' . chr(10) . ' if (p5want) {' . chr(10) . ' if (o == null) {' . chr(10) . ' return [];' . chr(10) . ' }' . chr(10) . ' if (typeof o.keys === "function") {' . chr(10) . ' return o.keys();' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for (var i in o) {' . chr(10) . ' out.push(i);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . ' else {' . chr(10) . ' if (o == null) {' . chr(10) . ' return 0;' . chr(10) . ' }' . chr(10) . ' if (typeof o.keys === "function") {' . chr(10) . ' return CORE.scalar([o.keys()]);' . chr(10) . ' }' . chr(10) . ' var out = 0;' . chr(10) . ' for (var i in o) {' . chr(10) . ' out++;' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.each = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.hasOwnProperty("_each_")) {' . chr(10) . ' return o._each_(p5want)' . chr(10) . ' }' . chr(10) . ' var keys = CORE.keys([o], 1);' . chr(10) . ' var i = 0;' . chr(10) . ' o._each_ = function () {' . chr(10) . ' if (i < keys.length) {' . chr(10) . ' i++;' . chr(10) . ' return p5want ? [keys[i-1], o[keys[i-1]]] : keys[i-1];' . chr(10) . ' }' . chr(10) . ' i = 0;' . chr(10) . ' return p5want ? [] : null;' . chr(10) . ' };' . chr(10) . ' return o._each_(p5want);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.reverse = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o == null) {' . chr(10) . ' return "";' . chr(10) . ' }' . chr(10) . ' if (typeof o === "string") {' . chr(10) . ' return o.split("").reverse().join("")' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for(var i = 0; i < o.length; i++) {' . chr(10) . ' out.unshift(o[i]);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.splice = function(List__, p5want) {' . chr(10) . ' var array = List__.shift();' . chr(10) . ' // CORE.say([ array ]);' . chr(10) . ' var offset = p5num(List__.shift());' . chr(10) . ' var limit = List__.length ? p5num(List__.shift()) : (array.length + 1);' . chr(10) . chr(10) . ' if (limit < 0) {' . chr(10) . ' limit = array.length + limit - 1;' . chr(10) . ' }' . chr(10) . chr(10) . ' var list = [offset, limit];' . chr(10) . ' for(var i = 0; i < List__.length; i++) {' . chr(10) . ' list = p5list_to_a( list, List__[i]);' . chr(10) . ' }' . chr(10) . chr(10) . ' out = array.splice.apply(array, list);' . chr(10) . ' // CORE.say([ CORE.join([":",array]), " ofs=", offset, " lim=", limit, " list=", list, " out=", CORE.join([":",out]) ]);' . chr(10) . ' return p5want ? out : out.pop();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.pop = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.length == null) {' . chr(10) . ' return null;' . chr(10) . ' }' . chr(10) . ' return o.pop();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.shift = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.length == null) {' . chr(10) . ' return null;' . chr(10) . ' }' . chr(10) . ' return o.shift();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.push = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var v = List__[1];' . chr(10) . ' for(var i = 0; i < v.length; i++) {' . chr(10) . ' o.push(v[i]);' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.unshift = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var v = List__[1];' . chr(10) . ' for(var i = v.length-1; i >= 0; i--) {' . chr(10) . ' o.unshift(v[i]);' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.join = function(List__) {' . chr(10) . ' var s = List__[0];' . chr(10) . ' var o = List__[1];' . chr(10) . ' return o.join(s);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.index = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' try {' . chr(10) . ' return o.indexOf(s, p5num(List__[2]));' . chr(10) . ' }' . chr(10) . ' catch(err) {' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . 'CORE.rindex = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' try {' . chr(10) . ' if (List__.length > 2) {' . chr(10) . ' var i = p5num(List__[2]);' . chr(10) . ' if (i < 0) {' . chr(10) . ' if (s.length == 0) {' . chr(10) . ' return 0;' . chr(10) . ' }' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . ' return o.lastIndexOf(s, i);' . chr(10) . ' }' . chr(10) . ' return o.lastIndexOf(s);' . chr(10) . ' }' . chr(10) . ' catch(err) {' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.length = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (typeof o.string === "function") {' . chr(10) . ' return o.string().length;' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.pack = function(List__) { CORE.warn([ "CORE::pack not implemented" ]) };' . chr(10) . 'CORE.unpack = function(List__) { CORE.warn([ "CORE::unpack not implemented" ]) };' . chr(10) . 'CORE.sprintf = function(List__) { CORE.warn([ "CORE::sprintf not implemented" ]) };' . chr(10) . chr(10) . 'CORE.ref = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o == null) {' . chr(10) . ' return "";' . chr(10) . ' }' . chr(10) . ' if (o._class_ && typeof o._class_._ref_ === "string") {' . chr(10) . ' // blessed reference' . chr(10) . ' return o._class_._ref_;' . chr(10) . ' }' . chr(10) . ' if (typeof o._ref_ === "string") {' . chr(10) . ' // un-blessed reference' . chr(10) . ' return o._ref_;' . chr(10) . ' }' . chr(10) . ' if (typeof o === "function") {' . chr(10) . ' return "CODE";' . chr(10) . ' }' . chr(10) . ' return "";' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.split = function(List__) {' . chr(10) . ' var pattern = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' var limit = List__[2];' . chr(10) . ' if (typeof pattern === "string") {' . chr(10) . ' if (pattern == " ") {' . chr(10) . ' var res = [];' . chr(10) . ' for (var i_ = 0, a_ = s.split(/(?: |' . chr(92) . 'n)+/); i_ < a_.length ; i_++) {' . chr(10) . ' if (a_[i_] != "") {' . chr(10) . ' res.push(a_[i_])' . chr(10) . ' }' . chr(10) . ' }' . chr(10) . ' return res;' . chr(10) . ' }' . chr(10) . ' }' . chr(10) . ' CORE.die(["not implemented"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.prototype = function(List__, data) {' . chr(10) . ' var name = List__[0];' . chr(10) . ' // TODO - fully qualify "name" using information from "data"' . chr(10) . ' // XXX - lookup in CORE::GLOBAL?' . chr(10) . ' p5pkg["Perlito5"].v_PROTO._hash_[name] || p5pkg["Perlito5"].v_CORE_PROTO._hash_[name]' . chr(10) . '};' . chr(10) . chr(10))))
+ return ((('//' . chr(10) . '//' . chr(10) . '// lib/Perlito5/Javascript/CORE.js' . chr(10) . '//' . chr(10) . '// CORE functions for "Perlito" Perl5-in-Javascript' . chr(10) . '//' . chr(10) . '// AUTHORS' . chr(10) . '//' . chr(10) . '// Flavio Soibelmann Glock fglock@gmail.com' . chr(10) . '//' . chr(10) . '// COPYRIGHT' . chr(10) . '//' . chr(10) . '// Copyright 2009, 2010, 2011, 2012 by Flavio Soibelmann Glock and others.' . chr(10) . '//' . chr(10) . '// This program is free software; you can redistribute it and/or modify it' . chr(10) . '// under the same terms as Perl itself.' . chr(10) . '//' . chr(10) . '// See http://www.perl.com/perl/misc/Artistic.html' . chr(10) . chr(10) . 'var CORE = p5pkg.CORE;' . chr(10) . chr(10) . 'var isNode = typeof require != "undefined";' . chr(10) . 'if (isNode) {' . chr(10) . ' CORE.print = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' process.stdout.write(p5str(List__[i]));' . chr(10) . ' }' . chr(10) . ' return 1;' . chr(10) . ' }' . chr(10) . '} else {' . chr(10) . ' CORE.print = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' write(p5str(List__[i]));' . chr(10) . ' }' . chr(10) . ' return 1;' . chr(10) . ' };' . chr(10) . '}' . chr(10) . chr(10) . 'CORE.say = function(List__) {' . chr(10) . ' CORE.print(List__);' . chr(10) . ' return CORE.print(["' . chr(92) . 'n"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.die = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' var s = "";' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' s = s + p5str(List__[i]);' . chr(10) . ' }' . chr(10) . ' p5pkg["main"]["v_@"] = "Died: " + s;' . chr(10) . ' throw(new p5_error("die", "Died: " + s));' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.warn = function(List__) {' . chr(10) . ' var i;' . chr(10) . ' var s = "";' . chr(10) . ' for (i = 0; i < List__.length; i++) {' . chr(10) . ' s = s + p5str(List__[i]);' . chr(10) . ' }' . chr(10) . ' CORE.print(["Warning: " + s + "' . chr(92) . 'n"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.bless = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var pkg_name = List__[1];' . chr(10) . ' if (typeof pkg_name === "object") {' . chr(10) . ' // bless {}, Class' . chr(10) . ' o._class_ = pkg_name;' . chr(10) . ' return o;' . chr(10) . ' }' . chr(10) . ' if (!p5pkg.hasOwnProperty(pkg_name)) {' . chr(10) . ' p5make_package(pkg_name);' . chr(10) . ' }' . chr(10) . ' o._class_ = p5pkg[pkg_name];' . chr(10) . ' return o;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.chr = function(List__) {' . chr(10) . ' var v = p5num(List__[0]);' . chr(10) . ' return String.fromCharCode(v >= 0 ? v : 65533);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.ord = function(List__) {' . chr(10) . ' return p5str(List__[0]).charCodeAt(0);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.oct = function(List__) {' . chr(10) . ' var v = List__[0];' . chr(10) . ' var b = v.substr(0,2);' . chr(10) . ' v = v.replace("_", "");' . chr(10) . ' if (b == "0b" || b == "0B") { return parseInt(v.substr(2), 2) }' . chr(10) . ' if (b == "0x" || b == "0X") { return parseInt(v.substr(2), 16) }' . chr(10) . ' return parseInt(v, 8);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.abs = function(List__) { return Math.abs(List__[0]) };' . chr(10) . 'CORE.exp = function(List__) { return Math.exp(List__[0]) };' . chr(10) . 'CORE.log = function(List__) { return Math.log(List__[0]) };' . chr(10) . 'CORE.cos = function(List__) { return Math.cos(List__[0]) };' . chr(10) . 'CORE.sin = function(List__) { return Math.sin(List__[0]) };' . chr(10) . 'CORE.sqrt = function(List__) { return Math.sqrt(List__[0]) };' . chr(10) . 'CORE.atan2 = function(List__) { return Math.atan2(List__[0], List__[1]) };' . chr(10) . 'CORE.int = function(List__) { return List__[0] > 0 ? Math.floor(List__[0]) : Math.ceil(List__[0]) };' . chr(10) . chr(10) . 'CORE.rand = function(List__) {' . chr(10) . ' var v = p5num(List__[0]) || 1;' . chr(10) . ' return Math.random() * v;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.lc = function(List__) { return p5str(List__[0]).toLowerCase() };' . chr(10) . 'CORE.uc = function(List__) { return p5str(List__[0]).toUpperCase() };' . chr(10) . chr(10) . 'CORE.lcfirst = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var c = s.length > 0 ? s.slice(0,1).toLowerCase() : "";' . chr(10) . ' s = s.length > 1 ? s.substr(1) : "";' . chr(10) . ' return c + s' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.ucfirst = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var c = s.length > 0 ? s.slice(0,1).toUpperCase() : "";' . chr(10) . ' s = s.length > 1 ? s.substr(1) : "";' . chr(10) . ' return c + s' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.quotemeta = function(List__) {' . chr(10) . ' var s = p5str(List__[0]);' . chr(10) . ' var out = [];' . chr(10) . ' for(var i = 0; i < s.length; i++) {' . chr(10) . ' if (s.substr(i, 1).match(/[^0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz]/)) {' . chr(10) . ' out.push(String.fromCharCode(92));' . chr(10) . ' }' . chr(10) . ' out.push(s.substr(i, 1));' . chr(10) . ' }' . chr(10) . ' return out.join(""); ' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.substr = function(List__) {' . chr(10) . ' var expr = List__[0];' . chr(10) . ' var offset = List__[1];' . chr(10) . ' var length = List__[2];' . chr(10) . ' var replacement = List__[3];' . chr(10) . ' if (length < 0) {' . chr(10) . ' var s = p5str(expr);' . chr(10) . ' length = s.length - offset + length;' . chr(10) . ' } ' . chr(10) . ' return p5str(expr).substr(offset, length);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.values = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' delete o["_each_"];' . chr(10) . ' if (p5want) {' . chr(10) . ' if (o == null) {' . chr(10) . ' return [];' . chr(10) . ' };' . chr(10) . ' if (typeof o.values === "function") {' . chr(10) . ' return o.values();' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for (var i in o) {' . chr(10) . ' out.push(o[i]);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . ' return CORE.keys(List__, p5want);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.keys = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' delete o["_each_"];' . chr(10) . ' if (p5want) {' . chr(10) . ' if (o == null) {' . chr(10) . ' return [];' . chr(10) . ' }' . chr(10) . ' if (typeof o.keys === "function") {' . chr(10) . ' return o.keys();' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for (var i in o) {' . chr(10) . ' out.push(i);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . ' else {' . chr(10) . ' if (o == null) {' . chr(10) . ' return 0;' . chr(10) . ' }' . chr(10) . ' if (typeof o.keys === "function") {' . chr(10) . ' return CORE.scalar([o.keys()]);' . chr(10) . ' }' . chr(10) . ' var out = 0;' . chr(10) . ' for (var i in o) {' . chr(10) . ' out++;' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.each = function(List__, p5want) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.hasOwnProperty("_each_")) {' . chr(10) . ' return o._each_(p5want)' . chr(10) . ' }' . chr(10) . ' var keys = CORE.keys([o], 1);' . chr(10) . ' var i = 0;' . chr(10) . ' o._each_ = function () {' . chr(10) . ' if (i < keys.length) {' . chr(10) . ' i++;' . chr(10) . ' return p5want ? [keys[i-1], o[keys[i-1]]] : keys[i-1];' . chr(10) . ' }' . chr(10) . ' i = 0;' . chr(10) . ' return p5want ? [] : null;' . chr(10) . ' };' . chr(10) . ' return o._each_(p5want);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.reverse = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o == null) {' . chr(10) . ' return "";' . chr(10) . ' }' . chr(10) . ' if (typeof o === "string") {' . chr(10) . ' return o.split("").reverse().join("")' . chr(10) . ' }' . chr(10) . ' var out = [];' . chr(10) . ' for(var i = 0; i < o.length; i++) {' . chr(10) . ' out.unshift(o[i]);' . chr(10) . ' }' . chr(10) . ' return out;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.splice = function(List__, p5want) {' . chr(10) . ' var array = List__.shift();' . chr(10) . ' // CORE.say([ array ]);' . chr(10) . ' var offset = p5num(List__.shift());' . chr(10) . ' var limit = List__.length ? p5num(List__.shift()) : (array.length + 1);' . chr(10) . chr(10) . ' if (limit < 0) {' . chr(10) . ' limit = array.length + limit - 1;' . chr(10) . ' }' . chr(10) . chr(10) . ' var list = [offset, limit];' . chr(10) . ' for(var i = 0; i < List__.length; i++) {' . chr(10) . ' list = p5list_to_a( list, List__[i]);' . chr(10) . ' }' . chr(10) . chr(10) . ' out = array.splice.apply(array, list);' . chr(10) . ' // CORE.say([ CORE.join([":",array]), " ofs=", offset, " lim=", limit, " list=", list, " out=", CORE.join([":",out]) ]);' . chr(10) . ' return p5want ? out : out.pop();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.pop = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.length == null) {' . chr(10) . ' return null;' . chr(10) . ' }' . chr(10) . ' return o.pop();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.shift = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o.length == null) {' . chr(10) . ' return null;' . chr(10) . ' }' . chr(10) . ' return o.shift();' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.push = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var v = List__[1];' . chr(10) . ' for(var i = 0; i < v.length; i++) {' . chr(10) . ' o.push(v[i]);' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.unshift = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var v = List__[1];' . chr(10) . ' for(var i = v.length-1; i >= 0; i--) {' . chr(10) . ' o.unshift(v[i]);' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.join = function(List__) {' . chr(10) . ' var s = List__[0];' . chr(10) . ' var o = List__[1];' . chr(10) . ' return o.join(s);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.index = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' try {' . chr(10) . ' return o.indexOf(s, p5num(List__[2]));' . chr(10) . ' }' . chr(10) . ' catch(err) {' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . 'CORE.rindex = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' try {' . chr(10) . ' if (List__.length > 2) {' . chr(10) . ' var i = p5num(List__[2]);' . chr(10) . ' if (i < 0) {' . chr(10) . ' if (s.length == 0) {' . chr(10) . ' return 0;' . chr(10) . ' }' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . ' return o.lastIndexOf(s, i);' . chr(10) . ' }' . chr(10) . ' return o.lastIndexOf(s);' . chr(10) . ' }' . chr(10) . ' catch(err) {' . chr(10) . ' return -1;' . chr(10) . ' }' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.length = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (typeof o.string === "function") {' . chr(10) . ' return o.string().length;' . chr(10) . ' }' . chr(10) . ' return o.length;' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.pack = function(List__) { CORE.warn([ "CORE::pack not implemented" ]) };' . chr(10) . 'CORE.unpack = function(List__) { CORE.warn([ "CORE::unpack not implemented" ]) };' . chr(10) . 'CORE.sprintf = function(List__) { CORE.warn([ "CORE::sprintf not implemented" ]) };' . chr(10) . chr(10) . 'CORE.ref = function(List__) {' . chr(10) . ' var o = List__[0];' . chr(10) . ' if (o == null) {' . chr(10) . ' return "";' . chr(10) . ' }' . chr(10) . ' if (o._class_ && typeof o._class_._ref_ === "string") {' . chr(10) . ' // blessed reference' . chr(10) . ' return o._class_._ref_;' . chr(10) . ' }' . chr(10) . ' if (typeof o._ref_ === "string") {' . chr(10) . ' // un-blessed reference' . chr(10) . ' return o._ref_;' . chr(10) . ' }' . chr(10) . ' if (typeof o === "function") {' . chr(10) . ' return "CODE";' . chr(10) . ' }' . chr(10) . ' return "";' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.split = function(List__) {' . chr(10) . ' var pattern = List__[0];' . chr(10) . ' var s = List__[1];' . chr(10) . ' var limit = List__[2];' . chr(10) . ' if (typeof pattern === "string") {' . chr(10) . ' if (pattern == " ") {' . chr(10) . ' var res = [];' . chr(10) . ' for (var i_ = 0, a_ = s.split(/(?: |' . chr(92) . 'n)+/); i_ < a_.length ; i_++) {' . chr(10) . ' if (a_[i_] != "") {' . chr(10) . ' res.push(a_[i_])' . chr(10) . ' }' . chr(10) . ' }' . chr(10) . ' return res;' . chr(10) . ' }' . chr(10) . ' return s.split(pattern);' . chr(10) . ' }' . chr(10) . ' CORE.die(["not implemented"]);' . chr(10) . '};' . chr(10) . chr(10) . 'CORE.prototype = function(List__, data) {' . chr(10) . ' var name = List__[0];' . chr(10) . ' // TODO - fully qualify "name" using information from "data"' . chr(10) . ' // XXX - lookup in CORE::GLOBAL?' . chr(10) . ' p5pkg["Perlito5"].v_PROTO._hash_[name] || p5pkg["Perlito5"].v_CORE_PROTO._hash_[name]' . chr(10) . '};' . chr(10) . chr(10))))
};
1;
@@ -10175,6 +10175,9 @@ package Perlito5::Runtime;
($Perlito5::WARNINGS = 0);
($Perlito5::UTF8 = 0);
($Perlito5::BYTES = 0);
+for (split(':', (($ENV{'PERL5LIB'} || '')))) {
+ push(@INC, $_ )
+};
($Perlito5::SPECIAL_VAR = {'$_', 'ARG', '$&', '$MATCH', '$`', '$PREMATCH', '$' . chr(39), '$POSTMATCH', '$+', '$LAST_PAREN_MATCH', '@+', '@LAST_MATCH_END', '%+', '%LAST_PAREN_MATCH', '@-', '@LAST_MATCH_START', '$|', 'autoflush', '$/', '$RS', '@_', '@ARG', '< $', '$EUID', '$.', '$NR', '< $< ', '$UID', '$(', '$GID', '$#', undef(), '$@', '$EVAL_ERROR', '$=', '$FORMAT_LINES_PER_PAGE', '$,', '$OFS', '$?', '$CHILD_ERROR', '$*', undef(), '$[', undef(), '$$', '$PID', '%-', undef(), '$~', '$FORMAT_NAME', '$-', '$FORMAT_LINES_LEFT', '$&', '$MATCH', '$%', '$FORMAT_PAGE_NUMBER', '$)', '$EGID', '$]', undef(), '$!', '$ERRNO', '$;', '$SUBSEP', '$' . chr(92), '$ORS', '%!', undef(), '$"', '$LIST_SEPARATOR', '$_', '$ARG', '$:', 'FORMAT_LINE_BREAK_CHARACTERS'});
($Perlito5::CORE_PROTO = {'CORE::shutdown', '*$', 'CORE::chop', undef(), 'CORE::lstat', '*', 'CORE::rename', '$$', 'CORE::lock', chr(92) . '$', 'CORE::rand', ';$', 'CORE::gmtime', ';$', 'CORE::gethostbyname', '$', 'CORE::each', chr(92) . '[@%]', 'CORE::ref', '_', 'CORE::syswrite', '*$;$$', 'CORE::msgctl', '$$$', 'CORE::getnetbyname', '$', 'CORE::write', ';*', 'CORE::alarm', '_', 'CORE::print', undef(), 'CORE::getnetent', '', 'CORE::semget', '$$$', 'CORE::use', undef(), 'CORE::abs', '_', 'CORE::break', '', 'CORE::undef', undef(), 'CORE::no', undef(), 'CORE::eval', undef(), 'CORE::split', undef(), 'CORE::localtime', ';$', 'CORE::sort', undef(), 'CORE::chown', '@', 'CORE::endpwent', '', 'CORE::getpwent', '', 'CORE::pos', undef(), 'CORE::lcfirst', '_', 'CORE::kill', '@', 'CORE::send', '*$$;$', 'CORE::endprotoent', '', 'CORE::semctl', '$$$$', 'CORE::waitpid', '$$', 'CORE::utime', '@', 'CORE::dbmclose', chr(92) . '%', 'CORE::getpwnam', '$', 'CORE::substr', '$$;$$', 'CORE::listen', '*$', 'CORE::getprotoent', '', 'CORE::shmget', '$$$', 'CORE::our', undef(), 'CORE::readlink', '_', 'CORE::shmwrite', '$$$$', 'CORE::times', '', 'CORE::package', undef(), 'CORE::map', undef(), 'CORE::join', '$@', 'CORE::rmdir', '_', 'CORE::shmread', '$$$$', 'CORE::uc', '_', 'CORE::bless', '$;$', 'CORE::closedir', '*', 'CORE::getppid', '', 'CORE::tie', undef(), 'CORE::readdir', '*', 'CORE::gethostent', '', 'CORE::getlogin', '', 'CORE::last', undef(), 'CORE::gethostbyaddr', '$$', 'CORE::accept', '**', 'CORE::log', '_', 'CORE::tell', ';*', 'CORE::readline', ';*', 'CORE::tied', undef(), 'CORE::socket', '*$$$', 'CORE::umask', ';$', 'CORE::sysread', '*' . chr(92) . '$$;$', 'CORE::syscall', '$@', 'CORE::quotemeta', '_', 'CORE::dump', '', 'CORE::opendir', '*$', 'CORE::untie', undef(), 'CORE::truncate', '$$', 'CORE::select', ';*', 'CORE::sleep', ';$', 'CORE::seek', '*$$', 'CORE::read', '*' . chr(92) . '$$;$', 'CORE::rewinddir', '*', 'CORE::scalar', undef(), 'CORE::wantarray', '', 'CORE::oct', '_', 'CORE::bind', '*$', 'CORE::stat', '*', 'CORE::sqrt', '_', 'CORE::getc', ';*', 'CORE::fileno', '*', 'CORE::getpeername', '*', 'CORE::sin', '_', 'CORE::getnetbyaddr', '$$', 'CORE::grep', undef(), 'CORE::setservent', '$', 'CORE::sub', undef(), 'CORE::shmctl', '$$$', 'CORE::study', undef(), 'CORE::msgrcv', '$$$$$', 'CORE::setsockopt', '*$$$', 'CORE::int', '_', 'CORE::pop', ';' . chr(92) . '@', 'CORE::link', '$$', 'CORE::exec', undef(), 'CORE::setpwent', '', 'CORE::mkdir', '_;$', 'CORE::sysseek', '*$$', 'CORE::endservent', '', 'CORE::chr', '_', 'CORE::when', undef(), 'CORE::getpwuid', '$', 'CORE::setprotoent', '$', 'CORE::reverse', '@', 'CORE::say', undef(), 'CORE::goto', undef(), 'CORE::getgrent', '', 'CORE::endnetent', '', 'CORE::hex', '_', 'CORE::binmode', '*;$', 'CORE::formline', '$@', 'CORE::getgrnam', '$', 'CORE::ucfirst', '_', 'CORE::chdir', ';$', 'CORE::setnetent', '$', 'CORE::splice', chr(92) . '@;$$@', 'CORE::unlink', '@', 'CORE::time', '', 'CORE::push', chr(92) . '@@', 'CORE::exit', ';$', 'CORE::endgrent', '', 'CORE::unshift', chr(92) . '@@', 'CORE::local', undef(), 'CORE::my', undef(), 'CORE::cos', '_', 'CORE::redo', undef(), 'CORE::warn', '@', 'CORE::getsockname', '*', 'CORE::pipe', '**', 'CORE::sprintf', '$@', 'CORE::open', '*;$@', 'CORE::setpgrp', ';$$', 'CORE::exp', '_', 'CORE::seekdir', '*$', 'CORE::getservbyport', '$$', 'CORE::given', undef(), 'CORE::pack', '$@', 'CORE::msgget', '$$', 'CORE::rindex', '$$;$', 'CORE::srand', ';$', 'CORE::telldir', '*', 'CORE::connect', '*$', 'CORE::getprotobyname', '$', 'CORE::msgsnd', '$$$', 'CORE::length', '_', 'CORE::state', undef(), 'CORE::die', '@', 'CORE::delete', undef(), 'CORE::getservent', '', 'CORE::getservbyname', '$$', 'CORE::setpriority', '$$$', 'CORE::lc', '_', 'CORE::fcntl', '*$$', 'CORE::chroot', '_', 'CORE::recv', '*' . chr(92) . '$$$', 'CORE::dbmopen', chr(92) . '%$$', 'CORE::socketpair', '**$$$', 'CORE::vec', '$$$', 'CORE::system', undef(), 'CORE::defined', '_', 'CORE::index', '$$;$', 'CORE::caller', ';$', 'CORE::close', ';*', 'CORE::atan2', '$$', 'CORE::semop', '$$', 'CORE::unpack', '$;$', 'CORE::ord', '_', 'CORE::chmod', '@', 'CORE::prototype', undef(), 'CORE::getprotobynumber', '$', 'CORE::values', chr(92) . '[@%]', 'CORE::chomp', undef(), 'CORE::ioctl', '*$$', 'CORE::eof', ';*', 'CORE::crypt', '$$', 'CORE::do', undef(), 'CORE::flock', '*$', 'CORE::wait', '', 'CORE::sethostent', '$', 'CORE::return', undef(), 'CORE::getsockopt', '*$$', 'CORE::fork', '', 'CORE::require', undef(), 'CORE::format', undef(), 'CORE::readpipe', '_', 'CORE::endhostent', '', 'CORE::getpgrp', ';$', 'CORE::setgrent', '', 'CORE::keys', chr(92) . '[@%]', 'CORE::glob', undef(), 'CORE::getpriority', '$$', 'CORE::reset', ';$', 'CORE::sysopen', '*$$;$', 'CORE::continue', '', 'CORE::next', undef(), 'CORE::getgrgid', '$', 'CORE::default', undef(), 'CORE::shift', ';' . chr(92) . '@', 'CORE::symlink', '$$', 'CORE::exists', '$', 'CORE::printf', undef()});
1;
View
1 src5/lib/Perlito5/Javascript/CORE.pm
@@ -376,6 +376,7 @@ CORE.split = function(List__) {
}
return res;
}
+ return s.split(pattern);
}
CORE.die(["not implemented"]);
};
View
2 src5/lib/Perlito5/Runtime.pm
@@ -9,6 +9,8 @@ $Perlito5::WARNINGS = 0;
$Perlito5::UTF8 = 0;
$Perlito5::BYTES = 0;
+push @INC, $_
+ for split ":", ($ENV{PERL5LIB} || "");
# the special variables list
# obtained with:

0 comments on commit 4d56b5d

Please sign in to comment.