Mercurial > repos > tabletprog
comparison compiler.js @ 265:d6a4c9e7716e
Remove remapping of most operators
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 14 Jul 2014 19:03:46 -0700 |
parents | 2557ce4e671f |
children | 0dc7322590da |
comparison
equal
deleted
inserted
replaced
264:cba0cb39517a | 265:d6a4c9e7716e |
---|---|
381 throw new Error("Unexpected AST type for foreign:"); | 381 throw new Error("Unexpected AST type for foreign:"); |
382 } | 382 } |
383 } else if (this.name == 'llProperty:withType:') { | 383 } else if (this.name == 'llProperty:withType:') { |
384 if (this.args[0] instanceof symbol) { | 384 if (this.args[0] instanceof symbol) { |
385 if ((this.args[1] instanceof symbol) || (this.args[1] instanceof funcall)) { | 385 if ((this.args[1] instanceof symbol) || (this.args[1] instanceof funcall)) { |
386 symbols.defineLLProperty(this.args[0].name); | 386 symbols.defineLLProperty(this.args[0] instanceof symbol ? this.args[0].name : this.args[0].val); |
387 return; | 387 return; |
388 } else { | 388 } else { |
389 throw new Error("Second argument to llProperty:withType: must be a symbol or funcall"); | 389 throw new Error("Second argument to llProperty:withType: must be a symbol or funcall"); |
390 } | 390 } |
391 } else { | 391 } else { |
392 throw new Error("First argument to llProperty:withType: must be a symbol"); | 392 throw new Error("First argument to llProperty:withType: must be a symbol or string"); |
393 } | 393 } |
394 } else if (this.name == 'llMessage:withVars:andCode:') { | 394 } else if (this.name == 'llMessage:withVars:andCode:') { |
395 if (this.args[0] instanceof symbol) { | 395 if (this.args[0] instanceof symbol || this.args[0] instanceof strlit) { |
396 if (this.args[1] instanceof lambda) { | 396 if (this.args[1] instanceof lambda) { |
397 if (this.args[2] instanceof lambda) { | 397 if (this.args[2] instanceof lambda) { |
398 symbols.defineMsg(this.args[0].name, this.args[2]); | 398 symbols.defineMsg(this.args[0].name, this.args[2]); |
399 isll = true; | 399 isll = true; |
400 } else { | 400 } else { |