|
192 | 192 | "name": "keyword.control.nushell" |
193 | 193 | }, |
194 | 194 | "operators-symbols": { |
195 | | - "match": "(?<= )(?:\\+|\\-|\\*|\\/|\\/\\/|\\*\\*|!=|[<>=]=?|[!=]~|&&|\\|\\||\\||\\+\\+=?)(?= |$)", |
| 195 | + "match": "(?<= )(?:(?:\\+|\\-|\\*|\\/)=?|\\/\\/|\\*\\*|!=|[<>=]=?|[!=]~|\\+\\+=?)(?= |$)", |
196 | 196 | "name": "keyword.control.nushell" |
197 | 197 | }, |
198 | 198 | "operators": { |
|
265 | 265 | }, |
266 | 266 | { |
267 | 267 | "begin": "\\??:\\s*", |
268 | | - "end": "(?=(?:\\s+(?:-{0,2}|\\.{3})[\\w-]+)|(?:\\s*(?:,|\\]|@|=|#|$)))", |
| 268 | + "end": "(?=(?:\\s+(?:-{0,2}|\\.{3})[\\w-]+)|(?:\\s*(?:,|\\]|\\||@|=|#|$)))", |
269 | 269 | "patterns": [ |
270 | 270 | { "include": "#types" } |
271 | 271 | ] |
|
278 | 278 | { |
279 | 279 | "name": "default.value.nushell", |
280 | 280 | "begin": "=\\s*", |
281 | | - "end": "(?=(?:\\s+-{0,2}[\\w-]+)|(?:\\s*(?:,|\\]|#|$)))", |
| 281 | + "end": "(?=(?:\\s+-{0,2}[\\w-]+)|(?:\\s*(?:,|\\]|\\||#|$)))", |
282 | 282 | "patterns": [{ "include": "#value" }] |
283 | 283 | } |
284 | 284 | ] |
|
504 | 504 | "patterns": [{ "include": "#expression" }] |
505 | 505 | }, |
506 | 506 | "braced-expression": { |
507 | | - "begin": "(\\{)(?:\\s*\\|([\\w, ]*)\\|)?", |
| 507 | + "begin": "\\{", |
508 | 508 | "beginCaptures": { |
509 | | - "1": { |
510 | | - "name": "punctuation.section.block.begin.bracket.curly.nushell" |
511 | | - }, |
512 | | - "2": { |
513 | | - "patterns": [ |
514 | | - { "include": "#function-parameter" }, |
515 | | - { |
516 | | - "match": ",", |
517 | | - "name": "punctuation.separator.nushell" |
518 | | - } |
519 | | - ] |
520 | | - } |
| 509 | + "0": { "name": "punctuation.section.block.begin.bracket.curly.nushell" } |
521 | 510 | }, |
522 | 511 | "end": "\\}", |
523 | 512 | "endCaptures": { |
|
526 | 515 | "name": "meta.expression.braced.nushell", |
527 | 516 | "patterns": [ |
528 | 517 | { |
529 | | - "begin": "((?:(?:[^$\\(\\{\\[\"'#\\s][^\\(\\{\\[\"'#\\s]*)|\\$?(?:\"[^\"]+\"|'[^']+')))\\s*(:)\\s*", |
530 | | - "beginCaptures": { |
531 | | - "1": { |
532 | | - "name": "variable.other.nushell", |
533 | | - "patterns": [{ "include": "#paren-expression" }] |
534 | | - }, |
535 | | - "2": { "patterns": [{ "include": "#operators" }] } |
| 518 | + "begin": "(?<=\\{)\\s*\\|", |
| 519 | + "end": "\\|", |
| 520 | + "name": "meta.closure.parameters.nushell", |
| 521 | + "patterns": [{ "include": "#function-parameter" }] |
| 522 | + }, |
| 523 | + { |
| 524 | + "match": "(\\w+)\\s*(:)\\s*", |
| 525 | + "captures": { |
| 526 | + "1": { "name": "variable.other.nushell" }, |
| 527 | + "2": { "name": "keyword.control.nushell" } |
| 528 | + } |
| 529 | + }, |
| 530 | + { |
| 531 | + "match": "(\\$\"((?:[^\"\\\\]|\\\\.)*)\")\\s*(:)\\s*", |
| 532 | + "captures": { |
| 533 | + "1": { "name": "variable.other.nushell" }, |
| 534 | + "2": { "name": "variable.other.nushell", "patterns": [{ "include": "#paren-expression" }] }, |
| 535 | + "3": { "name": "keyword.control.nushell" } |
536 | 536 | }, |
537 | | - "end": "(?=,|\\s|\\})", |
538 | | - "name": "meta.record-entry.nushell", |
539 | | - "patterns": [{ "include": "#value" }] |
| 537 | + "name": "meta.record-entry.nushell" |
| 538 | + }, |
| 539 | + { |
| 540 | + "match": "(\"(?:[^\"\\\\]|\\\\.)*\")\\s*(:)\\s*", |
| 541 | + "captures": { |
| 542 | + "1": { "name": "variable.other.nushell" }, |
| 543 | + "2": { "name": "keyword.control.nushell" } |
| 544 | + }, |
| 545 | + "name": "meta.record-entry.nushell" |
| 546 | + }, |
| 547 | + { |
| 548 | + "match": "(\\$'([^']*)')\\s*(:)\\s*", |
| 549 | + "captures": { |
| 550 | + "1": { "name": "variable.other.nushell" }, |
| 551 | + "2": { "name": "variable.other.nushell", "patterns": [{ "include": "#paren-expression" }] }, |
| 552 | + "3": { "name": "keyword.control.nushell" } |
| 553 | + }, |
| 554 | + "name": "meta.record-entry.nushell" |
| 555 | + }, |
| 556 | + { |
| 557 | + "match": "('[^']*')\\s*(:)\\s*", |
| 558 | + "captures": { |
| 559 | + "1": { "name": "variable.other.nushell" }, |
| 560 | + "2": { "name": "keyword.control.nushell" } |
| 561 | + }, |
| 562 | + "name": "meta.record-entry.nushell" |
540 | 563 | }, |
541 | 564 | { "include": "source.nushell" } |
542 | 565 | ] |
543 | 566 | }, |
544 | 567 | "define-variable": { |
545 | | - "match": "(let(?:-env)?|mut|const)\\s+(\\w+)\\s*(=)", |
| 568 | + "match": "(let|mut|(?:export\\s+)?const)\\s+(\\w+)\\s+(=)", |
546 | 569 | "captures": { |
547 | 570 | "1": { "name": "keyword.other.nushell" }, |
548 | 571 | "2": { "name": "variable.other.nushell" }, |
|
627 | 650 | { "include": "#pre-command" }, |
628 | 651 | { "include": "#for-loop" }, |
629 | 652 | { "include": "#operators" }, |
| 653 | + { |
| 654 | + "match": "\\|", |
| 655 | + "name": "keyword.control.nushell" |
| 656 | + }, |
630 | 657 | { "include": "#control-keywords" }, |
631 | 658 | { "include": "#constant-value" }, |
632 | 659 | { "include": "#command" }, |
|
0 commit comments