From 701ead37c14f1dee07dcf689244ced19aef71c3a Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 17 Jun 2023 15:35:42 +0200 Subject: [PATCH] remove error on "wrong" main function args (which are no longer "wrong" since the last commit) --- mers/src/lang/code_runnable.rs | 3 --- mers/src/lang/to_runnable.rs | 5 ----- 2 files changed, 8 deletions(-) diff --git a/mers/src/lang/code_runnable.rs b/mers/src/lang/code_runnable.rs index 5785567..880e3d8 100755 --- a/mers/src/lang/code_runnable.rs +++ b/mers/src/lang/code_runnable.rs @@ -427,9 +427,6 @@ pub struct RScript { } impl RScript { pub fn new(main: RFunction, info: GSInfo) -> Result { - if main.inputs.len() != 1 { - return Err(ToRunnableError::MainWrongInput); - } Ok(Self { main, info }) } pub fn run(&self, args: Vec) -> VData { diff --git a/mers/src/lang/to_runnable.rs b/mers/src/lang/to_runnable.rs index b3b9de4..44a68e1 100755 --- a/mers/src/lang/to_runnable.rs +++ b/mers/src/lang/to_runnable.rs @@ -21,7 +21,6 @@ use super::{ }; pub enum ToRunnableError { - MainWrongInput, UseOfUndefinedVariable(String), UseOfUndefinedFunction(String), UnknownType(String), @@ -63,10 +62,6 @@ impl FormatGs for ToRunnableError { file: Option<&crate::parsing::file::File>, ) -> std::fmt::Result { match self { - Self::MainWrongInput => write!( - f, - "Main function had the wrong input. This is a bug and should never happen." - ), Self::UseOfUndefinedVariable(v) => { write!(f, "Cannot use variable \"{v}\" as it isn't defined (yet?).") }