pub struct AlgolShapeParser { /* private fields */ }Expand description
ShapeExprParser adapter that parses string input with an Algol
PrattTable.
This lets callers build a PrattShape over the real Algol parser instead
of carrying a local test-only adapter. The parser returns the raw Pratt
expression tree; number-domain lowering belongs to codec decode paths that
have a runtime context.
Implementations§
Source§impl AlgolShapeParser
impl AlgolShapeParser
Sourcepub fn new(table: PrattTable) -> Self
pub fn new(table: PrattTable) -> Self
Build an adapter backed by table.
Sourcepub fn table(&self) -> &PrattTable
pub fn table(&self) -> &PrattTable
Return the Pratt table used by this adapter.
Trait Implementations§
Source§impl ShapeExprParser for AlgolShapeParser
impl ShapeExprParser for AlgolShapeParser
Source§fn label(&self) -> &str
fn label(&self) -> &str
A short human-readable name for this parser, shown in shape descriptions.
Source§fn parse_expr(&self, source: &str) -> Result<Expr>
fn parse_expr(&self, source: &str) -> Result<Expr>
Parse source text into an expression to match against the inner shape.
Source§fn is_effectful(&self) -> bool
fn is_effectful(&self) -> bool
Whether parsing may run effects;
false by default.Auto Trait Implementations§
impl Freeze for AlgolShapeParser
impl RefUnwindSafe for AlgolShapeParser
impl Send for AlgolShapeParser
impl Sync for AlgolShapeParser
impl Unpin for AlgolShapeParser
impl UnsafeUnpin for AlgolShapeParser
impl UnwindSafe for AlgolShapeParser
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