From f257f471f49bf13adf56868d8f8609309c7e100b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 21 Jul 2023 11:40:15 +0800 Subject: grammar/label: `set_end_option` * grammar/src/label.rs (set_end_option): This function replaces the old function `open_end`, as this new function is more general than the old one, and there is no specific situation where we only need to open the end of a node without the need to close the node in an `if` statement. --- grammar/src/label.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grammar') diff --git a/grammar/src/label.rs b/grammar/src/label.rs index e3f3422..fd626cd 100644 --- a/grammar/src/label.rs +++ b/grammar/src/label.rs @@ -143,10 +143,10 @@ impl GrammarLabel { self.end = Some(end); } - /// Remove the ending boundary. + /// Set the end according to an option directly. #[inline] - pub fn open_end(&mut self) { - self.end = None; + pub fn set_end_option(&mut self, end: Option) { + self.end = end; } /// Return a string description with the help of the associated -- cgit v1.2.3-18-g5258