Skip to content

Commit bed1c35

Browse files
committed
fix: allow colon in short flags
1 parent 7e7de17 commit bed1c35

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ module.exports = grammar({
12461246
optional($._flag_equals_value),
12471247
),
12481248

1249-
short_flag_identifier: (_$) => token.immediate(/[\p{XID_Continue}?@!%_-]+/),
1249+
short_flag_identifier: (_$) => token.immediate(/[\p{XID_Continue}:?@!%_-]+/),
12501250

12511251
long_flag: ($) =>
12521252
seq(

src/grammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16011,7 +16011,7 @@
1601116011
"type": "IMMEDIATE_TOKEN",
1601216012
"content": {
1601316013
"type": "PATTERN",
16014-
"value": "[\\p{XID_Continue}?@!%_-]+"
16014+
"value": "[\\p{XID_Continue}:?@!%_-]+"
1601516015
}
1601616016
},
1601716017
"long_flag": {

src/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11103,7 +11103,7 @@ static const TSCharacterRange aux_sym__record_key_token1_character_set_1[] = {
1110311103
};
1110411104

1110511105
static const TSCharacterRange sym_short_flag_identifier_character_set_1[] = {
11106-
{'!', '!'}, {'%', '%'}, {'-', '-'}, {'0', '9'}, {'?', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xaa, 0xaa},
11106+
{'!', '!'}, {'%', '%'}, {'-', '-'}, {'0', ':'}, {'?', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xaa, 0xaa},
1110711107
{0xb5, 0xb5}, {0xb7, 0xb7}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4},
1110811108
{0x2ec, 0x2ec}, {0x2ee, 0x2ee}, {0x300, 0x374}, {0x376, 0x377}, {0x37b, 0x37d}, {0x37f, 0x37f}, {0x386, 0x38a}, {0x38c, 0x38c},
1110911109
{0x38e, 0x3a1}, {0x3a3, 0x3f5}, {0x3f7, 0x481}, {0x483, 0x487}, {0x48a, 0x52f}, {0x531, 0x556}, {0x559, 0x559}, {0x560, 0x588},

0 commit comments

Comments
 (0)