Registry / utility / logos
library0.16.1rscratesunverified

Create ridiculously fast Lexers using derive macros for token definitions.

# Cargo.toml [dependencies] logos = "0.16.1"
INSTALL
IMPORT
SIG · LOGOS
L
logos
utilityrustv0.16.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Logos
use logos::Logos;

Defines a simple token enum and lexes a string.

use logos::Logos; #[derive(Logos, Debug, PartialEq)] enum Token { #[token("hello")] Hello, #[token("world")] World, #[error] Error, } fn main() { let mut lex = Token::lexer("hello world"); assert_eq!(lex.next(), Some(Ok(Token::Hello))); assert_eq!(lex.next(), Some(Ok(Token::World))); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.16.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
logos — cargo add logos · libregistry