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

Function format_arg

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

Formats the given argument `i` in `scope` as a string depending on its `etype`.

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

Source from the content-addressed store, hash-verified

98
99/// Formats the given argument `i` in `scope` as a string depending on its `etype`.
100fn format_arg(scope: &Scope<'_>, i: u8, etype: ExprType) -> String {
101 match etype {
102 ExprType::Boolean => format!("{}", scope.get_boolean(i)),
103 ExprType::Double => format!("{}", scope.get_double(i)),
104 ExprType::Integer => format!("{}", scope.get_integer(i)),
105 ExprType::Text => scope.get_string(i).to_string(),
106 }
107}
108
109/// Formats variable argument `i` in `Scope` and returns the formatted argument, whether the
110/// argument was present, and the separator that was found.

Callers 4

format_varargFunction · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85

Calls 1

get_stringMethod · 0.80

Tested by

no test coverage detected