mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00
remove error on "wrong" main function args (which are no longer "wrong" since the last commit)
This commit is contained in:
parent
47dc763b23
commit
701ead37c1
@ -427,9 +427,6 @@ pub struct RScript {
|
||||
}
|
||||
impl RScript {
|
||||
pub fn new(main: RFunction, info: GSInfo) -> Result<Self, ToRunnableError> {
|
||||
if main.inputs.len() != 1 {
|
||||
return Err(ToRunnableError::MainWrongInput);
|
||||
}
|
||||
Ok(Self { main, info })
|
||||
}
|
||||
pub fn run(&self, args: Vec<VData>) -> VData {
|
||||
|
@ -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?).")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user