https://github.com/tracyxmr/twee
A Lua/Luau parser for code analysis and editor integration.
https://github.com/tracyxmr/twee
lua luau parser tree-sitter
Last synced: 5 months ago
JSON representation
A Lua/Luau parser for code analysis and editor integration.
- Host: GitHub
- URL: https://github.com/tracyxmr/twee
- Owner: tracyxmr
- Created: 2025-07-24T21:26:26.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-07-29T11:18:49.000Z (8 months ago)
- Last Synced: 2025-11-17T20:29:49.446Z (5 months ago)
- Topics: lua, luau, parser, tree-sitter
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twee
A Lua/Luau parser for code analysis and editor integration.
# features
* Serialize program into JSON.
* Parses local variable declarations along with type annotations.
* Parses binary operations as expressions, ordered by precedence.
* Allows for optional ';' after statements.
* Serializes with proper key-pair value resolution.
# example
Test for type annotations for Luau source:
```luau
local name: string = "blinx"
```
Output:
```json
[
{
"VariableDecl": {
"name": "name",
"value": {
"String": "blinx"
},
"type_annotation": "string"
}
}
]
```
# usage + test
```
cargo test
```
or
```
$ cargo build
$ ./twee --input example/input.lua --output example/tree.json
```