Parser now works with variables passed into scope

This commit is contained in:
Stefan Zermatten
2020-09-10 11:38:28 +02:00
parent ede4e1367d
commit 5dec760452
6 changed files with 93 additions and 17 deletions

View File

@@ -59,7 +59,7 @@ export default {
this.output = JSON.stringify(output, null, 2);
if (!output) return;
this.string = output;
let scope = {cat: 1, dog: 2, mouse: 3};
let scope = {strength: {value: 16}, hitpoints: {value: 32, currentValue: 8}, mouse: 3};
this.compiled = output.compile(scope);
this.rolled = output.roll(scope);
this.reduced = output.reduce(scope);