Skip to content

Commit

Permalink
Perlito5 - js3 - add make build-5js3
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Sep 23, 2012
1 parent ad58fdb commit bb527ad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -23,6 +23,9 @@ build-5js ::
build-5browser ::
perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5-browser.pl > html/perlito5.js

build-5js3 ::
perl perlito5.pl -I./src5/lib -Cjs3 src5/util/perlito5.pl > 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

Expand Down
4 changes: 2 additions & 2 deletions perlito5.pl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src5/lib/Perlito5/Javascript3/Emitter.pm
Expand Up @@ -288,7 +288,7 @@ package Perlito5::Javascript3;
push @out, "$k : $v";
}

return 'new p5Hash({' . join(', ', @out) . '})'
return '{' . join(', ', @out) . '}'
if $printable;

}
Expand Down
12 changes: 12 additions & 0 deletions src5/lib/Perlito5/Javascript3/Runtime.pm
Expand Up @@ -265,6 +265,9 @@ function p5HashRef(o) {
this._href_ = o;
this._ref_ = "HASH";
this.p5bool = function() { return 1 };
this.p5string = function() {
return "HASH(0x0000)"; // TODO
};
this.hderef = function() {
return this._href_;
};
Expand All @@ -281,6 +284,9 @@ function p5ArrayRef(o) {
this._aref_ = o;
this._ref_ = "ARRAY";
this.p5bool = function() { return 1 };
this.p5string = function() {
return "ARRAY(0x0000)"; // TODO
};
this.aderef = function() {
return this._aref_;
};
Expand All @@ -297,6 +303,9 @@ function p5ScalarRef(o) {
this._scalar_ = o;
this._ref_ = "SCALAR";
this.p5bool = function() { return 1 };
this.p5string = function() {
return "SCALAR(0x0000)"; // TODO
};
this.sderef = function(i) {
return this._scalar_;
};
Expand All @@ -306,6 +315,9 @@ function p5GlobRef(o) {
this._scalar_ = o;
this._ref_ = "GLOB";
this.p5bool = function() { return 1 };
this.p5string = function() {
return "GLOB(0x0000)"; // TODO
};
}
function p5Array(o) {
Expand Down

0 comments on commit bb527ad

Please sign in to comment.