Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions RustEnhanced.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contexts:
- match: ';'
scope: punctuation.terminator

- match: '''({{identifier}})\s*(:)'
- match: '(''{{identifier}})\s*(:)'
captures:
1: entity.name.label.rust
2: punctuation.separator.rust
Expand Down Expand Up @@ -138,9 +138,14 @@ contexts:
- match: \b(crate|extern|use|where)\b
scope: keyword.other.rust

- match: \b(break|else|for|if|loop|match|while|continue|yield)\b
- match: \b(else|for|if|loop|match|while|yield)\b
scope: keyword.control.rust

- match: '\b(break|continue)(?:\s+(''{{identifier}}))?'
captures:
1: keyword.control.rust
2: entity.name.label.rust

- match: \breturn\b
scope: keyword.control.rust

Expand Down
17 changes: 17 additions & 0 deletions syntax_test_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,23 @@ let big_n =
}
}

'label1: for _ in 0..100 {
'label2 : loop {
// ^^^^^^^ entity.name.label
// ^ punctuation.separator.rust
'label3: while true {
// ^^^^^^^ entity.name.label
// ^ punctuation.separator
break 'label2;
// ^^^^^^^ entity.name.label
// ^ punctuation.terminator
}
continue 'label1;
// ^^^^^^^ entity.name.label
// ^ punctuation.terminator
}
}

while n < 50 {
//^^^ keyword.control
n = n * 2;
Expand Down