DebugObserver

Struct DebugObserver 

Source
pub struct DebugObserver<N: Node> { /* private fields */ }
Expand description

An observer that prints parsing steps to stdin.

You can provide this function to the ImmutableSyntaxTree::parse_with_observer to test particular syntax parser steps against an arbitrary token input.

Alternatively, consider using Node::debug where you can use arbitrary text instead of a predefined token stream.

Trait Implementations§

Source§

impl<N: Node> Default for DebugObserver<N>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<N: Node> Observer for DebugObserver<N>

Source§

type Node = N

Specifies a type of the Node that is currently being parsed.
Source§

fn read_token( &mut self, token: <Self::Node as Node>::Token, _token_ref: TokenRef, )

The parser reported consuming of a token from the token input stream. Read more
Source§

fn enter_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)

The parser reported the beginning of a syntax parsing rule. Read more
Source§

fn leave_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)

The parser reported the finishing of a syntax parsing rule. Read more
Source§

fn lift_node(&mut self, _node_ref: NodeRef)

The parser reported sibling node lifting to the current node. Read more
Source§

fn syntax_error(&mut self, _error_ref: ErrorRef)

The parser reported a syntax error occurred during the rule parsing. Read more

Auto Trait Implementations§

§

impl<N> Freeze for DebugObserver<N>

§

impl<N> RefUnwindSafe for DebugObserver<N>
where N: RefUnwindSafe,

§

impl<N> Send for DebugObserver<N>

§

impl<N> Sync for DebugObserver<N>

§

impl<N> Unpin for DebugObserver<N>
where N: Unpin,

§

impl<N> UnwindSafe for DebugObserver<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.