Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
TGQE
TOC
I. Description
TGQE is a Crate that makes it easy to integrate error handling from various compiler frontends, and comes with error conversions for multiple libraries and tunable configuration environment variables. When the number of errors exceeds a threshold, the remaining errors can be stored in SQLite to maintain a good reading experience. It uses Ariadne as the rendering implementation by default.
This project has no special relationship with the other projects mentioned in this document.
tgqeis only a comprehensive integration library, it cannot help you write a good Lexer and Parser.
II. Usage
2.1 Quick Start
First, add tgqe to your project with the following command:
cargo add tgqe
Then enable the relevant features in your Cargo.toml. The currently available features are:
[]
= ["ariadne", "dotenvy", "chrono"]
= ["chumsky"]
= ["logos"]
= ["winnow"]
= ["sqlx", "sqlx-sqlite", "chrono", "tokio", "dotenvy"]
= ["renderer", "trans-chumsky", "store-to-db"]
= ["renderer", "trans-winnow" , "store-to-db"]
= ["renderer", "trans-logos" , "store-to-db"]
= ["chumsky-full", "winnow-full", "logos-full"]
Since most of
logos's errors are compile-time errors, currently onlylogos::Spanis converted.
2.2 Simple Example
Here is a simple example:
use *;
use TgqeLevelFilter;
use ;
// Your Custom Lexer Implements
// Only required if the `store-to-db` feature is enabled
async
2.3 Integrate
You can also use it as an integration for your hand-written compiler frontend.
Sometimes what we need is not a specific error, but an object that "looks like an error and can express the information we need".
tgqe exposes the following main information structs:
As you can see, these are all plain structs rather than inscrutable generic gymnastics, so you can easily implement From for your own data structures.
For example, for chumsky::error::Rich:
use Rich;
2.4 Example
You can check tgqe-golex-example for more information.
III. Output
The default renderer implementation of this project is based on Ariadne. It consumes the TgqeCtx objects and outputs error messages like the following:

IV. License
This project is open-sourced under the BSD-3 license.