Files
DiceCloud/app/imports/parser/parseTree/ErrorNode.js
2021-02-12 11:00:44 +02:00

22 lines
425 B
JavaScript

import ParseNode from '/imports/parser/parseTree/ParseNode.js';
export default class ErrorNode extends ParseNode {
constructor({node, error, context}) {
super(...arguments);
this.node = node;
this.error = error;
if (context){
context.storeError({
type: 'error',
message: error,
});
}
}
compile(){
return this;
}
toString(){
return this.error.toString();
}
}