From 06f3a9b746b2cdd50a0210b64877affa682c6d28 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 7 Aug 2024 15:53:43 -0400 Subject: [PATCH] Remove built-in value statements --- dust-lang/src/abstract_tree.rs | 3 --- dust-lang/src/analyzer.rs | 3 --- dust-lang/src/vm.rs | 1 - 3 files changed, 7 deletions(-) diff --git a/dust-lang/src/abstract_tree.rs b/dust-lang/src/abstract_tree.rs index 87f8307..a0729b2 100644 --- a/dust-lang/src/abstract_tree.rs +++ b/dust-lang/src/abstract_tree.rs @@ -40,7 +40,6 @@ pub enum Statement

{ // Expressions Add(Box>, Box>), - BuiltInValue(Box>), PropertyAccess(Box>, Box>), List(Vec>), Multiply(Box>, Box>), @@ -56,7 +55,6 @@ impl

Statement

{ match self { Statement::Add(left, _) => left.statement.expected_type(variables), Statement::Assign(_, _) => None, - Statement::BuiltInValue(reserved) => reserved.statement.expected_type(variables), Statement::Constant(value) => Some(value.r#type(variables)), Statement::Identifier(identifier) => variables .get(identifier) @@ -77,7 +75,6 @@ impl

Display for Statement

{ match self { Statement::Assign(left, right) => write!(f, "{left} = {right}"), Statement::Add(left, right) => write!(f, "{left} + {right}"), - Statement::BuiltInValue(reserved) => write!(f, "{reserved}"), Statement::PropertyAccess(left, right) => write!(f, "{left}.{right}"), Statement::List(nodes) => { write!(f, "[")?; diff --git a/dust-lang/src/analyzer.rs b/dust-lang/src/analyzer.rs index 73eccc4..d583943 100644 --- a/dust-lang/src/analyzer.rs +++ b/dust-lang/src/analyzer.rs @@ -103,9 +103,6 @@ impl<'a, P: Clone> Analyzer<'a, P> { self.analyze_node(right)?; } - Statement::BuiltInValue(node) => { - self.analyze_node(node)?; - } Statement::Constant(_) => {} Statement::Identifier(_) => { return Err(AnalyzerError::UnexpectedIdentifier { diff --git a/dust-lang/src/vm.rs b/dust-lang/src/vm.rs index dafbc96..c62e274 100644 --- a/dust-lang/src/vm.rs +++ b/dust-lang/src/vm.rs @@ -47,7 +47,6 @@ impl Vm

{ variables: &mut HashMap, ) -> Result, VmError

> { match node.statement { - Statement::BuiltInValue(node) => self.run_node(*node, variables), Statement::Constant(value) => Ok(Some(value.clone())), Statement::Identifier(_) => Ok(None), Statement::ReservedIdentifier(_) => Ok(None),