Mercurial > repos > tabletprog
comparison compiler.js @ 170:18598163e3ef
Add linked list implementation and cons operator
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 13 Aug 2013 21:58:03 -0700 |
parents | d715fb3c39ab |
children | 869399ff7faa |
comparison
equal
deleted
inserted
replaced
153:075b1e71feff | 170:18598163e3ef |
---|---|
97 }; | 97 }; |
98 topsymbols.prototype.moduleVar = function(name) { | 98 topsymbols.prototype.moduleVar = function(name) { |
99 if (!(name in this.names)) { | 99 if (!(name in this.names)) { |
100 throw new Error('symbol ' + name + ' not found at toplevel'); | 100 throw new Error('symbol ' + name + ' not found at toplevel'); |
101 } | 101 } |
102 if (name == 'true' || name == 'false') { | 102 if (name == 'true' || name == 'false' || name == 'list') { |
103 return 'module_' + name; | 103 return 'module_' + name; |
104 } | 104 } |
105 if (!this.names[name].modulevar) { | 105 if (!this.names[name].modulevar) { |
106 this.names[name].modulevar = 'module_' + this.nextmodulenum++ | 106 this.names[name].modulevar = 'module_' + this.nextmodulenum++ |
107 } | 107 } |
230 }; | 230 }; |
231 } else { | 231 } else { |
232 if (nestedcall) { | 232 if (nestedcall) { |
233 this.closedover[name] = true; | 233 this.closedover[name] = true; |
234 this.passthruenv = false; | 234 this.passthruenv = false; |
235 } | 235 } |
236 if (name in this.closedover) { | 236 if (name in this.closedover) { |
237 var ret = { | 237 var ret = { |
238 type: 'closedover', | 238 type: 'closedover', |
239 def: this.names[name] | 239 def: this.names[name] |
240 }; | 240 }; |