diff --git a/crates/oyster_parser/src/parser.rs b/crates/oyster_parser/src/parser.rs index fc371dc..bbf06bc 100644 --- a/crates/oyster_parser/src/parser.rs +++ b/crates/oyster_parser/src/parser.rs @@ -114,15 +114,6 @@ impl Iterator for Parser<'_> { }}; } - macro_rules! tailcall { - ($rule:expr) => {{ - use NodeKind::*; - self.stack.pop(); - self.stack.push($rule); - Some(ParseEvent::StartNode($rule)) - }}; - } - macro_rules! leaf { ($type:expr $(, $mode:ident)?) => {{ use NodeKind::*; @@ -200,7 +191,7 @@ impl Iterator for Parser<'_> { Newlines => leaf!(Newlines), Comment => leaf!(Comment), PlainText | DoubleQuote | OpeningParenthesis | EscapedChar => { - tailcall!(Command) + chain!(call!(Command), ret!()) } Semicolon => chain_buf!(chain!(error!(UnexpectedSemicolon), ret!()), ret!()), Pipe => chain!(error!(UnexpectedPipe), ret!()),