lang_util/
lib.rs

1//! `lang-util` is a crate that implements utilities to parse and represent syntax trees.
2//! It also provides error formatting facilities for parsers using
3//! [`lalrpop`](https://crates.io/crates/lalrpop).
4//!
5//! This crate is tailored for use in the [`glsl-lang`](https://crates.io/crates/glsl-lang) crate,
6//! but you may use its utilities for implementing your own language parsers:
7//! - [error]: parsing error reporting module, with user-readable location information. Only
8//!   available with the `lalrpop` feature enabled.
9//! - [node]: AST node structure and display
10//! - [position]: utilities for working with positions in strings
11
12#![deny(missing_docs)]
13
14pub use lang_util_derive::{NodeContentDisplay, Token};
15
16#[cfg(feature = "lalrpop")]
17pub mod error;
18
19mod file_id;
20pub use file_id::FileId;
21
22pub mod located;
23
24pub mod node;
25pub use node::NodeContent;
26
27pub mod position;
28
29pub mod token;
30pub use token::Token;
31
32// Re-exports
33pub use smol_str::SmolStr;
34pub use text_size::{TextRange, TextSize};