Removed unused parser code
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
// All of the compile functions are provided for use in compiling parse trees
|
||||
// Every compile function takes in ParseNodes as arguements and returns a single
|
||||
// ConstantNode as a result
|
||||
|
||||
const compileFunctions = {};
|
||||
|
||||
export compileFunctions;
|
||||
@@ -1,15 +0,0 @@
|
||||
export default function sum(inputNode) {
|
||||
let node = inputNode.roll();
|
||||
if (node.type === 'numberArray'){
|
||||
let total = node.value.reduce((total, num) => total + num, 0);
|
||||
return new ConstantNode({type: 'number', value: total});
|
||||
} else {
|
||||
let errors = node.errors || [];
|
||||
errors.push(`Could not sum ${node.value}`);
|
||||
return new ConstantNode({
|
||||
type: 'uncompiledNode',
|
||||
value: node.value,
|
||||
errors,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user