Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

98 lines (97 sloc) 4.081 kb
{ "name": "Rust",
"scopeName": "source.rust",
"fileTypes": ["rs", "rc"],
"foldingStartMarker": "^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$",
"foldingStopMarker": "^\\s*\\}",
"patterns": [
{"name": "variable.other.source.rust",
"match": "'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])"
},
{"name": "string.quoted.single.source.rust",
"begin": "'",
"end": "'",
"patterns": [
{"include": "#rust_escaped_character"}
]
},
{"name": "string.quoted.double.source.rust",
"begin": "\"",
"end": "\"",
"patterns": [
{"include": "#rust_escaped_character"}
]
},
{"name": "meta.function.source.rust",
"match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]?[\\w\\:,+ \\'<>]*)\\s*(\\()",
"captures": {
"1": {"name": "keyword.source.rust"},
"2": {"name": "entity.name.function.source.rust"},
"3": {"name": "keyword.operator.rust"}
}
},
{"name": "keyword.source.rust",
"match": "\\b(as|break|claim|const|copy|Copy|do|drop|else|extern|for|if|impl|in|let|loop|match|mod|mut|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|type)\\b"
},
{"name": "storage.type.source.rust",
"match": "\\b(Self|m32|m64|m128|f80|f16|f128|int|uint|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": "variable.language.source.rust",
"match": "\\bself\\b"
},
{"name": "constant.language.source.rust",
"match": "\\b(true|false|Some|None|Left|Right|Ok|Err)\\b"
},
{"name": "support.constant.source.rust",
"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": "comment.block.preprocessor.rust",
"match": "^(\\w\\(\\w\\)*!)|(#\\[[\\w=\\(\\)_]+\\])$"
},
{"name": "keyword.operator.rust",
"match": "\\{|\\}"
},
{"name": "keyword.operator.rust",
"match": "\\[|\\]"
},
{"name": "keyword.operator.rust",
"match": "\\(|\\)"
},
{"name": "constant.numeric.integer.source.rust",
"match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.hex.source.rust",
"match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.binary.source.rust",
"match": "\\b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.float.source.rust",
"match": "([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))"
},
{"name": "comment.line.documentation.source.rust",
"begin": "//!",
"end": "$\\n"
},
{"name": "comment.line.double-dash.source.rust",
"begin": "//",
"end": "$\\n"
},
{"name": "comment.block.source.rust",
"begin": "/\\*",
"end": "\\*/"
},
{"name": "keyword.operator.rust",
"match": "(=>)|(->)|[-:=*,!.+|%/&amp;~@<>;]"
},
{"name": "support.function.rust",
"match": "_"
}
],
"repository": {
"rust_escaped_character": {
"name": "constant.character.escape.source.rust",
"match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)"
}
},
"uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d"
}
Jump to Line
Something went wrong with that request. Please try again.