support abilities in calc
This commit is contained in:
parent
64cf863437
commit
cf3906be94
5
calc.js
5
calc.js
@ -121,7 +121,7 @@ function* iterate(arr) {
|
||||
function unwrapToken(type, token) {
|
||||
assert(
|
||||
token.tokenType.name == type,
|
||||
`expected token ${type}, got ${token.tokenType.name}`
|
||||
`expected token ${type}, got ${token.tokenType.name}`,
|
||||
);
|
||||
return token.image;
|
||||
}
|
||||
@ -216,6 +216,9 @@ function parseAndCalculate(line) {
|
||||
case "Item":
|
||||
opts().item = unwrapToken("Item", item);
|
||||
break;
|
||||
case "Ability":
|
||||
opts().ability = unwrapToken("Ability", item);
|
||||
break;
|
||||
case "Pokemon":
|
||||
{
|
||||
let name = unwrapToken("Pokemon", item);
|
||||
|
Loading…
Reference in New Issue
Block a user