pub struct Parser { /* private fields */ }Expand description
递归下降解析器。
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_limits(input: &str, limits: Limits) -> Self
pub fn with_limits(input: &str, limits: Limits) -> Self
从字符串创建解析器并指定预算。
Sourcepub fn parse_with_limits(
input: &str,
limits: Limits,
) -> Result<Expr, ParseError>
pub fn parse_with_limits( input: &str, limits: Limits, ) -> Result<Expr, ParseError>
解析完整表达式,要求输入被完全消费并满足给定预算。
预算在构造 AST 的过程中生效:右结合蕴含链与扁平的二元链同样受限, 不会先建成深树再检查。
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more