Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Perlito5 - update Makefile (suggested by shlomif++)

  • Loading branch information...
commit ab55266859cb347b0096528a7e0dd2a7f6652aa0 1 parent 9fbf890
@fglock authored
View
33 Makefile
@@ -0,0 +1,33 @@
+# default actions
+
+make ::
+ perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5.pl > perlito5.js
+
+test ::
+ prove -r -e 'node perlito5.js -I./src5/lib' t5
+
+
+# more
+
+build-5js ::
+ perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5.pl > perlito5.js
+
+build-5browser ::
+ perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5-browser.pl > html/perlito5.js
+
+boot-5js ::
+ time node perlito5.js -Isrc5/lib -Cjs src5/util/perlito5.pl > perlito5-new.js && diff perlito5-new.js perlito5.js ; cp perlito5-new.js perlito5.js
+
+test-5js ::
+ prove -r -e 'node perlito5.js -I./src5/lib' t5
+
+boot-5to5 ::
+ time perl perlito5.pl -Isrc5/lib -Cperl5 src5/util/perlito5.pl > perlito5-new.pl && diff perlito5-new.pl perlito5.pl ; cp perlito5-new.pl perlito5.pl
+
+test-5to5 ::
+ prove -r -e 'perl perlito5.pl -I./src5/lib ' t5
+
+test-5to6 ::
+ -find t5/*/*.t | perl -ne ' chomp; print "*** perl6 $$_.p6$$/"; chomp; print `perl -Ilib5 perlito5.pl -Cperl6 $$_ > $$_.p6 && perl6 $$_.p6 `'
+
+.PHONY: test-5to6
View
4 Makefile-perl5-to-6
@@ -1,4 +0,0 @@
-test-5to6 ::
- -find t5/*/*.t | perl -ne ' chomp; print "*** perl6 $$_.p6$$/"; chomp; print `perl -Ilib5 perlito5.pl -Cperl6 $$_ > $$_.p6 && perl6 $$_.p6 `'
-
-.PHONY: test-5to6
View
14 README-perlito5
@@ -1,3 +1,17 @@
+Using make:
+
+ make
+ - builds perlito5.js (which runs in node.js)
+
+ make test
+ - tests perlito5.js using node.js
+
+ make build-5browser
+ - builds html/perlito5.js (which runs in the browser)
+
+-- See "Makefile" for more options
+
+
Running the tests using "node.js":
# this command will compile "perlito5.js"
View
4 html/perlito5.js
@@ -3329,7 +3329,7 @@ var p5100 = p5pkg['main'];
(v_level = (p5pkg["Perlito5::AST::Apply"].shift([List__])));
var v_wantarray = null;
(v_wantarray = (p5pkg["Perlito5::AST::Apply"].shift([List__])));
- return (p5context([('p5defined_or' + '(' + p5str(p5call(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)], "emit_javascript", [v_level, v_wantarray], 0)) + ', ' + p5str(p5pkg["Perlito5::Javascript"].emit_function_javascript(p5list_to_a(v_level, v_wantarray, ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,1)]), 0)) + ')')], p5want));
+ return (p5context([('p5defined_or' + '(' + p5str(p5call(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)], "emit_javascript", [v_level, 'scalar'], 0)) + ', ' + p5str(p5pkg["Perlito5::Javascript"].emit_function_javascript(p5list_to_a(v_level, v_wantarray, ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,1)]), 0)) + ')')], p5want));
}, 'exists', function (List__, p5want) {
try {
var v_self = null;
@@ -3416,7 +3416,7 @@ var p5100 = p5pkg['main'];
throw(p5context([(p5str(p5pkg["Perlito5::Javascript"]["Hash_op_prefix_js_str"][v_code]) + '(' + p5str(p5pkg["Perlito5::Javascript"].to_str(p5list_to_a(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)]), 0)) + ')')], p5want));
};
if ( ((p5str(v_code) == 'infix:<&&>') || (p5str(v_code) == 'infix:<and>')) ) {
- throw(p5context([('p5and' + '(' + p5str(p5call(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)], "emit_javascript", [v_level, v_wantarray], 0)) + ', ' + p5str(p5pkg["Perlito5::Javascript"].emit_function_javascript(p5list_to_a(v_level, v_wantarray, ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,1)]), 0)) + ')')], p5want));
+ throw(p5context([('p5and' + '(' + p5str(p5call(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)], "emit_javascript", [v_level, 'scalar'], 0)) + ', ' + p5str(p5pkg["Perlito5::Javascript"].emit_function_javascript(p5list_to_a(v_level, v_wantarray, ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,1)]), 0)) + ')')], p5want));
};
if ( ((p5str(v_code) == 'infix:<||>') || (p5str(v_code) == 'infix:<or>')) ) {
throw(p5context([('p5or' + '(' + p5str(p5call(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,0)], "emit_javascript", [v_level, 'scalar'], 0)) + ', ' + p5str(p5pkg["Perlito5::Javascript"].emit_function_javascript(p5list_to_a(v_level, v_wantarray, ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_[p5idx(((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new p5HashRef({})))._hash_['arguments'] = new p5ArrayRef([])))._array_,1)]), 0)) + ')')], p5want));
Please sign in to comment.
Something went wrong with that request. Please try again.