MCPcopy Index your code
hub / github.com/endbasic/endbasic / exec

Method exec

core/tests/testutils/callables/raise_cmd.rs:81–93  ·  view source on GitHub ↗
(&self, scope: Scope<'_>)

Source from the content-addressed store, hash-verified

79 }
80
81 fn exec(&self, scope: Scope<'_>) -> CallResult<()> {
82 let arg = scope.get_string(0);
83 match arg {
84 "argument" => Err(CallError::Argument("Bad argument".to_owned())),
85 "eval" => Err(CallError::Eval("Some eval error".to_owned())),
86 "internal" => Err(CallError::Eval("Some internal error".to_owned())),
87 "io" => Err(CallError::from(io::Error::other("Some I/O error"))),
88 "syntax" => Err(CallError::Syntax(scope.get_pos(0), "Some syntax error".to_owned())),
89 "syntax0" => Err(CallError::Syntax(scope.get_pos(0), "Some syntax error".to_owned())),
90 "syntax1" => Err(CallError::Syntax(scope.get_pos(1), "Some syntax error".to_owned())),
91 _ => Err(CallError::Argument("Invalid arguments".to_owned())),
92 }
93 }
94}

Callers

nothing calls this directly

Calls 2

get_stringMethod · 0.80
get_posMethod · 0.80

Tested by

no test coverage detected