From 0a787c1b90bcdd2eb935541c67640ddf6715fddb Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Thu, 23 Sep 2010 04:19:58 -0400 Subject: [PATCH] tweak lambda evaluator Signed-off-by: Jim Pryor --- code/parse.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/parse.js b/code/parse.js index 7749c695..fc3b83d8 100644 --- a/code/parse.js +++ b/code/parse.js @@ -213,7 +213,11 @@ var make_parse = function () { n = token; advance(); } - if (token.id === ".") { + if (token.arity === "literal" && t.first.length === 0) { + t.first.push(n); + t.second = token; + advance(); + } else if (token.id === ".") { t.first.push(n); advance(); t.second = expression(in_let); @@ -249,8 +253,8 @@ var make_parse = function () { n = token; advance(")"); } else { - if (token.arity !== "name") { - token.error("Expected a variable name."); + if (token.arity !== "name" && token.arity !== "literal") { + token.error("Expected a variable name or literal."); } token.first = n; n = token; -- 2.11.0