Remove next stubs

This commit is contained in:
Andrew Morris
2023-05-26 18:03:03 +10:00
parent ac868be23c
commit 3b2be89880
5 changed files with 0 additions and 32 deletions

View File

@@ -79,10 +79,6 @@ where
Err(format!("Cannot assign to subscript of {} builtin", Self::bo_name()).to_type_error())
}
fn next(&mut self) -> LoadFunctionResult {
LoadFunctionResult::NotAFunction
}
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "\x1b[36m[{}]\x1b[39m", Self::bo_name())
}

View File

@@ -64,10 +64,6 @@ impl ValTrait for NativeFrameFunction {
Err("Cannot assign to subscript of native function".to_type_error())
}
fn next(&mut self) -> LoadFunctionResult {
LoadFunctionResult::NotAFunction
}
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "\x1b[36m[Function]\x1b[39m")
}

View File

@@ -92,10 +92,6 @@ impl ValTrait for NativeFunction {
Err("Cannot assign to subscript of native function".to_type_error())
}
fn next(&mut self) -> LoadFunctionResult {
LoadFunctionResult::NotAFunction
}
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "\x1b[36m[Function]\x1b[39m")
}

View File

@@ -143,10 +143,6 @@ impl ValTrait for ArrayPrototype {
Err("Cannot assign to subscript of Array.prototype".to_type_error())
}
fn next(&mut self) -> LoadFunctionResult {
LoadFunctionResult::NotAFunction
}
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "\x1b[36m[Array Prototype]\x1b[39m")
}

View File

@@ -74,8 +74,6 @@ pub trait ValTrait: fmt::Display {
fn sub(&self, key: Val) -> Result<Val, Val>;
fn submov(&mut self, key: Val, value: Val) -> Result<(), Val>;
fn next(&mut self) -> LoadFunctionResult;
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result;
fn codify(&self) -> String;
}
@@ -318,20 +316,6 @@ impl ValTrait for Val {
op_submov(self, key, value)
}
fn next(&mut self) -> LoadFunctionResult {
match self {
// TODO: iterator
_ => {
let next_fn = op_sub(self.clone(), "next".to_val());
match next_fn {
Ok(next_fn) => next_fn.load_function(),
Err(_) => LoadFunctionResult::NotAFunction,
}
}
}
}
fn pretty_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.pretty(), f)
}