https://github.com/will/tree-sitter-crystal
https://github.com/will/tree-sitter-crystal
crystal hacktoberfest
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/will/tree-sitter-crystal
- Owner: will
- License: mit
- Created: 2021-07-27T17:58:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-02T22:13:47.000Z (over 4 years ago)
- Last Synced: 2024-04-14T02:21:34.593Z (almost 2 years ago)
- Topics: crystal, hacktoberfest
- Language: C
- Homepage:
- Size: 888 KB
- Stars: 21
- Watchers: 10
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-crystal
A WIP [tree-sitter](https://tree-sitter.github.io/) grammar for [Crystal](https://crystal-lang.org).
## Status
- [x] Comments
- [ ] Literals
- [x] nil
- [x] bool
- [x] float
- [x] integer
- [x] symbol
- [x] char
- [ ] string
- [x] literals
- [ ] interpolation
- [x] array
- [x] hash
- [x] array-or-hash-index-access (`foo[0]` or `foo[:something]`)
- [x] range
- [x] regex
- [x] tuple
- [x] namedtuple
- [ ] proc
- [ ] command
- [x] literals
- [ ] interpolation
- [x] Assignment
- [x] to local var
- [x] to instance var
- [x] to class var
- [x] to constant
- [x] to "assignment methods"/properties
- [x] multiple-assignment
- [ ] Binary operations
- [x] basic support
- [ ] per-operator precedence definitions
- [x] Variables
- [x] local variables
- [x] instance variables
- [x] class variables
- [x] constants
- [ ] Control expressions
- [ ] if/else
- [ ] "block-level" form (`if something ; stuff ; else ; end`)
- [ ] "suffix" form (`foo = bar if something`)
- [ ] unless
- [ ] "block-level" form (`unless something ; stuff ; else ; end`)
- [ ] "suffix" form (`foo = bar unless something`)
- [ ] case
- [ ] while
- [ ] until
- [x] `require` statements
- [x] Type grammar
- [x] Basic "bare" types (e.g. `Foo`)
- [x] Namespaced types (e.g. `Some::Namespace::Foo`)
- [x] Generic types (e.g. `Foo(T)` and `Foo(A, B)`)
- [x] Union types
- [x] Class definitions
- [x] Module definitions
- [x] `include` statements
- [x] Structs
- [x] Enums
- [x] Type annotations
- [x] in variable declarations
- [x] in method parameter declarations
- [x] as method return types
- [x] `alias` statements
- [ ] Blocks
- [x] `do` blocks (with and without parameters)
- [x] `{|x| whatever }` blocks (with parameters only)
- [ ] `begin`...`rescue`...`end` blocks
- [x] Method definitions
- [x] Method calls
- [ ] "Bare" function calls (like `puts 1` and `puts(1)`)
- [ ] Splats
- [ ] in method calls
- [ ] in method definitions
- [ ] Macros
- [ ] Annotations
## Developing
To test `tree-sitter generate && tree-sitter test` (or just `npm test`)