import Modification from '../../modification'; import * as Shift from 'shift-ast'; export default class ExpressionSimplifier extends Modification { private readonly types; /** * Creates a new modification. * @param ast The AST. */ constructor(ast: Shift.Script); /** * Executes the modification. */ execute(): void; /** * Simplifies all binary and unary expressions. */ private simplifyExpressions; /** * Attempts to simplify an expression node. * @param expression The expression node. */ private simplifyExpression; /** * Attempts to simplify a binary expression node. * @param expression The binary expression node. */ private simplifyBinaryExpression; /** * Attempts to simplify a unary expression node. * @param expression The unary expression node. */ private simplifyUnaryExpression; /** * Returns the value of a node as a string, null if not possible. * @param expression The expression node. */ private getExpressionValueAsString; /** * Evaluates a given piece of code and converts the result to an * expression node if possible. * @param code The code to be evaluated. */ private evalCodeToExpression; private isSimpleArray; }