|
6 | 6 | ], |
7 | 7 | "name": "Luau", |
8 | 8 | "scopeName": "source.luau", |
9 | | - "fileTypes": [ |
10 | | - "luau" |
11 | | - ], |
| 9 | + "fileTypes": ["luau"], |
12 | 10 | "patterns": [ |
13 | 11 | { |
14 | 12 | "include": "#function-definition" |
|
506 | 504 | "patterns": [ |
507 | 505 | { |
508 | 506 | "name": "keyword.operator.other.luau", |
509 | | - "begin": "(```luau?)\\s+", |
510 | | - "end": "(```)", |
| 507 | + "begin": "(```luau?)\\s*$", |
| 508 | + "while": "^(?!\\s*```)", |
511 | 509 | "beginCaptures": { |
512 | 510 | "1": { |
513 | 511 | "name": "comment.luau" |
514 | 512 | } |
515 | 513 | }, |
516 | | - "endCaptures": { |
517 | | - "1": { |
518 | | - "name": "comment.luau" |
519 | | - } |
520 | | - }, |
521 | 514 | "patterns": [ |
522 | 515 | { |
523 | 516 | "include": "source.luau" |
524 | 517 | } |
525 | 518 | ] |
526 | 519 | }, |
| 520 | + { |
| 521 | + "match": "(```)", |
| 522 | + "name": "keyword.operator.other.luau", |
| 523 | + "captures": { |
| 524 | + "1": { |
| 525 | + "name": "comment.luau" |
| 526 | + } |
| 527 | + } |
| 528 | + }, |
527 | 529 | { |
528 | 530 | "include": "#doc_comment_tags" |
529 | 531 | } |
|
605 | 607 | ] |
606 | 608 | }, |
607 | 609 | "type-function": { |
608 | | - "begin": "^\\b(?:(export)\\s+)?(type)\\s+(function)\\b", |
| 610 | + "begin": "(?<![^.]\\.|:)\\b(?:(export)\\s+)?(type)\\s+(function)\\b", |
609 | 611 | "beginCaptures": { |
610 | 612 | "1": { |
611 | 613 | "name": "storage.modifier.visibility.luau" |
|
679 | 681 | ] |
680 | 682 | }, |
681 | 683 | "type-alias-declaration": { |
682 | | - "begin": "^\\b(?:(export)\\s+)?(type)\\b", |
683 | | - "end": "(?=\\s*$)|(?=\\s*;)", |
| 684 | + "begin": "(?<![^.]\\.|:)\\b(?:(export)\\s+)?(type)\\b(?=\\s+(?!function\\b)[a-zA-Z_][a-zA-Z0-9_]*)", |
| 685 | + "end": "(?=[),}\\]](?!\\s*[&|]))|(?=\\s*;)|(?=\\s*\\b(?:break|continue|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while)\\b)|(?=^\\s*$)|(?=^\\s*(?:@|\\b(?:export\\s+)?type\\b))|(?=^\\s*[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\s*(?:(?:[+\\-*/%^]|\\.\\.)?=(?!=)|\\(|\\[|:))", |
684 | 686 | "beginCaptures": { |
685 | 687 | "1": { |
686 | 688 | "name": "storage.modifier.visibility.luau" |
|
718 | 720 | "name": "keyword.operator.typecast.luau" |
719 | 721 | } |
720 | 722 | }, |
721 | | - "end": "(?=^|[;),}\\]:?\\-\\+\\>](?!\\s*[&\\|])|$|\\b(break|do|else|for|if|elseif|return|then|repeat|while|until|end|in|continue)\\b)", |
| 723 | + "end": "(?=[),}\\]](?!\\s*[&|]))|(?=\\s*;)|(?=\\s*\\b(?:break|continue|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while)\\b)|(?=^\\s*$)|(?=^\\s*(?:@|\\b(?:export\\s+)?type\\b))|(?=^\\s*[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\s*(?:(?:[+\\-*/%^]|\\.\\.)?=(?!=)|\\(|\\[|:))", |
722 | 724 | "patterns": [ |
723 | 725 | { |
724 | 726 | "include": "#type_literal" |
|
0 commit comments