Struct rustdoc::html::highlight::Classifier[][src]

pub struct Classifier<'a> {
    lexer: StringReader<'a>,
    codemap: &'a CodeMap,
    in_attribute: bool,
    in_macro: bool,
    in_macro_nonterminal: bool,
}

Processes a program (nested in the internal lexer), classifying strings of text by highlighting category (Class). Calls out to a Writer to write each span of text in sequence.

Fields

Methods

impl<'a> Classifier<'a>
[src]

Gets the next token out of the lexer, emitting fatal errors if lexing fails.

Exhausts the lexer writing the output into out.

The general structure for this method is to iterate over each token, possibly giving it an HTML span with a class specifying what flavor of token is used. All source code emission is done as slices from the source map, not from the tokens themselves, in order to stay true to the original source.

Auto Trait Implementations

impl<'a> !Send for Classifier<'a>

impl<'a> !Sync for Classifier<'a>