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

Method exec

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

Source from the content-addressed store, hash-verified

64 }
65
66 fn exec(&self, scope: Scope<'_>) -> CallResult<()> {
67 let mut output = self.output.borrow_mut();
68
69 let mut i = 0;
70
71 let (formatted, present, sep) = format_vararg(&scope, i);
72 assert_ne!(ArgSep::End, sep, "Command expects more arguments");
73 output.push_str(&formatted);
74 output.push('\n');
75 i += 1;
76 if present {
77 i += 1;
78 }
79
80 let formatted = format_arg(&scope, i, ExprType::Integer);
81 output.push_str(&formatted);
82 output.push('\n');
83 i += 1;
84
85 let (formatted, present, sep) = format_vararg(&scope, i);
86 assert!(present, "Last argument is not optional");
87 assert_eq!(ArgSep::End, sep, "No more arguments expected");
88 output.push_str(&formatted);
89 output.push('\n');
90
91 Ok(())
92 }
93}

Callers

nothing calls this directly

Calls 4

format_varargFunction · 0.85
format_argFunction · 0.85
push_strMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected