#lexer #token #publishing #enums #sequence #raw #syntax

fast-rustc-ap-rustc_lexer

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

1 stable release

1.0.0 Mar 10, 2020

#1558 in Rust patterns


Used in 5 crates (2 directly)

MIT/Apache

50KB
1K SLoC

Low-level Rust lexer.

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.

Dependencies

~58KB