fn compile_statement_eval(
        &mut self,
        statements: &[ast::Statement],
        symbol_table: SymbolTable,
    ) -> Result<(), CompileError> {
        self.symbol_table_stack.push(symbol_table);
        for statement in statements {
            if let ast::StatementType::Expression { ref expression } = statement.node {
                self.compile_expression(expression)?;
            } else {
                return Err(CompileError {
                    error: CompileErrorType::ExpectExpr,
                    location: statement.location.clone(),
                });
            }
        }
        self.emit(Instruction::ReturnValue);
        Ok(())
    }
// Compile statement in eval mode:
Compile statement in eval mode.
Compile statement in eval mode .
fn compile_statement_eval(
        &mut self,
        statements: &[ast::Statement],
        symbol_table: SymbolTable,
    ) -> Result<(), CompileError> {
        self.symbol_table_stack.push(symbol_table);
        for statement in statements {
            if let ast::StatementType::Expression { ref expression } = statement.node {
                self.compile_expression(expression)?;
            } else {
                return Err(CompileError {
                    error: CompileErrorType::ExpectExpr,
                    location: statement.location.clone(),
                });
            }
        }
        self.emit(Instruction::ReturnValue);
        Ok(())
    }
fn compile_statement_eval ( & mut self , statements : & [ ast :: Statement ] , symbol_table : SymbolTable , ) -> Result < ( ) , CompileError > { self . symbol_table_stack . push ( symbol_table ) ; for statement in statements { if let ast :: StatementType :: Expression { ref expression } = statement . node { self . compile_expression ( expression ) ? ; } else { return Err ( CompileError { error : CompileErrorType :: ExpectExpr , location : statement . location . clone ( ) , } ) ; } } self . emit ( Instruction :: ReturnValue ) ; Ok ( ( ) ) }
Compile statement in eval mode:
Compile statement in eval mode :
&mut self
statements
&[ast::Statement]
symbol_table
SymbolTable