accept tabs as whitespace
This commit is contained in:
@@ -15,6 +15,26 @@ nix-shell shebang whitespace
|
|||||||
#! /usr/bin/env nix-shell
|
#! /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
|
(source_file
|
||||||
(first_line))
|
(first_line))
|
||||||
|
|
||||||
|
@@ -55,8 +55,12 @@ module.exports = grammar({
|
|||||||
'env',
|
'env',
|
||||||
),
|
),
|
||||||
_nix_shell: $ => 'nix-shell',
|
_nix_shell: $ => 'nix-shell',
|
||||||
_ws: $ => / +/,
|
// N.B.: this accepts more than it needs to:
|
||||||
_opt_ws: $ => / */,
|
// - 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',
|
_newline: $ => '\n',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user