changeset 62:f57b2f4048d0

Fix funcall.populateSymbols to use the fixed up name when doing the initial symbol.find. This ensures the parent tree is properly produced
author Mike Pavone <pavone@retrodev.com>
date Sat, 14 Jul 2012 04:19:29 -0700
parents a6addd8c6bd4
children 86ebdfb33711
files compiler.js
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/compiler.js	Sat Jul 14 04:18:46 2012 -0700
+++ b/compiler.js	Sat Jul 14 04:19:29 2012 -0700
@@ -306,6 +306,8 @@
 		}
 	}
 	this.symbols = symbols;
+	var name = this.name[this.name.length-1] == ':' ? this.name.substr(0, this.name.length-1) : this.name;
+	symbols.find(name)
 	for (var i in this.args) {
 		this.args[i].populateSymbols(symbols);
 	}
@@ -344,6 +346,7 @@
 };
 
 assignment.prototype.populateSymbols = function(symbols) {
+	debugprint('//assignment', this.symbol.name, 'populateSymbols');
 	var existing = symbols.find(this.symbol.name);
 	if (!existing) {
 		symbols.defineVar(this.symbol.name, this.expression);
@@ -353,6 +356,7 @@
 	this.symbols = symbols;
 };
 assignment.prototype.populateSymbolsObject = function(symbols) {
+	debugprint('//messagedef', this.symbol.name, 'populateSymbols');
 	if (this.expression instanceof lambda || (this.expression instanceof funcall & this.expression.name == 'foreign:')) {
 		symbols.defineMsg(this.symbol.name, this.expression);
 	} else {