Skip to content

Commit f5d998b

Browse files
TheIronBornjasonwilliams
authored andcommitted
Syntax: stdsimd (#306)
* stdsimd syntax * stdsimd test * fix
1 parent f47507e commit f5d998b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

RustEnhanced.sublime-syntax

+12
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,18 @@ contexts:
425425
push: generic-angles
426426
- match: \b(Self|{{int_suffixes}}|{{float_suffixes}}|bool|char|str)\b
427427
scope: storage.type.rust
428+
# stdsimd types
429+
- match: |-
430+
(?x)
431+
\b(?:
432+
[ium]8x(?:2|4|8|16|32) | [iu]8x64 |
433+
[ium]16x(?:2|4|8|16) | [iu]16x32 | # f16xN types might come later
434+
[iumf]32x(?:2|4|8) | [iuf]32x16 |
435+
[iumf]64x(?:2|4) | [iuf]64x8 |
436+
m1x(?:64|32|16|8) | # 512-bit masks
437+
__m(?:64|128|256)[di]? # __m512 should come later
438+
)\b
439+
scope: storage.type.rust
428440
429441
generic-angles:
430442
- meta_scope: meta.generic.rust

syntax_test_rust.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,13 @@ pub union Foo<'a, Y: Baz>
13451345
fn union() {}
13461346
// ^^^^^ meta.function entity.name.function
13471347

1348+
let x: __m128i = __m128i::from_bits(f32x4::from_bits(m32x4::new(true, true, true, true)));
1349+
// ^^^^^^^ storage.type.rust
1350+
// ^^^^^^^ storage.type.rust
1351+
// ^^^^^ meta.group.rust storage.type.rust
1352+
// ^^^^^ meta.group.rust meta.group.rust storage.type.rust
1353+
// ^^^^ meta.group.rust meta.group.rust meta.group.rust constant.language.rust
1354+
13481355
// Ensure that `mut` is a storage modifier.
13491356
impl<A> Thing for &'a mut A {}
13501357
// ^^^ meta.impl keyword.other

0 commit comments

Comments
 (0)