Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
15b6d56c
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
15b6d56c
编写于
3月 07, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[rust] update rust grammar (Feb 14, 2016)
上级
9f8ee47b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
198 addition
and
54 deletion
+198
-54
extensions/rust/syntaxes/rust.json
extensions/rust/syntaxes/rust.json
+198
-54
未找到文件。
extensions/rust/syntaxes/rust.json
浏览文件 @
15b6d56c
...
...
@@ -63,7 +63,8 @@
"raw_string_literal"
:
{
"comment"
:
"Raw double-quote string literal"
,
"name"
:
"string.quoted.double.raw.rust"
,
"match"
:
"b?r(#*)
\"
.*?
\"
(
\\
1)"
"begin"
:
"b?r(#*)
\"
"
,
"end"
:
"
\"\\
1"
},
"sigils"
:
{
"comment"
:
"Sigil"
,
...
...
@@ -85,6 +86,16 @@
"name"
:
"storage.modifier.box.rust"
,
"match"
:
"
\\
bbox
\\
b"
},
"const"
:
{
"comment"
:
"Const storage modifier"
,
"name"
:
"storage.modifier.const.rust"
,
"match"
:
"
\\
bconst
\\
b"
},
"pub"
:
{
"comment"
:
"Visibility modifier"
,
"name"
:
"storage.modifier.visibility.rust"
,
"match"
:
"
\\
bpub
\\
b"
},
"lifetime"
:
{
"comment"
:
"Named lifetime"
,
"name"
:
"storage.modifier.lifetime.rust"
,
...
...
@@ -107,40 +118,40 @@
}
}
},
"types"
:
{
"comment"
:
"Built-in type"
,
"name"
:
"storage.type.rust"
,
"match"
:
"
\\
b(bool|char|usize|isize|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|str|Self)
\\
b"
"core_types"
:
{
"comment"
:
"Built-in/core type"
,
"name"
:
"storage.type.core.rust"
,
"match"
:
"
\\
b(bool|char|usize|isize|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|str|Self|Option|Result)
\\
b"
},
"core_vars"
:
{
"comment"
:
"Core type variant"
,
"name"
:
"support.constant.core.rust"
,
"match"
:
"
\\
b(Some|None|Ok|Err)
\\
b"
},
"marker"
:
{
"
core_
marker"
:
{
"comment"
:
"Core trait (marker)"
,
"name"
:
"support.type.marker.rust"
,
"match"
:
"
\\
b(Copy|Send|Sized|Sync)
\\
b"
},
"
op
s"
:
{
"comment"
:
"Core trait
(op)
"
,
"name"
:
"support.type.
ops
.rust"
,
"match"
:
"
\\
b(Drop|Fn|FnMut|FnOnce)
\\
b"
"
core_trait
s"
:
{
"comment"
:
"Core trait"
,
"name"
:
"support.type.
core
.rust"
,
"match"
:
"
\\
b(Drop|Fn|FnMut|FnOnce
|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator
)
\\
b"
},
"std_types"
:
{
"comment"
:
"Standard library type"
,
"name"
:
"storage.class.std.rust"
,
"match"
:
"
\\
b(Box|Option|Path|PathBuf|Result|String|Vec)
\\
b"
},
"std_vars"
:
{
"comment"
:
"Standard library type variant"
,
"name"
:
"support.constant.std.rust"
,
"match"
:
"
\\
b(Some|None|Ok|Err)
\\
b"
"match"
:
"
\\
b(Box|String|Vec|Path|PathBuf)
\\
b"
},
"std_traits"
:
{
"comment"
:
"Standard library trait"
,
"name"
:
"support.type.std.rust"
,
"match"
:
"
\\
b(
Clone|PartialEq|PartialOrd|Eq|Ord|Read|Write|Seek|BufRead|DoubleEndedIterator|ExactSizeIterator|Iterator|Extend|AsPath|AsSlice|Str
|ToString)
\\
b"
"match"
:
"
\\
b(
ToOwned
|ToString)
\\
b"
},
"type_params"
:
{
"comment"
:
"Type parameters"
,
"name"
:
"meta.type_params.rust"
,
"begin"
:
"<"
,
"begin"
:
"<
(?![=<])
"
,
"end"
:
">"
,
"patterns"
:
[
{
...
...
@@ -159,13 +170,16 @@
"include"
:
"#lifetime"
},
{
"include"
:
"#types"
"include"
:
"#core_types"
},
{
"include"
:
"#core_marker"
},
{
"include"
:
"#
marker
"
"include"
:
"#
core_traits
"
},
{
"include"
:
"#
op
s"
"include"
:
"#
std_type
s"
},
{
"include"
:
"#std_traits"
...
...
@@ -214,17 +228,17 @@
{
"comment"
:
"Floating point literal (fraction)"
,
"name"
:
"constant.numeric.float.rust"
,
"match"
:
"
\\
b[0-9][0-9_]*
\\
.[0-9][0-9_]*([eE][+-][0-9_]+)?(f32|f64)?
\\
b"
"match"
:
"
\\
b[0-9][0-9_]*
\\
.[0-9][0-9_]*([eE][+-]
?
[0-9_]+)?(f32|f64)?
\\
b"
},
{
"comment"
:
"Floating point literal (exponent)"
,
"name"
:
"constant.numeric.float.rust"
,
"match"
:
"
\\
b[0-9][0-9_]*(
\\
.[0-9][0-9_]*)?[eE][+-][0-9_]+(f32|f64)?
\\
b"
"match"
:
"
\\
b[0-9][0-9_]*(
\\
.[0-9][0-9_]*)?[eE][+-]
?
[0-9_]+(f32|f64)?
\\
b"
},
{
"comment"
:
"Floating point literal (typed)"
,
"name"
:
"constant.numeric.float.rust"
,
"match"
:
"
\\
b[0-9][0-9_]*(
\\
.[0-9][0-9_]*)?([eE][+-][0-9_]+)?(f32|f64)
\\
b"
"match"
:
"
\\
b[0-9][0-9_]*(
\\
.[0-9][0-9_]*)?([eE][+-]
?
[0-9_]+)?(f32|f64)
\\
b"
},
{
"comment"
:
"Integer literal (decimal)"
,
...
...
@@ -251,16 +265,6 @@
"name"
:
"storage.modifier.static.rust"
,
"match"
:
"
\\
bstatic
\\
b"
},
{
"comment"
:
"Const storage modifier"
,
"name"
:
"storage.modifier.const.rust"
,
"match"
:
"
\\
bconst
\\
b"
},
{
"comment"
:
"Visibility modifier"
,
"name"
:
"storage.modifier.visibility.rust"
,
"match"
:
"
\\
bpub
\\
b"
},
{
"comment"
:
"Boolean constant"
,
"name"
:
"constant.language.boolean.rust"
,
...
...
@@ -300,24 +304,50 @@
"include"
:
"#ref_lifetime"
},
{
"comment"
:
"Operator"
,
"name"
:
"keyword.operator.rust"
,
"match"
:
"(
\\
+|-|/|
\\
*|=|
\\
^|&|
\\
||!|>|<|%|::|
\\
bas
\\
b)"
"include"
:
"#const"
},
{
"include"
:
"#
types
"
"include"
:
"#
pub
"
},
{
"include"
:
"#marker"
"comment"
:
"Miscellaneous operator"
,
"name"
:
"keyword.operator.misc.rust"
,
"match"
:
"(=>|::|
\\
bas
\\
b)"
},
{
"include"
:
"#ops"
"comment"
:
"Comparison operator"
,
"name"
:
"keyword.operator.comparison.rust"
,
"match"
:
"(&&|
\\
|
\\
||==|!=)"
},
{
"include"
:
"#std_types"
"comment"
:
"Assignment operator"
,
"name"
:
"keyword.operator.assignment.rust"
,
"match"
:
"(
\\
+=|-=|/=|
\\
*=|%=|
\\
^=|&=|
\\
|=|<<=|>>=|=)"
},
{
"comment"
:
"Arithmetic operator"
,
"name"
:
"keyword.operator.arithmetic.rust"
,
"match"
:
"(!|
\\
+|-|/|
\\
*|%|
\\
^|&|
\\
||<<|>>)"
},
{
"include"
:
"#std_vars"
"comment"
:
"Comparison operator (second group because of regex precedence)"
,
"name"
:
"keyword.operator.comparison.rust"
,
"match"
:
"(<=|>=|<|>)"
},
{
"include"
:
"#core_types"
},
{
"include"
:
"#core_vars"
},
{
"include"
:
"#core_marker"
},
{
"include"
:
"#core_traits"
},
{
"include"
:
"#std_types"
},
{
"include"
:
"#std_traits"
...
...
@@ -373,17 +403,50 @@
}
},
"patterns"
:
[
{
"include"
:
"#block_comment"
},
{
"include"
:
"#line_comment"
},
{
"include"
:
"#sigils"
},
{
"include"
:
"#self"
},
{
"include"
:
"#mut"
},
{
"include"
:
"#ref_lifetime"
},
{
"include"
:
"#core_types"
},
{
"include"
:
"#core_marker"
},
{
"include"
:
"#core_traits"
},
{
"include"
:
"#std_types"
},
{
"include"
:
"#std_traits"
},
{
"include"
:
"#type_params"
},
{
"include"
:
"
$self
"
"include"
:
"
#const
"
}
]
},
{
"comment"
:
"Type declaration"
,
"begin"
:
"
\\
b(enum|struct|trait
|type
)
\\
s+([a-zA-Z_][a-zA-Z0-9_]*)"
,
"begin"
:
"
\\
b(enum|struct|trait)
\\
s+([a-zA-Z_][a-zA-Z0-9_]*)"
,
"end"
:
"[
\\
{;]"
,
"beginCaptures"
:
{
"1"
:
{
...
...
@@ -394,42 +457,123 @@
}
},
"patterns"
:
[
{
"include"
:
"#block_comment"
},
{
"include"
:
"#line_comment"
},
{
"include"
:
"#core_traits"
},
{
"include"
:
"#std_traits"
},
{
"include"
:
"#type_params"
},
{
"include"
:
"$self"
"include"
:
"#core_types"
},
{
"include"
:
"#pub"
}
]
},
{
"comment"
:
"
Implementation
"
,
"begin"
:
"
\\
b(
impl)
\\
b
"
,
"end"
:
"
\\
{
"
,
"comment"
:
"
Type alias
"
,
"begin"
:
"
\\
b(
type)
\\
s+([a-zA-Z_][a-zA-Z0-9_]*)
"
,
"end"
:
"
;
"
,
"beginCaptures"
:
{
"1"
:
{
"name"
:
"storage.type.rust"
},
"2"
:
{
"name"
:
"entity.name.type.rust"
}
},
"patterns"
:
[
{
"include"
:
"#type_params"
"include"
:
"#block_comment"
},
{
"include"
:
"#line_comment"
},
{
"include"
:
"$self"
"include"
:
"#sigils"
},
{
"include"
:
"#mut"
},
{
"include"
:
"#ref_lifetime"
},
{
"include"
:
"#core_types"
},
{
"include"
:
"#core_marker"
},
{
"include"
:
"#core_traits"
},
{
"include"
:
"#std_types"
},
{
"include"
:
"#std_traits"
},
{
"include"
:
"#type_params"
}
]
},
{
"comment"
:
"Variable declaration"
,
"begin"
:
":"
,
"end"
:
"[=;,
\\
)
\\
|]"
,
"comment"
:
"Implementation"
,
"begin"
:
"
\\
b(impl)
\\
b"
,
"end"
:
"
\\
{"
,
"beginCaptures"
:
{
"1"
:
{
"name"
:
"storage.type.rust"
}
},
"patterns"
:
[
{
"include"
:
"#block_comment"
},
{
"include"
:
"#line_comment"
},
{
"include"
:
"#sigils"
},
{
"include"
:
"#mut"
},
{
"include"
:
"#ref_lifetime"
},
{
"include"
:
"#core_types"
},
{
"include"
:
"#core_marker"
},
{
"include"
:
"#core_traits"
},
{
"include"
:
"#std_types"
},
{
"include"
:
"#std_traits"
},
{
"include"
:
"#type_params"
},
{
"include"
:
"$self"
"name"
:
"storage.type.rust"
,
"match"
:
"
\\
bfor
\\
b"
}
]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录