545d090540
Mark 'comment' as injecting 'comment'
...
Neovim defines queries for the 'comment' language, to match 'TODO',
'FIXME', etc...
2022-06-04 10:43:35 +02:00
10dae1ab92
Add scanner to bindings
2022-06-04 10:43:35 +02:00
c4af009a8d
Fix Cargo manifest
2022-06-04 10:43:35 +02:00
efe0a2800b
Add comment about 'locals' queries limitations
...
This is not enough of an issue to avoid using the functionality however,
for example variable declarations are thankfully not affected by this
issue, since they *must* be declared before their use.
2022-06-04 10:43:35 +02:00
184d3b9953
Add function tags
2022-06-04 10:43:35 +02:00
3e1068a336
Add built-in types
...
Not sure why it seems like the 'is-not? local' is not working.
Will investigate later
2022-06-03 22:04:30 +02:00
2d89ec8b20
Add built-in functions
...
continuous-integration/drone/push Build is passing
This is a good proxy test to ensure that scope queries work correctly.
2022-06-03 21:09:11 +02:00
073ff80adb
Add basic scoping queries
2022-06-03 21:02:40 +02:00
64ff9dd944
Add import path high-lighting
...
I don't think this group is supported by neovim, but 'tree-sitter-nix'
makes use of it, and I think it makes sense to add it.
2022-06-03 20:35:53 +02:00
bd42c2c9c1
Move 'literals' high-lighting to end of file
...
Once again, seems like order matters, and I want to be able to write more specific queries.
2022-06-03 20:30:45 +02:00
aff11eefce
More specific loop keyword high-lighting
2022-06-03 20:28:28 +02:00
b22ca8cd67
More specific function keyword high-lighting
...
I learnt about this group by reading the nvim-treesitter source [1].
[1]: see 'lua/nvim-treesitter/highlight.lua'
2022-06-03 20:15:09 +02:00
5f38f649bd
Ignore WASM artifact
2022-06-03 20:02:00 +02:00
b998075f2d
Use play-ground enabled 'tree-sitter' in devShell
...
This is actually quite useful for debugging it turns out :-).
2022-06-03 20:00:32 +02:00
62a601469e
Add functions high-lighting
2022-06-03 19:59:56 +02:00
67b555c381
Move 'misc' high-lighting to end of file
...
Turns out that order *matters* for queries.
Tree-sitter will stop at the first match it seems. So I want the
hyper-general 'identifier' matching right at the end to avoid overriding
more specific rules.
2022-06-03 19:58:19 +02:00
752f941589
Fix 'nix flake check'
...
continuous-integration/drone Build is passing
Turns out that 'tree-sitter' is not wrapped to have node and a compiler
available, because nixpkgs assumes that grammars already include
generated files.
So wrap it manually and use that in our pre-commit/checks.
2022-06-03 16:00:13 +02:00
02f89ac524
Refactor nix package
...
Introduce an overlay, and use the existing 'tree-sitter' package
machinery to extend it with this grammar.
Expose the extended 'tree-sitter' as part of the flake packages.
2022-06-03 15:58:16 +02:00
964d796b4b
Fix 'nix flake check' evaluation
...
I should figure out why 'pre-commit' even needs dotnet at some point...
2022-06-03 15:58:12 +02:00
c48624c0f3
Add string escape high-lighting
2022-06-03 12:58:34 +02:00
47eb986835
Add Drone CI
2022-06-03 12:00:05 +02:00
6cec0e4a68
Add nix package
2022-06-03 11:59:30 +02:00
558e45aeed
Add ':' as delimiter
2022-06-03 11:43:43 +02:00
0b17386cad
Add ':=' to 'operator'
2022-06-03 11:42:57 +02:00
82bbebeeb5
Inline '_function_declaration_common'
...
This is purely an de-duplication rule, we don't need to make it part of
the parse tree.
2022-06-03 10:59:54 +02:00
0b549493a2
Add identifiers high-lighting
...
We now make use of the more specific '_type_identifier' and
'_field_identifier' rules!
2022-06-03 10:44:10 +02:00
da494122ea
Replace '_typed_field' by more specific grammar
...
Instead of re-using a common rule, inline its definition and use
'_field_identifier' where appropriate.
This is useful for more accurate high-lighting.
2022-06-03 10:40:14 +02:00
5d37bf7bd1
Use 'type_identifier' in array type declaration
2022-06-03 10:35:53 +02:00
0827093fe7
Add 'field_identifier' alias
...
This will be useful for high-lighting.
2022-06-03 10:31:30 +02:00
abe5b2e366
Add 'misc' grouping
2022-06-03 10:16:44 +02:00
2be5056793
Add 'type_identifier' alias
...
This is more appropriate, and actually closer to the specified grammar.
2022-06-03 10:15:40 +02:00
6e40691a35
Add operators highlighting
2022-06-03 10:08:58 +02:00
d83fa3acb7
Add keywords highlighting
2022-06-02 22:27:58 +02:00
751929a058
Fix whitespace skipping in scanner
...
Once again, implicit fall-through is the devil.
2022-06-02 22:27:13 +02:00
61f03a116c
Add additional test for comments
2022-06-02 22:20:37 +02:00
b836117a21
Add literals highlighting
2022-06-02 22:20:37 +02:00
b9376ccd35
Add comment syntax highlighting
2022-06-02 22:20:37 +02:00
84d25af8d5
Add language information to 'package.json'
...
Apparently this is needed by the 'tree-sitter' tooling for syntax
highlighting.
2022-06-02 22:20:37 +02:00
5866cd4a82
Add 'tree-sitter' pre-commit hook
...
Make sure you don't break anything when committing.
2022-06-02 22:20:37 +02:00
b3e91d9aad
Add 'tree-sitter-files' pre-commit hook
...
This is too ensure that generated files are always in lock-step with the
grammar.
2022-06-02 22:20:37 +02:00
8f752e0f94
Add 'clang-format' pre-commit hook
2022-06-02 22:20:37 +02:00
5be01b43fb
Add clang-format rules
...
Since we now have an external scanner, might as well have good looking
code.
2022-06-02 22:20:37 +02:00
50a0eaa071
Add support for nested comments
...
Unfortunately, the 'extras' array expects single tokens only, so one
can't really use a recursive parsing rule to express nesting comments...
2022-06-02 22:20:37 +02:00
75bb2c7009
Add comments
...
For now it only supports non-nested comments. It seems like I *will*
need to write an external lexer to account for nesting properly.
2022-06-02 17:07:30 +02:00
e5e958cac9
Add tests for sequence expressions
2022-06-02 17:07:30 +02:00
e59aeed31a
Remove nested 'parameters' field
...
The 'parameters' production rule does not need itself to have a
'parameters' field, this is redundant information.
2022-06-02 17:07:30 +02:00
76b558a982
Add return type to function declarations
2022-06-02 17:07:30 +02:00
1e5f7cd5d5
Add array types
2022-06-02 17:07:30 +02:00
dd0af53fa0
Add record types
2022-06-02 17:07:30 +02:00
506fab8896
Add type declarations
...
For now, simplified to type aliases only.
2022-06-02 17:07:30 +02:00