diff --git a/src/compiler/compiler.ts b/src/compiler/compiler.ts index 4f8b15b..c22e117 100644 --- a/src/compiler/compiler.ts +++ b/src/compiler/compiler.ts @@ -475,8 +475,8 @@ export class Compiler { // = can be a valid word, and also valid in words, so for now we cheat // and check for arrays that look like `[ = ]` to interpret them as // empty dicts - if (children.length === 1 && children[0].name === 'Word') { - const child = children[0] + if (children.length === 1 && children[0]!.name === 'Word') { + const child = children[0]! if (input.slice(child.from, child.to) === '=') { return [['MAKE_DICT', 0]] } @@ -493,13 +493,13 @@ export class Compiler { children.forEach((node) => { const keyNode = node.firstChild - const valueNode = node.firstChild.nextSibling + const valueNode = node.firstChild!.nextSibling // name= -> name - const key = input.slice(keyNode.from, keyNode.to).slice(0, -1) + const key = input.slice(keyNode!.from, keyNode!.to).slice(0, -1) instructions.push(['PUSH', key]) - instructions.push(...this.#compileNode(valueNode, input)) + instructions.push(...this.#compileNode(valueNode!, input)) }) instructions.push(['MAKE_DICT', children.length])