mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Remove next stubs
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user