Tag yield and await as ControlFlow in semantic highlighting

This commit is contained in:
Lukas Wirth 2021-04-23 16:43:48 +02:00
parent 85bab7539a
commit c005ce60a0
2 changed files with 13 additions and 5 deletions

View file

@ -254,15 +254,17 @@ pub(super) fn element(
k if k.is_keyword() => {
let h = Highlight::new(HlTag::Keyword);
match k {
T![break]
T![await]
| T![break]
| T![continue]
| T![else]
| T![if]
| T![in]
| T![loop]
| T![match]
| T![return]
| T![while]
| T![in] => h | HlMod::ControlFlow,
| T![yield] => h | HlMod::ControlFlow,
T![for] if !is_child_of_impl(&element) => h | HlMod::ControlFlow,
T![unsafe] => h | HlMod::Unsafe,
T![true] | T![false] => HlTag::BoolLiteral.into(),