Lots of work on the parser including testing interface
This commit is contained in:
15
app/imports/parser/parseTree/ArrayNode.js
Normal file
15
app/imports/parser/parseTree/ArrayNode.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import ParseNode from '/imports/parser/parseTree/ParseNode.js';
|
||||
|
||||
export default class ArrayNode extends ParseNode {
|
||||
constructor({values}) {
|
||||
super();
|
||||
this.values = values;
|
||||
}
|
||||
compile(){
|
||||
let values = this.values.map(node => node.compile());
|
||||
return new ArrayNode({values});
|
||||
}
|
||||
toString(){
|
||||
return `[${this.values.map(node => node.toString()).join(', ')}]`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user