diff --git a/calc.js b/calc.js index f8c64ac..2b98e1b 100644 --- a/calc.js +++ b/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; } @@ -237,13 +237,11 @@ function parseAndCalculate(line) { field.weather = next.image; break; case "Terrain": - field.terrain = next.image; + field.terrain = next.image.replace(" Terrain", ""); break; default: throw Error( - "Unhandled terrain %s: %s", - next.tokenType.name, - next.image + `Unhandled field condition ${next.tokenType.name}: ${next.image}` ); } }