mago-syntax 1.47.2

A correct, fast, and memory-efficient PHP syntax implementation, including Lexer, Parser, AST, and utilities for Mago.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::T;
use crate::cst::cst::Throw;
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_throw(&mut self) -> Result<Throw<'arena>, ParseError> {
        Ok(Throw { throw: self.expect_keyword(T!["throw"])?, exception: self.arena.alloc(self.parse_expression()?) })
    }
}