File tree Expand file tree Collapse file tree 4 files changed +23
-50
lines changed Expand file tree Collapse file tree 4 files changed +23
-50
lines changed Original file line number Diff line number Diff line change 4
4
extensions = ["nu" ],
5
5
grammar.source.git = {
6
6
git = "https://github. com/blindfs/tree-sitter-nu. git" ,
7
- rev = "46ca5853edec9f3bc19a36d68d1311c1f36cd540 " ,
7
+ rev = "b3ececada7a378336732d17351e824919512d3f5 " ,
8
8
},
9
-
10
9
},
11
10
},
12
11
}
Original file line number Diff line number Diff line change 13
13
(val_number)
14
14
(val_string)
15
15
(val_variable)
16
+ (cmd_identifier)
17
+ (identifier)
18
+ (path)
16
19
] @leaf
17
20
18
21
;; keep empty lines
31
34
32
35
[
33
36
"="
34
- (match_guard)
35
- (short_flag)
36
- (long_flag)
37
- ] @prepend_space
38
-
39
- ;; FIXME: temp workaround for the whitespace issue
40
- (short_flag "=" @prepend_antispace )
41
- (long_flag "=" @prepend_antispace )
42
- (param_value "=" @append_space )
43
-
44
- (assignment
45
- opr: _
46
- rhs: (pipeline
47
- (pipe_element
48
- (val_string
49
- (raw_string_begin)
50
- )
51
- )
52
- ) @prepend_space
53
- )
54
-
55
- (
56
- "="
57
- .
58
- (pipeline
59
- (pipe_element
60
- (val_string
61
- (raw_string_begin)
62
- )
63
- )
64
- ) @prepend_space
65
- )
66
-
67
- [
68
37
"->"
69
38
"=>"
70
39
"alias"
93
62
"source-env"
94
63
"use"
95
64
"where"
65
+ (match_guard)
96
66
] @prepend_space @append_space
97
67
98
68
(pipeline
104
74
opr: _ @append_input_softline @prepend_input_softline
105
75
)
106
76
107
- (assignment opr: _ @prepend_space )
77
+ (assignment opr: _ @prepend_space @append_space )
108
78
109
79
(where_predicate
110
80
opr: _ @append_input_softline @prepend_input_softline
119
89
.
120
90
(_)
121
91
)
92
+ (short_flag "=" @prepend_antispace @append_antispace )
93
+ (long_flag "=" @prepend_antispace @append_antispace )
94
+ (env_var "=" @prepend_antispace @append_antispace )
122
95
123
96
(overlay_hide
124
- overlay: _ @prepend_space
125
- )
126
-
127
- ;; FIXME: temp workaround for the whitespace issue
128
- (hide_env
129
- [
130
- (short_flag)
131
- (long_flag)
132
- ] @append_antispace
133
- .
134
- (_)
97
+ overlay: _ @prepend_space @append_space
135
98
)
136
99
137
100
(hide_env
354
317
key: _ @prepend_space
355
318
(#delimiter! ",")
356
319
)
320
+
321
+ (composite_type
322
+ type: _ @append_delimiter
323
+ .
324
+ type: _ @prepend_space
325
+ (#delimiter! ",")
326
+ )
Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ use module [ "foo" bar ]
49
49
50
50
# decl_module
51
51
module greetings {
52
- export def hello [name : string ] {
52
+ export def hello [
53
+ name : string
54
+ -- experimental-options : oneof <list <string >, string > # enable or disable experimental options
55
+ ] {
53
56
$" hello ($name )!"
54
57
}
55
58
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ use module ["foo" bar]
44
44
45
45
# decl_module
46
46
module greetings {
47
- export def hello [name : string ] {
47
+ export def hello [name : string -- experimental-options : oneof <list <string >, string > # enable or disable experimental options
48
+ ] {
48
49
$" hello ($name )!"
49
50
}
50
51
You can’t perform that action at this time.
0 commit comments