More engine rewrite progress, starting to get messy again

This commit is contained in:
Stefan Zermatten
2021-09-13 16:12:04 +02:00
parent b877a8b45f
commit 5c84836238
38 changed files with 614 additions and 262 deletions

View File

@@ -9,10 +9,14 @@ export default class SymbolNode extends ParseNode {
toString(){
return `${this.name}`
}
compile(scope){
compile(scope, context){
let value = scope && scope[this.name];
let type = typeof value;
// For objects, get their value
// For parse nodes, compile and return
if (value instanceof ParseNode){
return value.compile(scope, context);
}
// For objects, default to their .value
if (type === 'object'){
value = value.value;
type = typeof value;