@@ -7,9 +7,10 @@ file_extensions:
7
7
scope : source.rust
8
8
variables :
9
9
identifier : ' (?:[[:alpha:]][_[:alnum:]]*|_[_[:alnum:]]+)'
10
- escaped_byte : ' \\(x\h{2}|n|r|t|0|"| '' |\\ )'
11
- escaped_char : ' \\(x\h{2}|n|r|t|0|"| '' |\\ |u\{\h{1,6}\})'
10
+ escaped_byte : ' \\([nrt0\" '' \\]|x\h{2} )'
11
+ escaped_char : ' \\([nrt0\" '' \\]|x\h{2} |u\{\h{1,6}\})'
12
12
int_suffixes : ' [iu](?:8|16|32|64|size)'
13
+ float_suffixes : ' f(32|64)'
13
14
contexts :
14
15
main :
15
16
- include : statements
@@ -310,8 +311,8 @@ contexts:
310
311
scope : keyword.operator.rust
311
312
- match : ' [!]?(?=\bSync|Send\b)'
312
313
scope : keyword.operator.rust
313
- - match : \b(Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b
314
- scope : support.type.rust
314
+ - match : \b(Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b
315
+ scope : support.type.rust
315
316
316
317
return-type :
317
318
- match : ' \bimpl\b'
@@ -394,7 +395,7 @@ contexts:
394
395
type :
395
396
- match : ' {{identifier}}(?=<)'
396
397
push : generic-angles
397
- - match : \b(Self|i8|i16|i32|i64|isize|u8|u16|u32|u64|usize|f32|f64 |bool|char|str)\b
398
+ - match : \b(Self|{{int_suffixes}}|{{float_suffixes}} |bool|char|str)\b
398
399
scope : storage.type.rust
399
400
400
401
generic-angles :
@@ -982,30 +983,34 @@ contexts:
982
983
scope: constant.other.placeholder.rust
983
984
984
985
numbers :
985
- - match : ' \b((?:\d[\d_]*)?\d\ .)(\d[\d_]*(?:[eE][+-]?[\d_]*\d[\d_]* )?)(f32|f64 )?'
986
+ - match : ' \b((?:\d[\d_]*)?\.)(\d[\d_]*(?:[eE][+-]?[\d_]+ )?)({{float_suffixes}} )?'
986
987
captures :
987
988
1 : constant.numeric.float.rust
988
989
2 : constant.numeric.float.rust
989
990
3 : storage.type.numeric.rust
990
- - match : ' \b((?: \d[\d_]*)?\d \.)(?!\.)'
991
+ - match : ' \b(\d[\d_]*\.)(?!\.)'
991
992
scope : constant.numeric.float.rust
992
- - match : ' \b(\d[\d_]*)(f32|f64)\b'
993
+ - match : ' \b(\d[\d_]*)({{float_suffixes}})\b'
994
+ captures :
995
+ 1 : constant.numeric.float.rust
996
+ 2 : storage.type.numeric.rust
997
+ - match : ' \b(\d[\d_]*(?:\.[\d_]+)?[eE][-+]?[\d_]+)({{float_suffixes}})?\b'
993
998
captures :
994
999
1 : constant.numeric.float.rust
995
1000
2 : storage.type.numeric.rust
996
1001
- match : ' \b(\d[\d_]*)({{int_suffixes}})?\b'
997
1002
captures :
998
1003
1 : constant.numeric.integer.decimal.rust
999
1004
2 : storage.type.numeric.rust
1000
- - match : ' \b(0x[\h_]*\h[\h_]* )({{int_suffixes}})?\b'
1005
+ - match : ' \b(0x[\h_]+ )({{int_suffixes}})?\b'
1001
1006
captures :
1002
1007
1 : constant.numeric.integer.hexadecimal.rust
1003
1008
2 : storage.type.numeric.rust
1004
- - match : ' \b(0o[0-7_]*[0-7][0-7_]* )({{int_suffixes}})?\b'
1009
+ - match : ' \b(0o[0-7_]+ )({{int_suffixes}})?\b'
1005
1010
captures :
1006
1011
1 : constant.numeric.integer.octal.rust
1007
1012
2 : storage.type.numeric.rust
1008
- - match : ' \b(0b[0-1_]*[0-1][0-1_]* )({{int_suffixes}})?\b'
1013
+ - match : ' \b(0b[0-1_]+ )({{int_suffixes}})?\b'
1009
1014
captures :
1010
1015
1 : constant.numeric.integer.binary.rust
1011
1016
2 : storage.type.numeric.rust
0 commit comments