diff --git a/src/lang/abstractSyntaxTree.ts b/src/lang/abstractSyntaxTree.ts index 7a046cc59..9ecc11a87 100644 --- a/src/lang/abstractSyntaxTree.ts +++ b/src/lang/abstractSyntaxTree.ts @@ -761,28 +761,6 @@ export interface BinaryExpression extends GeneralStatement { right: BinaryPart } -function makeBinaryPart( - tokens: Token[], - index: number -): { part: Literal | Identifier; lastIndex: number } { - const currentToken = tokens[index] - if (currentToken.type === 'word') { - const identifier = makeIdentifier(tokens, index) - return { - part: identifier, - lastIndex: index, - } - } - if (currentToken.type === 'number' || currentToken.type === 'string') { - const literal = makeLiteral(tokens, index) - return { - part: literal, - lastIndex: index, - } - } - throw new Error('Expected a previous BinaryPart if statement to match') -} - export function findEndOfBinaryExpression( tokens: Token[], index: number diff --git a/src/lang/astMathExpressions.ts b/src/lang/astMathExpressions.ts index 922abe07b..7f981e06e 100644 --- a/src/lang/astMathExpressions.ts +++ b/src/lang/astMathExpressions.ts @@ -1,12 +1,6 @@ import { BinaryExpression, Literal, Identifier } from './abstractSyntaxTree' import { Token } from './tokeniser' -interface Tree { - value: string - left?: Tree - right?: Tree -} - export function reversePolishNotation( tokens: Token[], previousPostfix: Token[] = [],