Crates.io | glast |
lib.rs | glast |
version | 0.1.0 |
source | src |
created_at | 2022-09-28 16:08:43.896291 |
updated_at | 2023-01-05 15:05:32.292074 |
description | A crate for parsing and manipulating the OpenGL Shading Language. |
homepage | https://github.com/KubaP/glsl-lsp/tree/master/glast |
repository | https://github.com/KubaP/glsl-lsp |
max_upload_size | |
id | 675911 |
size | 696,966 |
glast is a crate for parsing and manipulating glsl abstract syntax trees, and a lot more.
⚠ This crate is still heavily work-in-progress.
The aims of this crate are to allow for parsing and analysis of the OpenGL Shading Language. This includes parsing source strings into ASTs, generating file formatting and syntax highlighting information, as well as performing analysis such as name resolution and type checking.
Unlike other similar crates and libraries, glast is designed to be 100% specification compliant. That means it correctly handles complex behaviours such as macro expansion and conditional compilation, even under some extremely unusual edge-cases.
glast is also made for IDEs in mind, meaning it handles syntax errors gracefully and has excellent error recovery strategies to produce "best effort" results. It also produces syntax and semantic diagnostics, as well as information for syntax highlighting purposes.
Feature | Status |
---|---|
Parsing of tokens | ✔ |
Parsing of directives | ✔ |
Handling the line-continuation character | ✔ |
Switching GLSL version grammar on-the-fly | ✔ |
100% specification compliant behaviour | ✔ [1] |
[1]: Minor discrepancy that would almost never be hit. See Issue#4.
Feature | Status |
---|---|
Parsing of GLSL language constructs | ✔ |
Parsing all GLSL versions | ⚠ [2] |
Correct expansion of macros | ✔ |
Handling conditional compilation | ✔ |
Producing syntax errors and relevant semantic diagnostics | ✔ |
Producing syntax highlighting information | ✔ |
Producing information for file formatting | ❌ |
Visitor API | ❌ |
100% specification compliant behaviour | ⚠ [3] |
[2]: Only GLSL 450 & 460 are currently supported.
[3]: Not enough tests to validate with great certainty.
❌ Work not started yet.
This project is licensed under the MIT license - see LICENSE for details.