diff --git a/src/parser.ts b/src/parser.ts index 9d336fb4..1a53aedf 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -406,7 +406,7 @@ function tokens2asc(tokens: Token[], assert = defaultAssert()) { x.lhs = tokens[i + 3]; x.rhs = tokens[i + 1]; } - if (gettok(i, 1) == "/" && gettok(i + 4, 0) == "mod") { + if (gettok(i, 1) == "/" && tokens[i + 4] && gettok(i + 4, 0) == "mod") { x.op = "op%"; i += 5; } else {