pub struct charlexer<'t> {
    pub modify: fn(_: char) -> String,
    /* private fields */
}
Expand description

This struct is deprecated by charscanner. It is compatible with Lexer and Lextoken, which are also deprecated.

Fields

modify: fn(_: char) -> String

function to modify char returned by nextsym, can be changed. Both charlexer::make and charlexer::new sets this function initially to |x|{x.to_string()}. For example, some characters such as ‘{’ and ‘}’ cannot be used as terminal symbols of a grammar and must be translated into something like “LBRACE” and “RBRACE”

Implementations

creates a charlexer that emits only non-whitespace chars

creates a charlexer with the option of keeping whitespace chars if kws=true

Trait Implementations

returns current line number starting from 1

returns the index of the current char, starting from 1

returns slice of underlying data using std::str::Chars::as_str

retrieves the next Lextoken, or None at end-of-stream.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.