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

Method describe

core/src/callable.rs:206–236  ·  view source on GitHub ↗

Formats the repeated argument syntax for help purposes into `output`. `last_singular_sep` contains the separator of the last singular argument syntax, if any, which we need to place inside of the optional group.

(&self, output: &mut String, last_singular_sep: Option<&ArgSepSyntax>)

Source from the content-addressed store, hash-verified

204 /// `last_singular_sep` contains the separator of the last singular argument syntax, if any,
205 /// which we need to place inside of the optional group.
206 fn describe(&self, output: &mut String, last_singular_sep: Option<&ArgSepSyntax>) {
207 if !self.require_one {
208 output.push('[');
209 }
210
211 if let Some(sep) = last_singular_sep {
212 sep.describe(output);
213 }
214
215 output.push_str(&self.name);
216 output.push('1');
217 if let RepeatedTypeSyntax::TypedValue(vtype) = self.type_syn {
218 output.push(vtype.annotation());
219 }
220
221 if self.require_one {
222 output.push('[');
223 }
224
225 self.sep.describe(output);
226 output.push_str("..");
227 self.sep.describe(output);
228
229 output.push_str(&self.name);
230 output.push('N');
231 if let RepeatedTypeSyntax::TypedValue(vtype) = self.type_syn {
232 output.push(vtype.annotation());
233 }
234
235 output.push(']');
236 }
237}
238
239/// Syntax specification for a parameter that accepts any scalar type.

Callers 1

format_oneMethod · 0.45

Calls 7

pushMethod · 0.80
push_strMethod · 0.80
annotationMethod · 0.80
iterMethod · 0.80
is_emptyMethod · 0.45
enumerateMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected