https://github.com/himujjal/css-parser-zig
A SCSS/CSS Parser in Zig
https://github.com/himujjal/css-parser-zig
Last synced: 2 months ago
JSON representation
A SCSS/CSS Parser in Zig
- Host: GitHub
- URL: https://github.com/himujjal/css-parser-zig
- Owner: Himujjal
- Created: 2022-04-25T02:17:00.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-29T14:50:24.000Z (over 2 years ago)
- Last Synced: 2025-03-17T01:45:10.467Z (2 months ago)
- Language: Zig
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSS Parser in Zig
A high-performance CSS Parser in Zig optimized for performance rather than memory.
## Features
- A Parser that parses CSS adhering to full compilance to CSSTree
- Written in Zig for optimum performance and small size (future: WebAssembly)
- Easy to make high level bindings for whoever wishes to make something out of this using a
serializable AST binary format or the CSSTree JSON format.## Projects using this:
1. SCSS/SASS compiler in Zig
2. Svelte compiler in Zig## AST Binary format
To make it easy to transfer the parsed AST to other languages/runtimes (so that we don't have
to worry about their memory management), The Nodes of the AST can be easily serialized in the
form of a bytecode array (`[]const u8`).To know more about the bytecode array, follow the guide: [Serializing_Deserializing_AST](./AST_SERIALIZE.md)
## TODO
- [ ] All test cases from [csstree](https://github.com/csstree/csstree)
- [ ] Error Handling - Errors as enum and the generated error strings according to each enum