accept tabs as whitespace
This commit is contained in:
@@ -15,6 +15,26 @@ nix-shell shebang whitespace
|
||||
#! /usr/bin/env nix-shell
|
||||
---
|
||||
|
||||
(source_file
|
||||
(first_line))
|
||||
|
||||
==================
|
||||
nix-shell shebang tab
|
||||
==================
|
||||
|
||||
#! /usr/bin/env nix-shell
|
||||
---
|
||||
|
||||
(source_file
|
||||
(first_line))
|
||||
|
||||
==================
|
||||
nix-shell shebang tabs and spaces
|
||||
==================
|
||||
|
||||
#! /usr/bin/env nix-shell
|
||||
---
|
||||
|
||||
(source_file
|
||||
(first_line))
|
||||
|
||||
|
@@ -55,8 +55,12 @@ module.exports = grammar({
|
||||
'env',
|
||||
),
|
||||
_nix_shell: $ => 'nix-shell',
|
||||
_ws: $ => / +/,
|
||||
_opt_ws: $ => / */,
|
||||
// N.B.: this accepts more than it needs to:
|
||||
// - shebang parser allows tab characters
|
||||
// - #!nix-shell directives do not support tabs
|
||||
// - wherever #!nix-shell directives allow whitespace, it's a *single* space -- never multiple
|
||||
_ws: $ => /[ \t]+/,
|
||||
_opt_ws: $ => /[ \t]*/,
|
||||
_newline: $ => '\n',
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user