Commit Graph

22 Commits

Author SHA1 Message Date
Colin c2fcc8b6ee implement very basic highlighting 2023-07-07 03:21:04 +00:00
Colin 27596798d6 enable minimal syntax highlighting 2023-07-06 23:45:49 +00:00
Colin e3736f7f1b add a `nix run '.#clean'` rule 2023-07-06 22:39:50 +00:00
Colin c9d79b0734 rework grammar to be friendly to injections
want to later support the case of multiple nix-shell directives in injection
2023-07-05 00:01:38 +00:00
Colin d5adafbc03 package.json: implement an always-failing content-regex 2023-07-04 22:30:27 +00:00
Colin ae324c9905 package.json: add first-line-regex
i made this more general than the embedded shebang detection

probably want to revisit the embedded shebangs to figure out if we even *want* that
2023-07-04 22:24:48 +00:00
Colin 6e771f63b0 expand injection-regex to handle more cases
docs describe this as "a regex pattern that will be tested against a *language name* in order to determine whether this language should be used for a potential *language injection* site."
2023-07-04 22:10:29 +00:00
Colin 8b2a63211d package.json: specify `scope` and `injection-regex` 2023-07-04 21:59:09 +00:00
Colin bd561cec7e commit package.json (as created by tree-sitter generate)
i need to insert custom attributes into this which are not auto-generated
2023-07-04 21:55:55 +00:00
Colin d1cb9847d9 accept tabs as whitespace 2023-07-04 21:38:19 +00:00
Colin ddc7cb75c4 rename nixshell -> nix_shell
tree-sitter doesn't allow hyphens in the grammar name
underscore is the approach used by e.g. tree-sitter-c-sharp
2023-07-04 10:53:52 +00:00
Colin 91997e2043 leave myself TODOs for the remaining edge cases 2023-07-04 10:22:30 +00:00
Colin 522472eaac allow more env paths 2023-07-04 10:13:53 +00:00
Colin 70f836ead6 test shebangs without /usr/bin/env, and with extra whitespace 2023-07-04 10:08:16 +00:00
Colin d656b1c0fe add whitespace tests 2023-07-04 10:06:12 +00:00
Colin 12849733b8 corpus: rename tests 2023-07-04 10:03:58 +00:00
Colin c45767a005 handle arguments to the `#!nix-shell` directive 2023-07-04 10:02:58 +00:00
Colin 9119b2ebca hide uninteresting nodes 2023-07-04 09:06:08 +00:00
Colin 28d79d458c handle embedded script payload 2023-07-04 08:57:44 +00:00
Colin 4db0ba409a minimal working grammar 2023-07-04 08:10:05 +00:00
Colin ec29df4a13 add nix infrastructure to build the grammar 2023-07-04 07:20:42 +00:00
Colin edd60ed689 initial commit 2023-07-04 06:58:34 +00:00