Browse Source

Removed spurious code from experiments

pull/12/head
nisstyre56 11 years ago
parent
commit
4c285539eb
  1. 21
      representation.js

21
representation.js

@ -37,26 +37,24 @@ function isIrregularTypeOp(x) {
function flattenTypeApp(stx) { function flattenTypeApp(stx) {
if (isTypeExpr(stx)) { if (isTypeExpr(stx)) {
return stx; return true;
} }
if (stx.exprType === "Application") { if (stx.exprType === "Application") {
/* it might be a type application so recursively check it */ /* it might be a type application so recursively check it */
if (stx.p !== undefined) { if (stx.p !== undefined) {
return _.flatten([stx, flattenTypeApp(stx.p), flattenTypeApp(stx.func)]); return _.flatten([flattenTypeApp(stx.p), flattenTypeApp(stx.func)]);
} }
else { else {
return _.flatten([stx, flattenTypeApp(stx.func)]); return _.flatten([flattenTypeApp(stx.func)]);
} }
} }
if (stx.exprType === "Name") { if (stx.exprType === "Name") {
/* Check if it might be a type operator that is not capitalized */ /*
if (isIrregularTypeOp(stx.ident)) { * Either it is a type operator
return stx; * or we assume it is a type variable
} * since it was not capitalized
return { */
failed : true, return true;
stx : stx
};
} }
return { return {
failed : true, failed : true,
@ -66,6 +64,7 @@ function flattenTypeApp(stx) {
function isTypeExprRec(stx) { function isTypeExprRec(stx) {
var flattened = flattenTypeApp(stx); var flattened = flattenTypeApp(stx);
console.log(flattened);
for(var i = 0; i < flattened.length; i++) { for(var i = 0; i < flattened.length; i++) {
if (flattened[i].failed !== undefined && if (flattened[i].failed !== undefined &&
flattened[i].failed) { flattened[i].failed) {

Loading…
Cancel
Save