|
126 | 126 | "1": {
|
127 | 127 | "patterns": [
|
128 | 128 | { "include": "#internal-variables" },
|
129 |
| - { |
| 129 | + { |
130 | 130 | "match": "\\$.+",
|
131 |
| - "name": "variable.other.nushell" |
| 131 | + "name": "variable.other.nushell" |
132 | 132 | }
|
133 | 133 | ]
|
134 | 134 | }
|
|
296 | 296 | "function": {
|
297 | 297 | "begin": "((?:export\\s+)?def(?:-env)?)\\s+([\\w\\-]+|\"[\\w\\- ]+\")",
|
298 | 298 | "beginCaptures": {
|
299 |
| - "0": { |
| 299 | + "0": { |
300 | 300 | "patterns": [
|
301 | 301 | { "include": "#define-function" },
|
302 | 302 | { "include": "#define-extern" }
|
303 |
| - ] |
| 303 | + ] |
304 | 304 | }
|
305 | 305 | },
|
306 | 306 | "end": "(?<=\\})",
|
|
315 | 315 | "extern": {
|
316 | 316 | "begin": "((?:export\\s+)?extern)\\s+([\\w\\-]+|\"[\\w\\- ]+\")",
|
317 | 317 | "beginCaptures": {
|
318 |
| - "0": { |
| 318 | + "0": { |
319 | 319 | "patterns": [
|
320 | 320 | { "include": "#define-extern" }
|
321 |
| - ] |
| 321 | + ] |
322 | 322 | }
|
323 | 323 | },
|
324 | 324 | "end": "(?<=\\])",
|
|
380 | 380 | "match": "(?<path>(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g<path>\"|'\\g<path>\\'|(?![\"'])\\g<path>)(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[^']+'|\\*))?\\s*;?$",
|
381 | 381 | "captures": {
|
382 | 382 | "2": { "name": "entity.name.function.nushell" },
|
383 |
| - "3": { |
| 383 | + "3": { |
384 | 384 | "name": "string.bare.nushell",
|
385 | 385 | "patterns": [
|
386 | 386 | {
|
|
398 | 398 | "begin": "(?<path>(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g<path>\"|'\\g<path>\\'|(?![\"'])\\g<path>)\\s+\\[",
|
399 | 399 | "beginCaptures": {
|
400 | 400 | "2": { "name": "entity.name.function.nushell" },
|
401 |
| - "3": { |
| 401 | + "3": { |
402 | 402 | "name": "string.bare.nushell",
|
403 | 403 | "patterns": [
|
404 | 404 | {
|
|
470 | 470 | "begin": "(\\{)(?:\\s*\\|([\\w, ]*)\\|)?",
|
471 | 471 | "beginCaptures": {
|
472 | 472 | "1": { "name": "punctuation.section.block.begin.bracket.curly.nushell" },
|
473 |
| - "2": { |
| 473 | + "2": { |
474 | 474 | "patterns": [
|
475 | 475 | { "include": "#function-parameter" },
|
476 | 476 | {
|
|
486 | 486 | },
|
487 | 487 | "name": "meta.expression.braced.nushell",
|
488 | 488 | "patterns": [
|
489 |
| - { |
| 489 | + { |
490 | 490 | "begin": "((?:(?:[^$\\(\\{\\[\"'#\\s][^\\(\\{\\[\"'#\\s]*)|\\$?(?:\"[^\"]+\"|'[^']+')))\\s*(:)\\s*",
|
491 | 491 | "beginCaptures": {
|
492 |
| - "1": { |
| 492 | + "1": { |
493 | 493 | "name": "variable.other.nushell",
|
494 | 494 | "patterns": [
|
495 | 495 | { "include": "#paren-expression" }
|
|
511 | 511 | "captures": {
|
512 | 512 | "1": { "name": "keyword.other.nushell" },
|
513 | 513 | "2": { "name": "variable.other.nushell" },
|
514 |
| - "3": { |
| 514 | + "3": { |
515 | 515 | "patterns": [
|
516 | 516 | { "include": "#operators" }
|
517 |
| - ] |
| 517 | + ] |
518 | 518 | }
|
519 | 519 | }
|
520 | 520 | },
|
|
523 | 523 | "captures": {
|
524 | 524 | "1": { "name": "entity.name.function.nushell" },
|
525 | 525 | "2": { "name": "entity.name.type.nushell" },
|
526 |
| - "3": { |
| 526 | + "3": { |
527 | 527 | "patterns": [
|
528 | 528 | { "include": "#operators" }
|
529 |
| - ] |
| 529 | + ] |
530 | 530 | }
|
531 | 531 | }
|
532 | 532 | },
|
533 | 533 | "pre-command": {
|
534 | 534 | "begin": "(\\w+)(=)",
|
535 | 535 | "beginCaptures": {
|
536 | 536 | "1": { "name": "variable.other.nushell" },
|
537 |
| - "2": { |
| 537 | + "2": { |
538 | 538 | "patterns": [
|
539 | 539 | { "include": "#operators" }
|
540 |
| - ] |
| 540 | + ] |
541 | 541 | }
|
542 | 542 | },
|
543 | 543 | "end": "(?=\\s+)",
|
|
550 | 550 | "begin": "(?<!\\w)(?:(\\^)|(?![0-9]|(?<=\\)|\\}|\\]|\\$\\w+)\\.))([\\w.!]+(?:(?: (?!-)[\\w\\-.!]+(?:(?= |\\))|$)|[\\w\\-.!]+))*|(?<=\\^)\\$?(?:\"[^\"]+\"|'[^']+'))",
|
551 | 551 | "beginCaptures": {
|
552 | 552 | "1": { "name": "keyword.operator.nushell" },
|
553 |
| - "2": { |
| 553 | + "2": { |
554 | 554 | "patterns": [
|
555 | 555 | { "include": "#control-keywords" },
|
556 | 556 | {
|
|
559 | 559 | "0": { "name": "keyword.other.builtin.nushell" }
|
560 | 560 | }
|
561 | 561 | },
|
562 |
| - { |
| 562 | + { |
563 | 563 | "comment": "Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)",
|
564 |
| - "match": "(a(?:l(?:ias|l)|n(?:si(?: (?:gradient|strip))?|y)|ppend|st)|b(?:enchmark|its(?: (?:and|not|or|ro(?:l|r)|sh(?:l|r)|xor))?|ytes(?: (?:a(?:dd|t)|build|collect|ends-with|index-of|length|re(?:move|place|verse)|starts-with))?)|c(?:al|d|har|lear|o(?:l(?:lect|umns)|m(?:mandline|p(?:act|lete))|nfig(?: (?:env|nu|reset))?)|p|ustom-value (?:generate(?:2)?|update))|d(?:ate(?: (?:format|humanize|list-timezone|now|to-(?:record|t(?:able|imezone))))?|e(?:bug|code(?: base64)?|f(?:-env|ault)?|scribe|tect columns)|o|rop(?: (?:column|nth))?|u)|e(?:ach(?: while)?|cho|n(?:code(?: base64)?|ter|v)|rror make|very|x(?:it|port(?: (?:alias|def(?:-env)?|extern|use)|-env)?|tern ))|f(?:etch|i(?:nd|rst)|latten|mt|ormat(?: filesize)?|rom(?: (?:csv|eml|i(?:cs|ni)|json|nuon|ods|ssv|t(?:oml|sv)|url|vcf|x(?:lsx|ml)|y(?:aml|ml)))?)|g(?:et|lob|r(?:id|oup(?:-by)?)|stat)?|h(?:ash(?: (?:base64|md5|sha256))?|e(?:aders|lp(?: operators)?)|i(?:de(?:-env)?|sto(?:gram|ry(?: session)?)))|i(?:gnore|n(?:c|put|sert|to(?: (?:b(?:inary|ool)|d(?:atetime|ecimal|uration)|filesize|int|record|s(?:qlite|tring)))?)|s-(?:admin|empty))|k(?:eybindings(?: (?:default|list(?:en)?))?|ill)|l(?:ast|e(?:ngth|t(?:-env)?)|ines|oad-env|s)|m(?:ath(?: (?:a(?:bs|vg)|ceil|eval|floor|m(?:ax|edian|in|ode)|product|round|s(?:qrt|tddev|um)|variance))?|e(?:rge|tadata)|kdir|o(?:dule|ve)|ut|v)|n(?:u-(?:check|example-(?:1|2|3)|highlight))?|o(?:pen|verlay(?: (?:hide|list|new|use))?)|p(?:a(?:r(?:-each|se)|th(?: (?:basename|dirname|ex(?:ists|pand)|join|parse|relative-to|split|type))?)|o(?:rt|st)|r(?:epend|int)|s)?|query(?: (?:db|json|web|xml))?|r(?:an(?:dom(?: (?:bool|chars|d(?:ecimal|ice)|integer|uuid))?|ge)|e(?:duce|gist(?:er|ry query)|ject|name|verse)|m|o(?:ll(?: (?:down|left|right|up))?|tate)|un-external)|s(?:ave|chema|e(?:lect|q(?: (?:char|date))?)|h(?:ells|uffle)|ize|kip(?: (?:until|while))?|leep|o(?:rt(?:-by)?|urce(?:-env)?)|plit(?: (?:c(?:hars|olumn)|list|row|words)|-by)?|tr(?: (?:c(?:a(?:mel-case|pitalize)|o(?:llect|ntains))|d(?:istance|owncase)|ends-with|find-replace|index-of|join|kebab-case|l(?:ength|pad)|pascal-case|r(?:e(?:place|verse)|pad)|s(?:creaming-snake-case|nake-case|tarts-with|ubstring)|t(?:itle-case|o-(?:d(?:atetime|ecimal)|int)|rim)|upcase))?|ys)|t(?:a(?:ble|ke(?: (?:until|while))?)|erm size|o(?: (?:csv|html|json|md|nuon|t(?:ext|oml|sv)|url|xml|yaml)|uch)?|ranspose|utor)|u(?:niq|p(?:date(?: cells)?|sert)|rl(?: parse)?|se)|v(?:ersion|iew-source)|w(?:atch|h(?:ere|ich)|i(?:ndow|th-env)|rap)|zip)(?![\\w-])( (.*))?", |
| 564 | + "match": "(a(?:l(?:ias|l)|n(?:si(?: (?:gradient|link|strip))?|y)|ppend|st)|b(?:its(?: (?:and|not|or|ro(?:l|r)|sh(?:l|r)|xor))?|reak|ytes(?: (?:a(?:dd|t)|build|collect|ends-with|index-of|length|re(?:move|place|verse)|starts-with))?)|c(?:al|d|har|lear|o(?:l(?:lect|umns)|m(?:mandline|p(?:act|lete))|n(?:fig(?: (?:env|nu|reset))?|st|tinue))|p|ustom-value (?:generate(?:2)?|update))|d(?:ate(?: (?:format|humanize|list-timezone|now|to-(?:record|t(?:able|imezone))))?|e(?:bug|code(?: base64)?|f(?:-env|ault)?|scribe|tect columns)|fr (?:a(?:gg(?:-groups)?|ll-(?:false|true)|ppend|rg-(?:m(?:ax|in)|sort|true|unique|where)|s(?:-date(?:time)?)?)|c(?:ache|o(?:l(?:lect|umns)?|n(?:cat(?:-str|enate)|tains)|unt(?:-null)?)|umulative)|d(?:rop(?:-(?:duplicates|nulls))?|types|ummies)|exp(?:lode|r-not)|f(?:etch|i(?:l(?:l-n(?:an|ull)|ter(?:-with)?)|rst)|latten)|g(?:et(?:-(?:day|hour|m(?:inute|onth)|nanosecond|ordinal|second|week(?:day)?|year))?|roup-by)|i(?:nto-(?:df|lazy|nu)|s-(?:duplicated|in|n(?:ot-null|ull)|unique))|join|l(?:ast|i(?:st|t)|owercase|s)|m(?:ax|e(?:an|dian|lt)|in)|n(?:-unique|ot)|o(?:pen|therwise)|qu(?:antile|ery)|r(?:e(?:name|place(?:-all)?|verse)|olling)|s(?:ample|e(?:lect|t(?:-with-idx)?)|h(?:ape|ift)|lice|ort-by|t(?:d|r(?:-(?:lengths|slice)|ftime))|um(?:mary)?)|t(?:ake|o-(?:arrow|csv|parquet))|u(?:nique|ppercase)|va(?:lue-counts|r)|w(?:hen|ith-column))|o|rop(?: (?:column|nth))?|u)|e(?:ach(?: while)?|cho|n(?:code(?: base64)?|ter|umerate)|rror make|very|x(?:ec|it|p(?:l(?:ain|ore)|ort(?: (?:alias|def(?:-env)?|extern|old-alias|use)|-env)?)|tern))|f(?:i(?:l(?:l|ter)|nd|rst)|latten|mt|or(?:mat(?: filesize)?)?|rom(?: (?:csv|eml|i(?:cs|ni)|json|nuon|ods|p(?:arquet|list)|ssv|t(?:oml|sv)|url|vcf|x(?:lsx|ml)|y(?:aml|ml)))?)|g(?:et|lob|r(?:id|oup(?:-by)?)|stat)?|h(?:ash(?: (?:base64|md5|sha256))?|e(?:aders|lp(?: (?:aliases|commands|modules|operators))?)|i(?:de(?:-env)?|st(?:o(?:gram|ry(?: session)?))?)|ttp(?: (?:delete|get|head|p(?:atch|ost|ut)))?)|i(?:f|gnore|n(?:c|put|s(?:ert|pect)|to(?: (?:b(?:inary|ool)|d(?:atetime|ecimal|uration)|filesize|int|record|s(?:qlite|tring)))?)|s-(?:admin|empty))|json path|k(?:eybindings(?: (?:default|list(?:en)?))?|ill)|l(?:ast|e(?:ngth|t(?:-env)?)|ines|o(?:ad-env|op)|s)|m(?:ath(?: (?:a(?:bs|rc(?:cos(?:h)?|sin(?:h)?|tan(?:h)?)|vg)|c(?:eil|os(?:h)?)|e(?:val)?|floor|l(?:n|og)|m(?:ax|edian|in|ode)|p(?:i|roduct)|round|s(?:in(?:h)?|qrt|tddev|um)|ta(?:n(?:h)?|u)|variance))?|e(?:rge|tadata)|kdir|o(?:dule|ve)|ut|v)|n(?:u-(?:check|example-(?:1|2|3)|highlight))?|o(?:ld-alias|pen|verlay(?: (?:hide|list|new|use))?)|p(?:a(?:r(?:-each|se)|th(?: (?:basename|dirname|ex(?:ists|pand)|join|parse|relative-to|split|type))?)|eriodic-table|lot|net|ort|r(?:epend|int|ofile)|s)?|query(?: (?:db|json|web|xml))?|r(?:an(?:dom(?: (?:bool|chars|d(?:ecimal|ice)|integer|uuid))?|ge)|e(?:duce|g(?:ex|ist(?:er|ry query))|ject|name|turn|verse)|m|o(?:ll(?: (?:down|left|right|up))?|tate)|un-external)|s(?:ave|chema|e(?:lect|q(?: (?:char|date))?)|h(?:ells|uffle)|ize|kip(?: (?:until|while))?|leep|o(?:rt(?:-by)?|urce(?:-env)?)|plit(?: (?:c(?:hars|olumn)|list|row|words)|-by)?|t(?:art|r(?: (?:c(?:a(?:mel-case|pitalize)|o(?:llect|ntains))|d(?:istance|owncase)|ends-with|find-replace|index-of|join|kebab-case|l(?:ength|pad)|pascal-case|r(?:e(?:place|verse)|pad)|s(?:creaming-snake-case|nake-case|tarts-with|ubstring)|t(?:itle-case|o-(?:d(?:atetime|ecimal)|int)|rim)|upcase))?)|ys)|t(?:a(?:ble|ke(?: (?:until|while))?)|erm size|imeit|o(?: (?:csv|html|json|md|nuon|t(?:ext|oml|sv)|xml|yaml)|uch)?|r(?:anspose|y)|utor)|u(?:niq(?:-by)?|p(?:date(?: cells)?|sert)|rl(?: (?:build-query|encode|join|parse))?|se)|v(?:alues|ersion|iew(?: (?:files|s(?:ource|pan)))?)|w(?:atch|h(?:ere|i(?:ch|le))|i(?:ndow|th-env)|rap)|xyplot|zip)(?![\\w-])( (.*))?", |
565 | 565 | "captures": {
|
566 | 566 | "1": { "name": "keyword.other.builtin.nushell" },
|
567 |
| - "2": { |
| 567 | + "2": { |
568 | 568 | "patterns": [
|
569 | 569 | { "include": "#value" }
|
570 | 570 | ]
|
571 | 571 | }
|
572 | 572 | }
|
573 | 573 | },
|
574 |
| - { |
| 574 | + { |
575 | 575 | "match": "(?<=\\^)(?:\\$(\"[^\"]+\"|'[^']+')|\"[^\"]+\"|'[^']+')",
|
576 | 576 | "name": "entity.name.type.external.nushell",
|
577 | 577 | "captures": {
|
578 |
| - "1": { |
| 578 | + "1": { |
579 | 579 | "patterns": [
|
580 | 580 | { "include": "#paren-expression" }
|
581 |
| - ] |
| 581 | + ] |
582 | 582 | }
|
583 | 583 | }
|
584 | 584 | },
|
585 | 585 | {
|
586 | 586 | "match": "([\\w.]+(?:-[\\w.!]+)*)(?: (.*))?",
|
587 | 587 | "captures": {
|
588 | 588 | "1": { "name": "entity.name.type.external.nushell" },
|
589 |
| - "2": { |
| 589 | + "2": { |
590 | 590 | "patterns": [
|
591 | 591 | { "include": "#value" }
|
592 | 592 | ]
|
|
595 | 595 | },
|
596 | 596 | { "include": "#value" }
|
597 | 597 | ]
|
598 |
| - |
| 598 | + |
599 | 599 | }
|
600 | 600 | },
|
601 | 601 | "end": "(?=\\||\\)|\\}|;)|$",
|
|
0 commit comments