Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alaviss/tree-sitter-nim
tree-sitter grammar for Nim
https://github.com/alaviss/tree-sitter-nim
nim parser tree-sitter treesitter
Last synced: 13 days ago
JSON representation
tree-sitter grammar for Nim
- Host: GitHub
- URL: https://github.com/alaviss/tree-sitter-nim
- Owner: alaviss
- License: mpl-2.0
- Created: 2022-08-25T02:55:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-11T23:55:00.000Z (6 months ago)
- Last Synced: 2024-07-13T01:12:21.460Z (6 months ago)
- Topics: nim, parser, tree-sitter, treesitter
- Language: JavaScript
- Homepage:
- Size: 101 MB
- Stars: 45
- Watchers: 6
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# Tree sitter grammar for Nim
A [tree-sitter] grammar for [Nim].
The goal is to parse a superset of Nim and create a syntax tree that can be
easily ingested by tools.## Notes
Generating this parser take around 7GiB of memory. Any help in reducing
the parser size is appreciated.## Progress
Right now the parser is capable of parsing all of Nim, with exceptions for old
and mostly unused/dead syntax, including:- Package-level objects (ie. `type X.Y = ref Z`)
- Variable declaration with dots for "partial" objects (ie. `let x.y = z`).
- Covariance in generics for imported types (ie. `type X[out T] = Z`).
These were omitted due as they are a product of old language experiments that
never caught on, and omitting them allows for simpler and more compact parser,
but support might be added on request.The parser correctness has not been thoroughly tested.
## Stability
Node names and structures are not expected to change between releases.
## License
The project is licensed under the [Mozilla Public License version 2.0][MPL]
[tree-sitter]: https://github.com/tree-sitter/tree-sitter
[Nim]: https://github.com/nim-lang/Nim
[MPL]: https://www.mozilla.org/en-US/MPL/2.0/