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

Method exec

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

Source from the content-addressed store, hash-verified

51 }
52
53 fn exec(&self, scope: Scope<'_>) -> CallResult<()> {
54 let mut result = String::new();
55 let mut reg = 0;
56 loop {
57 let sep = match scope.get_type(reg) {
58 VarArgTag::Immediate(sep, etype) => {
59 reg += 1;
60 match etype {
61 ExprType::Text => result.push_str(scope.get_string(reg)),
62 _ => {
63 return Err(CallError::Argument(
64 "Only accepts string values".to_owned(),
65 ));
66 }
67 }
68 sep
69 }
70
71 _ => return Err(CallError::Argument("Only accepts string values".to_owned())),
72 };
73 reg += 1;
74
75 if sep == ArgSep::End {
76 break;
77 }
78 }
79 scope.return_string(result)
80 }
81}

Callers

nothing calls this directly

Calls 4

get_typeMethod · 0.80
push_strMethod · 0.80
get_stringMethod · 0.80
return_stringMethod · 0.80

Tested by

no test coverage detected