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) {
|
function unwrapToken(type, token) {
|
||||||
assert(
|
assert(
|
||||||
token.tokenType.name == type,
|
token.tokenType.name == type,
|
||||||
`expected token ${type}, got ${token.tokenType.name}`
|
`expected token ${type}, got ${token.tokenType.name}`,
|
||||||
);
|
);
|
||||||
return token.image;
|
return token.image;
|
||||||
}
|
}
|
||||||
@ -216,6 +216,9 @@ function parseAndCalculate(line) {
|
|||||||
case "Item":
|
case "Item":
|
||||||
opts().item = unwrapToken("Item", item);
|
opts().item = unwrapToken("Item", item);
|
||||||
break;
|
break;
|
||||||
|
case "Ability":
|
||||||
|
opts().ability = unwrapToken("Ability", item);
|
||||||
|
break;
|
||||||
case "Pokemon":
|
case "Pokemon":
|
||||||
{
|
{
|
||||||
let name = unwrapToken("Pokemon", item);
|
let name = unwrapToken("Pokemon", item);
|
||||||
|
Loading…
Reference in New Issue
Block a user