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 token::Token;

Modules

Located type definition

AST type definitions

Input position representation types

Token derive support definitions

Structs

Unique file identifier

A SmolStr is a string type that has the following properties:

A range in text, represented as a pair of TextSize.

A measure of text length. Also, equivalently, an index into text.

Traits

Trait for AST node contents.

Derive Macros

Mark a type as representing data in an AST node

Derive lang_util::error::Token for an enum usable with Logos