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

Method expected_nargs

core/src/callable.rs:350–362  ·  view source on GitHub ↗

Computes the range of the expected number of parameters for this syntax.

(&self)

Source from the content-addressed store, hash-verified

348
349 /// Computes the range of the expected number of parameters for this syntax.
350 pub(crate) fn expected_nargs(&self) -> RangeInclusive<usize> {
351 let mut min = self.singular.len();
352 let mut max = self.singular.len();
353
354 if let Some(syn) = self.repeated.as_ref() {
355 if syn.require_one {
356 min += 1;
357 }
358 max = usize::MAX;
359 }
360
361 min..=max
362 }
363
364 /// Returns true if this syntax represents "no arguments".
365 pub(crate) fn is_empty(&self) -> bool {

Callers 1

find_syntaxMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected