From 8d61189a0357ef374b57e16f4ab727388db30519 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Sun, 23 Nov 2025 20:49:01 +0100 Subject: [PATCH] Moved print from statement to builtin --- src/compiler/assembly_pass.rs | 5 ----- src/compiler/ast_pass.rs | 4 ---- 2 files changed, 9 deletions(-) diff --git a/src/compiler/assembly_pass.rs b/src/compiler/assembly_pass.rs index fe4d9e8..4daf20d 100644 --- a/src/compiler/assembly_pass.rs +++ b/src/compiler/assembly_pass.rs @@ -191,11 +191,6 @@ impl AsmPass { return Err(self.raise(UndeclaredVariable(name.to_string()))); } } - // replace with function - Statement::PrintStmt { value } => { - self.compile_expression(namespace, value, symbols, registry)?; - self.emit(Print); - } Statement::ExpressionStmt { expression } => { self.compile_expression(namespace, expression, symbols, registry)?; } diff --git a/src/compiler/ast_pass.rs b/src/compiler/ast_pass.rs index 588b00c..923879d 100644 --- a/src/compiler/ast_pass.rs +++ b/src/compiler/ast_pass.rs @@ -848,9 +848,6 @@ pub enum Statement { var_type: TokenType, initializer: Expression, }, - PrintStmt { - value: Expression, - }, FunctionStmt { function: Function, }, @@ -874,7 +871,6 @@ impl Statement { match self { Statement::ExpressionStmt { expression } => expression.line(), Statement::VarStmt { name, .. } => name.line, - Statement::PrintStmt { value } => value.line(), Statement::FunctionStmt { function, .. } => function.name.line, Statement::ObjectStmt { name, .. } => name.line, Statement::GuardStatement { if_expr, .. } => if_expr.line(),