|
224 | 224 | "types": { |
225 | 225 | "patterns": [ |
226 | 226 | { |
| 227 | + "name": "meta.list.nushell", |
227 | 228 | "begin": "\\b(list)\\s*<", |
228 | 229 | "beginCaptures": { |
229 | 230 | "1": { "name": "entity.name.type.nushell" } |
|
234 | 235 | ] |
235 | 236 | }, |
236 | 237 | { |
| 238 | + "name": "meta.record.nushell", |
237 | 239 | "begin": "\\b(record)\\s*<", |
238 | 240 | "beginCaptures": { |
239 | 241 | "1": { "name": "entity.name.type.nushell" } |
|
255 | 257 | } |
256 | 258 | ] |
257 | 259 | }, |
258 | | - "function-parameter-default-value": { |
259 | | - "begin": "=\\s*", |
260 | | - "end": "(?=\\])|,|$", |
261 | | - "patterns": [{ "include": "#value" }] |
262 | | - }, |
263 | | - "function-parameter-declare": { |
| 260 | + "function-parameter": { |
264 | 261 | "patterns": [ |
265 | 262 | { |
266 | | - "match": "(-{0,2}[\\w-]+|\\.{3})(?:\\((-[\\w?])\\))?", |
| 263 | + "match": "((?:-{0,2}|\\.{3})[\\w-]+)(?:\\((-[\\w?])\\))?", |
267 | 264 | "name": "variable.parameter.nushell" |
268 | 265 | }, |
269 | 266 | { |
270 | 267 | "begin": "\\??:\\s*", |
271 | | - "end": "\\s*(?=,|@|#|$)", |
| 268 | + "end": "(?=(?:\\s+(?:-{0,2}|\\.{3})[\\w-]+)|(?:\\s*(?:,|\\]|@|=|#|$)))", |
272 | 269 | "patterns": [ |
273 | 270 | { "include": "#types" } |
274 | 271 | ] |
|
277 | 274 | "begin": "@(?=\"|')", |
278 | 275 | "end": "(?<=\"|')", |
279 | 276 | "patterns": [ {"include": "#string"} ] |
| 277 | + }, |
| 278 | + { |
| 279 | + "name": "default.value.nushell", |
| 280 | + "begin": "=\\s*", |
| 281 | + "end": "(?=(?:\\s+-{0,2}[\\w-]+)|(?:\\s*(?:,|\\]|#|$)))", |
| 282 | + "patterns": [{ "include": "#value" }] |
280 | 283 | } |
281 | 284 | ] |
282 | 285 | }, |
283 | | - "function-parameter": { |
284 | | - "patterns": [ |
285 | | - { "include": "#function-parameter-declare" }, |
286 | | - { "include": "#function-parameter-default-value" } |
287 | | - ] |
288 | | - }, |
289 | 286 | "function-parameters": { |
290 | 287 | "begin": "\\[", |
291 | 288 | "beginCaptures": { |
|
301 | 298 | ], |
302 | 299 | "name": "meta.function.parameters.nushell" |
303 | 300 | }, |
304 | | - "inout": { |
| 301 | + "function-multiple-inout": { |
| 302 | + "begin": "(?<=]\\s*)(:)\\s+(\\[)", |
| 303 | + "beginCaptures": { |
| 304 | + "1": { "name": "punctuation.definition.in-out.nushell" }, |
| 305 | + "2": { "name": "meta.brace.square.begin.nushell" } |
| 306 | + }, |
| 307 | + "end": "\\]", |
| 308 | + "endCaptures": { |
| 309 | + "0": { "name": "meta.brace.square.end.nushell" } |
| 310 | + }, |
| 311 | + "patterns": [ |
| 312 | + { "include": "#types" }, |
| 313 | + { |
| 314 | + "match": "\\s*(,)\\s*", |
| 315 | + "captures": { |
| 316 | + "1": { "name": "punctuation.separator.nushell" } |
| 317 | + } |
| 318 | + }, |
| 319 | + { |
| 320 | + "match": "\\s+(->)\\s+", |
| 321 | + "captures": { |
| 322 | + "1": { "name": "keyword.operator.nushell" } |
| 323 | + } |
| 324 | + } |
| 325 | + ] |
| 326 | + }, |
| 327 | + "function-inout": { |
305 | 328 | "patterns": [ |
306 | 329 | { "include": "#types" }, |
307 | 330 | { |
308 | 331 | "match": "->", |
309 | 332 | "name": "keyword.operator.nushell" |
310 | | - } |
311 | | - ] |
312 | | - }, |
313 | | - "function-inout": { |
314 | | - "begin": "(?<=]\\s*)(:)\\s+(\\[)", |
315 | | - "beginCaptures": { |
316 | | - "1": { "name": "punctuation.definition.in-out.nushell" }, |
317 | | - "2": { "name": "meta.brace.square.end.nushell" } |
318 | | - }, |
319 | | - "end": "\\]", |
320 | | - "endCaptures": { |
321 | | - "0": { "name": "meta.brace.square.end.nushell" } |
322 | | - }, |
323 | | - "patterns": [ |
324 | | - { "include": "#inout" }, |
325 | | - { |
326 | | - "match": ",", |
327 | | - "name": "punctuation.separator.nushell" |
328 | | - } |
| 333 | + }, |
| 334 | + { "include": "#function-multiple-inout" } |
329 | 335 | ] |
330 | 336 | }, |
331 | 337 | "function-body": { |
|
348 | 354 | "3": { "name": "entity.name.function.nushell" } |
349 | 355 | }, |
350 | 356 | "end": "(?<=\\})", |
351 | | - "endCaptures": { |
352 | | - "0": { "name": "punctuation.definition.function.end.nushell" } |
353 | | - }, |
354 | 357 | "patterns": [ |
355 | 358 | { "include": "#function-parameters" }, |
356 | 359 | { "include": "#function-body" }, |
357 | | - { "include": "#function-inout" }, |
358 | | - { "include": "#inout" } |
| 360 | + { "include": "#function-inout" } |
359 | 361 | ] |
360 | 362 | }, |
361 | 363 | "extern": { |
|
0 commit comments