use crate::T;
use crate::cst::cst::Goto;
use crate::cst::cst::Label;
use crate::error::ParseError;
use crate::parser::Parser;
use mago_allocator::prelude::*;
impl<'arena, A> Parser<'_, 'arena, A>
where
A: Arena,
{
pub(crate) fn parse_goto(&mut self) -> Result<Goto<'arena>, ParseError> {
Ok(Goto {
goto: self.expect_keyword(T!["goto"])?,
label: self.parse_local_identifier()?,
terminator: self.parse_terminator()?,
})
}
pub(crate) fn parse_label(&mut self) -> Result<Label<'arena>, ParseError> {
Ok(Label { name: self.parse_local_identifier()?, colon: self.stream.eat_span(T![":"])? })
}
}