{ "fileTypes": [ "re", "rei" ], "foldingStartMarker": "^.*\\bfun\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$", "foldingStopMarker": "^\\s*\\}", "name": "Reason", "patterns": [ { "include": "#reason_comment_doc_block" }, { "include": "#reason_comment_block" }, { "include": "#reason_named_arg" }, { "include": "#reason_module" }, { "include": "#reason_lifetime" }, { "include": "#reason_self" }, { "include": "#reason_string" }, { "include": "#reason_raw_string" }, { "match": "\\'([^\\'\\\\]|\\\\(x\\h{2}|u\\{\\h{1,6}\\}|.))\\'", "name": "string.quoted.single.source.reason" }, { "captures": { "1": { "name": "keyword.source.reason" }, "2": { "name": "entity.name.function.source.reason" } }, "match": "\\b(fun)\\s+([a-zA-Z_][a-zA-Z0-9_]?[\\w\\:,+ \\'<>?]*)\\s*(?:\\()", "name": "meta.function.source.reason" }, { "captures": { "1": { "name": "keyword.source.reason" }, "2": { "name": "keyword.source.reason" }, "3": { "name": "keyword.source.reason" }, "4": { "name": "variable.other.reason" }, "5": { "name": "storage.type.source.reason" }, "6": { "name": "keyword.operator.reason" } }, "comment": "This matches the 'let x = val' style of variable intitialization.", "match": "(let|and)\\s+(module\\s+)(rec\\s+)?([[:alpha:]_][[:alnum:]_]*)\\s*(:[^=]*)?(=?)", "name": "meta.initialization.reason" }, { "captures": { "1": { "name": "keyword.source.reason" }, "2": { "name": "keyword.source.reason" }, "4": { "name": "storage.type.source.reason" }, "5": { "name": "keyword.operator.reason" } }, "comment": "This matches the 'let x = val' style of variable intitialization.", "match": "(let)\\s+(rec\\s+)?([[:alpha:]_][[:alnum:]_]*)\\s*(:[^=]*)?(=?)", "name": "meta.initialization.reason" }, { "captures": { "1": { "name": "keyword.source.reason" }, "2": { "name": "support" } }, "match": "(extern\\s+crate)\\s+(\\w+)", "name": "meta.import.reason" }, { "captures": { "1": { "name": "keyword.source.reason" }, "2": { "name": "entity.name.macro.source.reason" } }, "match": "\\b(macro_rules!)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?:\\{)", "name": "meta.macro.source.reason" }, { "match": "\\b(as|box|break|claim|const|continue|copy|Copy|crate|do|drop|then|else|extern|for|if|impl|in|let|and|loop|switch|fun|open|include|mod|move|mutable|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|exception|type|module|rec|where)\\b", "name": "keyword.source.reason" }, { "match": "\\b(Self|m32|m64|m128|f80|f16|f128|int|uint|isize|usize|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|Option|Either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b", "name": "storage.type.source.reason" }, { "match": "\\bself\\b", "name": "variable.language.source.reason" }, { "match": "\\b(true|false|Some|None|Ok|Err)\\b", "name": "constant.language.source.reason" }, { "match": "\\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b", "name": "support.constant.source.reason" }, { "begin": "#!?\\[", "end": "\\]", "name": "comment.block.attribute.reason", "patterns": [ { "include": "#reason_string" }, { "include": "#reason_raw_string" } ] }, { "match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(usize|u8|u16|u32|u64))|([0-9][0-9_]*(isize|i8|i16|i32|i64)))\\b", "name": "constant.numeric.integer.source.reason" }, { "match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(usize|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(isize|i8|i16|i32|i64)))\\b", "name": "constant.numeric.hex.source.reason" }, { "match": "\\b((0b[01_]+)|(0b[01_]+(usize|u8|u16|u32|u64))|(0b[01_]+(isize|i8|i16|i32|i64)))\\b", "name": "constant.numeric.binary.source.reason" }, { "match": "\\b(([0-9][0-9_]*(f32|f64|f))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+)|([0-9][0-9_]*\\.[0-9_]+(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+)(f32|f64|f)))\\b", "name": "constant.numeric.float.source.reason" }, { "match": "(=>)|(->)|[-:=*,!.+|%/&~@<>;]", "name": "keyword.operator.reason" }, { "match": "\\b_\\b", "name": "support.function.reason" }, { "match": "\\b(\\w+)\\b(?=\\()", "name": "support.function.reason" }, { "match": "\\b(\\w+!)(?=\\()", "name": "support.macro.reason" }, { "match": "\\b(\\w+)::", "name": "meta.namespace-block.reason" }, { "captures": { "1": { "name": "meta.preprocessor.reason" } }, "match": "\\b(\\w+!)\\s*[({\\[]", "name": "meta.macro.source.reason" }, { "match": "(\\[|\\]|{|}|\\(|\\))", "name": "punctuation.definition.bracket.reason" }, { "match": "\\b(Box|Vec|StrBuf|Path|Option|Result|Reader|Writer|Stream|Seek|Buffer|IoError|IoResult|Sender|SyncSender|Receiver|Cell|RefCell|Any)\\b", "name": "support.class.std.source.reason" }, { "match": "\\b(Send|Sized|Copy|Share)\\b", "name": "support.type.kind.source.reason" }, { "match": "\\bbox\\b", "name": "storage.modifier.box.source.reason" }, { "match": "\\brec\\b", "name": "storage.modifier.rec.source.reason" }, { "match": "\\bmodule\\b", "name": "storage.modifier.module.source.reason" } ], "repository": { "reason_comment_block": { "begin": "/\\*", "end": "\\*/", "name": "comment.block.source.reason", "patterns": [ { "include": "#reason_comment_block" } ] }, "reason_comment_doc_block": { "begin": "/\\*[!\\*][^\\*]", "end": "\\*/", "name": "comment.block.documentation.source.reason", "patterns": [ { "include": "#reason_comment_doc_block" } ] }, "reason_escaped_character": { "match": "\\\\(x\\h{2}|u\\{\\h{1,6}\\}|.)", "name": "constant.character.escape.source.reason" }, "reason_lifetime": { "captures": { "1": { "name": "entity.name.lifetime.source.reason" } }, "match": "\\'([a-zA-Z_][a-zA-Z0-9_]*)(?!\\')\\b", "name": "storage.modifier.lifetime.source.reason" }, "reason_module": { "captures": { "1": { "name": "variable.other.reason" } }, "match": "\\b([A-Z][a-zA-Z0-9_]*)\\b" }, "reason_named_arg": { "captures": { "1": { "name": "storage.modifier.lifetime.source.reason" }, "2": { "name": "entity.name.lifetime.source.reason" } }, "match": "(@([a-zA-Z_][a-zA-Z0-9_]*))\\b" }, "reason_raw_string": { "begin": "r(#*)\"", "end": "\"(\\1)", "name": "string.quoted.double.raw.source.reason" }, "reason_self": { "match": "\\bself\\b", "name": "variable.language.source.reason" }, "reason_string": { "begin": "\"", "end": "\"", "name": "string.quoted.double.source.reason", "patterns": [ { "include": "#reason_escaped_character" } ] } }, "scopeName": "source.reason", "uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d" }