Skip to content

Commit d694570

Browse files
authored
fix: dot in flag identifier (#250)
Fixes #249
1 parent 348b787 commit d694570

5 files changed

Lines changed: 13 additions & 3 deletions

File tree

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module.exports = grammar({
119119
identifier: _ => _identifier_rules(false),
120120

121121
long_flag_identifier: _ =>
122-
token.immediate(/[0-9\p{XID_Start}_][\p{XID_Continue}?_-]*/u),
122+
token.immediate(/[0-9\p{XID_Start}_][\p{XID_Continue}?._-]*/u),
123123

124124
_command_name: $ =>
125125
choice(

script/known-failures.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ examples/nu_scripts/custom-completions/pytest/pytest-completions.nu
2121
examples/nu_scripts/custom-menus/current_session_history_menu.nu
2222
examples/nu_scripts/example-config/init.nu
2323
examples/nu_scripts/make_release/gen-ts-ext.nu
24+
examples/nu_scripts/make_release/twin-tweaks.nu
2425
examples/nu_scripts/make_release/notes/tools.nu
2526
examples/nu_scripts/modules/duplicates/example.nu
2627
examples/nu_scripts/modules/kubernetes/complete.nu

src/grammar.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/pipe/commands.nu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ cmd-010-long-flag
217217
======
218218

219219
cmd --long-flag --42
220+
# issue 249
221+
curl --tlsv1.2
220222

221223
------
222224

@@ -227,6 +229,13 @@ cmd --long-flag --42
227229
(cmd_identifier)
228230
(long_flag
229231
(long_flag_identifier))
232+
(long_flag
233+
(long_flag_identifier)))))
234+
(comment)
235+
(pipeline
236+
(pipe_element
237+
(command
238+
(cmd_identifier)
230239
(long_flag
231240
(long_flag_identifier))))))
232241

0 commit comments

Comments
 (0)