Crate lang_util

Source
Expand description

lang-util is a crate that implements utilities to parse and represent syntax trees. It also provides error formatting facilities for parsers using lalrpop and logos.

This crate is tailored for use in the glsl-lang crate, but you may use its utilities for implementing your own language parsers:

  • [error]: parsing error reporting module, with user-readable location information. Only available with the lalrpop feature enabled.
  • node: AST node structure and display
  • position: utilities for working with positions in strings

Re-exports§

pub use node::NodeContent;
pub use token::Token;

Modules§

located
Located type definition
node
AST type definitions
position
Input position representation types
token
Token derive support definitions

Structs§

FileId
Unique file identifier
SmolStr
A SmolStr is a string type that has the following properties:
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.

Derive Macros§

NodeContentDisplay
Derives an implementation of NodeContentDisplay for the given type.
Token
Derive lang_util::error::Token for an enum usable with Logos