Adds an alternative requirement to the list of alternatives.
(&mut self, requirement: LexRequirement)
| 738 | |
| 739 | /// Adds an alternative requirement to the list of alternatives. |
| 740 | pub fn add_alternative(&mut self, requirement: LexRequirement) { |
| 741 | match self { |
| 742 | Self::Hard(alts) | Self::Soft(alts) => alts.push(requirement), |
| 743 | } |
| 744 | } |
| 745 | |
| 746 | /// Returns the first (i.e. most preferred) `LexRequirement` among |
| 747 | /// alternative requirements. |