X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=code%2Flambda.js;h=c28a0c17223e34e874dde5472a63c19450168125;hp=4b684f4eeb22d9ff3da97828003fa732d5fdcd16;hb=4c41ba9c22b453bb23667786c1b549f15bf5cf1e;hpb=6dc18a4ae23b84aeee4456c3f39a944109b5c68f diff --git a/code/lambda.js b/code/lambda.js index 4b684f4e..c28a0c17 100644 --- a/code/lambda.js +++ b/code/lambda.js @@ -145,6 +145,7 @@ function stringToTree(input) { input = input.replace(/in/g, " ) "); input = input.replace(/\(/g, " ( "); input = input.replace(/\)/g, " ) "); + input = input.replace(/;.*\n/g," "); input = input.replace(/\^/g, " ^ "); input = input.replace(/[\\]/g, " lambda "); input = input.replace(/\u03BB/g, "lambda"); @@ -158,6 +159,7 @@ function formatTree(tree) { output = output.replace(/[ \f\n\r\t\v]+$/, ""); output = output.replace(/[ \f\n\r\t\v]+\)/g, ")"); output = output.replace(/\)([^)(])/g, ") $1"); + output = output.replace(/lambda/g, "\\"); // output = output.replace(/lambda/g, "\u03BB"); // output = output.replace(/exists/g, "\u2203"); // output = output.replace(/forall/g, "\u2200");