Allow square brackets after first character in shell fragment

This commit is contained in:
Camden Cheek 2021-05-10 21:23:10 -06:00
parent ca57ec244a
commit 00c68f09db
No known key found for this signature in database
GPG key ID: 595BFFE3A04E48B9
4 changed files with 3 additions and 3 deletions

View file

@ -8,3 +8,4 @@ Maintainer camden@ccheek.com
(source_file
(maintainer_instruction))

View file

@ -310,7 +310,7 @@ module.exports = grammar({
),
shell_fragment: $ => repeat1(choice(
/[^\\\[\n#\s][^\\\[\n]*/,
/[^\\\[\n#\s][^\\\n]*/,
/\\[^\n]/,
)),

View file

@ -1314,7 +1314,7 @@
"members": [
{
"type": "PATTERN",
"value": "[^\\\\\\[\\n#\\s][^\\\\\\[\\n]*"
"value": "[^\\\\\\[\\n#\\s][^\\\\\\n]*"
},
{
"type": "PATTERN",

View file

@ -2457,7 +2457,6 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
ACCEPT_TOKEN(aux_sym_shell_fragment_token1);
if (lookahead != 0 &&
lookahead != '\n' &&
lookahead != '[' &&
lookahead != '\\') ADVANCE(225);
END_STATE();
case 226: