leave myself TODOs for the remaining edge cases

This commit is contained in:
2023-07-04 10:22:30 +00:00
parent 522472eaac
commit 91997e2043

View File

@@ -2,6 +2,7 @@ module.exports = grammar({
name: 'nixshell',
rules: {
// TODO: allow trailing whitespace on any line
source_file: $ => seq($.first_line, repeat($.next_line)),
first_line: $ => seq($._shebang_open, $._opt_ws, optional(seq($._env, $._ws)), $._nix_shell),
@@ -47,6 +48,7 @@ module.exports = grammar({
),
_shebang_open: $ => '#!',
// TODO: env accepts flags like `-v` or `--unset=NAME` or `VAR=VALUE` before `nix-shell`,
_env: $ => choice(
'/usr/bin/env',
'/bin/env',