Browse Source

some minor cosmetic fixes

pull/1/head
nisstyre56 11 years ago
parent
commit
02baaa0192
  1. 8
      cexps.js
  2. 1
      closure_conversion.js
  3. 2
      pprint.js
  4. 2
      representation.js
  5. 4
      tools.js

8
cexps.js

@ -8,7 +8,7 @@
var cexp = { var cexp = {
type : "cexp" type : "cexp"
} };
function record(values_accesspaths, function record(values_accesspaths,
w, w,
@ -78,7 +78,7 @@ function accessPath(offp, selp) {
var primoptype = { var primoptype = {
type : "primop", type : "primop",
equal : function(pOp) { equal : function(pOp) {
return this.name === pOp.name return this.name === pOp.name;
} }
}; };
@ -86,7 +86,7 @@ function Primop(name) {
function ptype() { function ptype() {
this.name = name; this.name = name;
return this; return this;
}; }
ptype.prototype = primoptype; ptype.prototype = primoptype;
return new ptype(); return new ptype();
} }
@ -113,7 +113,7 @@ var makeref = Primop("makeref");
var makerefunboxed = Primop("makerefunboxed"); var makerefunboxed = Primop("makerefunboxed");
var alength = Primop("alength"); var alength = Primop("alength");
var slength = Primop("slength"); var slength = Primop("slength");
var gethdlr = Primop("gethdlr") var gethdlr = Primop("gethdlr");
var sethdlr = Primop("sethdlr"); var sethdlr = Primop("sethdlr");
var boxed = Primop("boxed"); var boxed = Primop("boxed");
var fadd = Primop("fadd"); var fadd = Primop("fadd");

1
closure_conversion.js

@ -62,6 +62,7 @@ function fvs_helper(stx) {
else { else {
return $.flatten([fvs_helper(stx.condition), fvs_helper(stx.thenexp)]); return $.flatten([fvs_helper(stx.condition), fvs_helper(stx.thenexp)]);
} }
break;
case "Name": case "Name":
return stx.ident; return stx.ident;
} }

2
pprint.js

@ -58,7 +58,7 @@ function pprint(expr) {
else if (expr.exprType === "Let") else if (expr.exprType === "Let")
return "let {" + expr.pairs.map( return "let {" + expr.pairs.map(
function (v) { function (v) {
return pprint(v) return pprint(v);
}).join(" ; ") + "} in " + pprint(expr.body); }).join(" ; ") + "} in " + pprint(expr.body);
} }

2
representation.js

@ -219,7 +219,7 @@ OPInfo = {"+" : [3, "Left"],
">>=" : [1, "Left"], ">>=" : [1, "Left"],
"<$>" : [1, "Left"], "<$>" : [1, "Left"],
"." : [1, "Left"], "." : [1, "Left"],
"," : [1, "Left"]} "," : [1, "Left"]};
module.exports = module.exports =
{ IntT : IntT, { IntT : IntT,

4
tools.js

@ -123,7 +123,7 @@ function find(f, haystack) {
} }
function dict(pairs) { function dict(pairs) {
var o = new Object(); var o = {};
pairs.map(function(p) { pairs.map(function(p) {
o[p[0]] = p[1]; o[p[0]] = p[1];
}); });
@ -200,4 +200,4 @@ module.exports = {compose : compose,
eq: eq, eq: eq,
extend : extend, extend : extend,
flatten : flatten, flatten : flatten,
difference : difference} difference : difference};

Loading…
Cancel
Save