diff --git a/grammar.js b/grammar.js index 10e8ea8c..e56bf9c5 100644 --- a/grammar.js +++ b/grammar.js @@ -119,7 +119,7 @@ module.exports = grammar({ identifier: _ => _identifier_rules(false), long_flag_identifier: _ => - token.immediate(/[0-9\p{XID_Start}_][\p{XID_Continue}?_-]*/u), + token.immediate(/[0-9\p{XID_Start}_][\p{XID_Continue}?._-]*/u), _command_name: $ => choice( diff --git a/script/known-failures.txt b/script/known-failures.txt index b4fd207a..585ccfe9 100644 --- a/script/known-failures.txt +++ b/script/known-failures.txt @@ -21,6 +21,7 @@ examples/nu_scripts/custom-completions/pytest/pytest-completions.nu examples/nu_scripts/custom-menus/current_session_history_menu.nu examples/nu_scripts/example-config/init.nu examples/nu_scripts/make_release/gen-ts-ext.nu +examples/nu_scripts/make_release/twin-tweaks.nu examples/nu_scripts/make_release/notes/tools.nu examples/nu_scripts/modules/duplicates/example.nu examples/nu_scripts/modules/kubernetes/complete.nu diff --git a/src/grammar.json b/src/grammar.json index 42d3dfb8..0b9bcbbc 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1787,7 +1787,7 @@ "type": "IMMEDIATE_TOKEN", "content": { "type": "PATTERN", - "value": "[0-9\\p{XID_Start}_][\\p{XID_Continue}?_-]*", + "value": "[0-9\\p{XID_Start}_][\\p{XID_Continue}?._-]*", "flags": "u" } }, diff --git a/src/parser.c b/src/parser.c index a8402ce2..df971450 100644 --- a/src/parser.c +++ b/src/parser.c @@ -10698,7 +10698,7 @@ static const TSCharacterRange sym_long_flag_identifier_character_set_1[] = { }; static const TSCharacterRange sym_long_flag_identifier_character_set_2[] = { - {'-', '-'}, {'0', '9'}, {'?', '?'}, {'A', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xaa, 0xaa}, {0xb5, 0xb5}, + {'-', '.'}, {'0', '9'}, {'?', '?'}, {'A', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xaa, 0xaa}, {0xb5, 0xb5}, {0xb7, 0xb7}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4}, {0x2ec, 0x2ec}, {0x2ee, 0x2ee}, {0x300, 0x374}, {0x376, 0x377}, {0x37b, 0x37d}, {0x37f, 0x37f}, {0x386, 0x38a}, {0x38c, 0x38c}, {0x38e, 0x3a1}, {0x3a3, 0x3f5}, {0x3f7, 0x481}, {0x483, 0x487}, {0x48a, 0x52f}, {0x531, 0x556}, {0x559, 0x559}, {0x560, 0x588}, {0x591, 0x5bd}, diff --git a/test/corpus/pipe/commands.nu b/test/corpus/pipe/commands.nu index 45622d9e..a91083cd 100644 --- a/test/corpus/pipe/commands.nu +++ b/test/corpus/pipe/commands.nu @@ -217,6 +217,8 @@ cmd-010-long-flag ====== cmd --long-flag --42 +# issue 249 +curl --tlsv1.2 ------ @@ -227,6 +229,13 @@ cmd --long-flag --42 (cmd_identifier) (long_flag (long_flag_identifier)) + (long_flag + (long_flag_identifier))))) + (comment) + (pipeline + (pipe_element + (command + (cmd_identifier) (long_flag (long_flag_identifier))))))