Computes the range of the expected number of parameters for this syntax.
(&self)
| 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 { |