rustc-ap-rustc_lexer 665.0.0

Automatically published version of the package `rustc_lexer` in the rust-lang/rust repository from commit f315c35a77e40bd11ce81fedc0556be0f410bbf4 The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish
Documentation

Low-level Rust lexer.

The idea with librustc_lexer is to make a reusable library, by separating out pure lexing and rustc-specific concerns, like spans, error reporting an interning. So, rustc_lexer operates directly on &str, produces simple tokens which are a pair of type-tag and a bit of original text, and does not report errors, instead storing them as flags on the token.

Tokens produced by this lexer are not yet ready for parsing the Rust syntax, for that see librustc_parse::lexer, which converts this basic token stream into wide tokens used by actual parser.

The purpose of this crate is to convert raw sources into a labeled sequence of well-known token types, so building an actual Rust token stream will be easier.

Main entity of this crate is [TokenKind] enum which represents common lexeme types.