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. 34
      representation.js
  5. 8
      tools.js

8
cexps.js

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

1
closure_conversion.js

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

2
pprint.js

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

34
representation.js

@ -200,10 +200,10 @@ function makeGensym() {
var gensym = makeGensym();
OPInfo = {"+" : [3, "Left"],
"-" : [3, "Left"],
"*" : [4, "Left"],
"/" : [4, "Left"],
"^" : [5, "Right"],
"-" : [3, "Left"],
"*" : [4, "Left"],
"/" : [4, "Left"],
"^" : [5, "Right"],
"++" : [3, "Left"],
"==" : [2, "Left"],
">" : [2, "Left"],
@ -219,22 +219,22 @@ OPInfo = {"+" : [3, "Left"],
">>=" : [1, "Left"],
"<$>" : [1, "Left"],
"." : [1, "Left"],
"," : [1, "Left"]}
"," : [1, "Left"]};
module.exports =
{ IntT : IntT,
FloatT : FloatT,
StrT : StrT,
BoolT : BoolT,
ListT : ListT,
FuncT : FuncT,
App : App,
Name : Name,
Def : Def,
OpT : OpT,
OPInfo : OPInfo,
makeApp : makeApp,
If : If,
FloatT : FloatT,
StrT : StrT,
BoolT : BoolT,
ListT : ListT,
FuncT : FuncT,
App : App,
Name : Name,
Def : Def,
OpT : OpT,
OPInfo : OPInfo,
makeApp : makeApp,
If : If,
DefFunc : DefFunc,
UnaryOp : UnaryOp,
Nil : Nil,

8
tools.js

@ -123,7 +123,7 @@ function find(f, haystack) {
}
function dict(pairs) {
var o = new Object();
var o = {};
pairs.map(function(p) {
o[p[0]] = p[1];
});
@ -188,8 +188,8 @@ print(matcher(">="));
*/
module.exports = {compose : compose,
not : not,
on : on,
not : not,
on : on,
maxBy : maxBy,
len : len,
groupOps : groupOps,
@ -200,4 +200,4 @@ module.exports = {compose : compose,
eq: eq,
extend : extend,
flatten : flatten,
difference : difference}
difference : difference};

Loading…
Cancel
Save