support abilities in calc

This commit is contained in:
xeals 2023-04-27 11:24:17 +10:00
parent 64cf863437
commit cf3906be94
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

View File

@ -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);