Finished migrating parser to be object orientation free. All tests pass

This commit is contained in:
Stefan Zermatten
2021-10-03 13:54:17 +02:00
parent d30184434c
commit b78517b61f
35 changed files with 589 additions and 654 deletions

View File

@@ -7,20 +7,6 @@ export default function parser(){
return new nearley.Parser(nearleyGrammar);
}
export class CompilationContext {
constructor({doubleRolls} = {}){
this.errors = [];
this.rolls = [];
this.doubleRolls = doubleRolls;
}
storeError(e){
this.errors.push(e);
}
storeRoll(r){
this.rolls.push(r);
}
}
export function parse(string){
let parser = new nearley.Parser(nearleyGrammar);
parser.feed(string);