Internals
Logos' core functionalities are split across four crates:
logos
is the main crate, that you add to your project (inCargo.toml
) to obtain theLogos
derive macro. The public API is limited to this crate, and most users should only use this crate, not the others.logos-derive
is a very simply but necessary crate to exposelogos-codegen
's code as a derive macro.logos-codegen
contains the most technical parts of Logos: the code that reads you tokens definition, and generates optimized code to create blazingly fast lexers. You can read a blog post from the author of Logos to get a small insight of what thelogos-codegen
crate does. In the future, we hope to provide more documents about how this crate works, so people are more likely to understand it and improve it with pull requests (see the Contributing section).logos-cli
is a separate crate, that installs a binary of the same name, and allows to expand theLogos
derive macro into code. It can be installed withcargo install logos-cli
, and usage help can be obtained through thelogos-cli --help
command. This tool can be useful if your tokens definition stays is constant, and you want to reduce compilatio time overhead caused by derive macros.logos-fuzz
is an internal crate that uses afl.rs to find confusing panics before they reach the developer. To use this tool, see the Fuzzing guide