minor
[lambda.git] / lambda.js
index 4b684f4..c28a0c1 100644 (file)
--- a/lambda.js
+++ b/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(/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");
   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(/[ \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");
 //  output = output.replace(/lambda/g, "\u03BB");
 //  output = output.replace(/exists/g, "\u2203");
 //  output = output.replace(/forall/g, "\u2200");