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

Function format_vararg

core/tests/testutils/callables/mod.rs:111–123  ·  view source on GitHub ↗

Formats variable argument `i` in `Scope` and returns the formatted argument, whether the argument was present, and the separator that was found.

(scope: &Scope<'_>, i: u8)

Source from the content-addressed store, hash-verified

109/// Formats variable argument `i` in `Scope` and returns the formatted argument, whether the
110/// argument was present, and the separator that was found.
111fn format_vararg(scope: &Scope<'_>, i: u8) -> (String, bool, ArgSep) {
112 match scope.get_type(i) {
113 VarArgTag::Immediate(sep, etype) => {
114 let formatted = format_arg(scope, i + 1, etype);
115 (format!("{}{}", formatted, etype.annotation()), true, sep)
116 }
117 VarArgTag::Missing(sep) => ("()".to_owned(), false, sep),
118 VarArgTag::Pointer(sep) => {
119 let typed_ptr = scope.get_ref(i + 1);
120 (typed_ptr.to_string(), true, sep)
121 }
122 }
123}
124
125/// Registers all test-only callables into `upcalls_by_name`.
126pub(super) fn register_all(

Callers 5

execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85

Calls 3

format_argFunction · 0.85
get_typeMethod · 0.80
get_refMethod · 0.80

Tested by

no test coverage detected