From d3ad170e4366d7e6e33b27e83d9bcc244fe43988 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Thu, 23 Sep 2010 04:12:47 -0400 Subject: [PATCH] tweak lambda evaluator Signed-off-by: Jim Pryor --- code/parse.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/parse.js b/code/parse.js index cb412f7f..7749c695 100644 --- a/code/parse.js +++ b/code/parse.js @@ -34,10 +34,10 @@ var make_parse = function () { a = t.type; if (a === "name") { o = symbol_table[v]; - if (o && typeof o !== 'function') { - a = "keyword"; - } else { + if (!o || typeof o === 'function') { o = symbol_table["(name)"]; + } else { + a = o.arity || "keyword"; } } else if (a === "number") { o = symbol_table["(literal)"]; @@ -150,10 +150,10 @@ var make_parse = function () { var x = symbol(s); x.handler = function () { this.value = symbol_table[this.id].value; - this.arity = "literal"; return this; }; x.value = v; + x.arity = "literal"; return x; }; -- 2.11.0