|
345 | 345 | ]
|
346 | 346 | },
|
347 | 347 | "use-module": {
|
348 |
| - "match": "((?:export )?use)\\s+([\\w\\-]+)(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|\\*))?;?", |
349 |
| - "captures": { |
350 |
| - "1": { "name": "entity.name.function.nushell" }, |
351 |
| - "2": { "name": "entity.name.namespace.nushell" }, |
352 |
| - "3": { "name": "keyword.other.nushell" } |
353 |
| - } |
| 348 | + "patterns": [ |
| 349 | + { |
| 350 | + "match": "^\\s*((?:export )?use)\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+')(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*))?\\s*;?$", |
| 351 | + "captures": { |
| 352 | + "1": { "name": "entity.name.function.nushell" }, |
| 353 | + "2": { "name": "entity.name.namespace.nushell" }, |
| 354 | + "3": { "name": "keyword.other.nushell" } |
| 355 | + } |
| 356 | + }, |
| 357 | + { |
| 358 | + "begin": "^\\s*((?:export )?use)\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+')\\s*\\[", |
| 359 | + "beginCaptures": { |
| 360 | + "1": { "name": "entity.name.function.nushell" }, |
| 361 | + "2": { "name": "entity.name.namespace.nushell" } |
| 362 | + }, |
| 363 | + "end": "(\\])\\s*;?\\s*$", |
| 364 | + "endCaptures": { |
| 365 | + "1": { "name": "meta.brace.square.end.nushell" } |
| 366 | + }, |
| 367 | + "patterns": [ |
| 368 | + { |
| 369 | + "match" : "([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*),?", |
| 370 | + "captures": { |
| 371 | + "1": { "name": "keyword.other.nushell" } |
| 372 | + } |
| 373 | + }, |
| 374 | + { |
| 375 | + "include": "#comment" |
| 376 | + } |
| 377 | + ] |
| 378 | + }, |
| 379 | + { |
| 380 | + "match": "(?<path>(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g<path>\"|'\\g<path>\\'|(?![\"'])\\g<path>)(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[^']+'|\\*))?\\s*;?$", |
| 381 | + "captures": { |
| 382 | + "2": { "name": "entity.name.function.nushell" }, |
| 383 | + "3": { |
| 384 | + "name": "string.bare.nushell", |
| 385 | + "patterns": [ |
| 386 | + { |
| 387 | + "match": "([\\w\\- ]+)(?:\\.nu)?(?=$|\"|')", |
| 388 | + "captures": { |
| 389 | + "1": {"name": "entity.name.namespace.nushell"} |
| 390 | + } |
| 391 | + } |
| 392 | + ] |
| 393 | + }, |
| 394 | + "4": { "name": "keyword.other.nushell" } |
| 395 | + } |
| 396 | + }, |
| 397 | + { |
| 398 | + "begin": "(?<path>(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g<path>\"|'\\g<path>\\'|(?![\"'])\\g<path>)\\s+\\[", |
| 399 | + "beginCaptures": { |
| 400 | + "2": { "name": "entity.name.function.nushell" }, |
| 401 | + "3": { |
| 402 | + "name": "string.bare.nushell", |
| 403 | + "patterns": [ |
| 404 | + { |
| 405 | + "match": "([\\w\\- ]+)(?:\\.nu)?(?=$|\"|')", |
| 406 | + "captures": { |
| 407 | + "1": {"name": "entity.name.namespace.nushell"} |
| 408 | + } |
| 409 | + } |
| 410 | + ] |
| 411 | + } |
| 412 | + }, |
| 413 | + "end": "(\\])\\s*;?\\s*$", |
| 414 | + "endCaptures": { |
| 415 | + "1": { "name": "meta.brace.square.end.nushell" } |
| 416 | + }, |
| 417 | + "patterns": [ |
| 418 | + { |
| 419 | + "match" : "([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*),?", |
| 420 | + "captures": { |
| 421 | + "0": { "name": "keyword.other.nushell" } |
| 422 | + } |
| 423 | + }, |
| 424 | + { |
| 425 | + "include": "#comment" |
| 426 | + } |
| 427 | + ] |
| 428 | + }, |
| 429 | + { |
| 430 | + "match": "^\\s*(?:export )?use", |
| 431 | + "captures": { |
| 432 | + "0": { "name": "entity.name.function.nushell" } |
| 433 | + } |
| 434 | + } |
| 435 | + ] |
354 | 436 | },
|
355 | 437 | "for-loop": {
|
356 | 438 | "begin": "(for)\\s+(\\$?\\w+)\\s+(in)\\s+(.+)\\s*(\\{)",
|
|
0 commit comments