From 9141cba6a9db6ae3106e39d92508cb91c390049b Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Mon, 8 Nov 2021 12:01:35 +0100 Subject: Deal with the effects of keywords --- src/parse/parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/parse/parser.rs') diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 451e18f1..31c918a8 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -95,6 +95,12 @@ impl<'s> Parser<'s> { output } + /// End the parsing process and return multiple children, even if there + /// remains stuff in the string. + pub fn eject_partial(self) -> Option> { + self.group_success().then(|| self.children) + } + /// Whether the end of the source string or group is reached. pub fn eof(&self) -> bool { self.eof -- cgit v1.2.3