Color in as a control keyword

This commit is contained in:
George Fraser
2020-05-10 11:08:32 -07:00
parent 46566d7a79
commit 3f1c73633e
3 changed files with 10 additions and 1 deletions

View File

@@ -63,6 +63,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
<span class="static mutable">STATIC_MUT</span> = <span class="numeric_literal">1</span>;
}
<span class="keyword control">for</span> <span class="variable declaration">e</span> <span class="keyword control">in</span> <span class="variable mutable">vec</span> {
<span class="comment">// Do nothing</span>
}
<span class="keyword">let</span> <span class="keyword">mut</span> <span class="variable declaration mutable">x</span> = <span class="numeric_literal">42</span>;
<span class="keyword">let</span> <span class="variable declaration mutable">y</span> = &<span class="keyword">mut</span> <span class="variable mutable">x</span>;
<span class="keyword">let</span> <span class="variable declaration">z</span> = &<span class="variable mutable">y</span>;

View File

@@ -408,7 +408,8 @@ fn highlight_element(
| T![loop]
| T![match]
| T![return]
| T![while] => h | HighlightModifier::ControlFlow,
| T![while]
| T![in] => h | HighlightModifier::ControlFlow,
T![unsafe] => h | HighlightModifier::Unsafe,
_ => h,
}

View File

@@ -47,6 +47,10 @@ fn main() {
STATIC_MUT = 1;
}
for e in vec {
// Do nothing
}
let mut x = 42;
let y = &mut x;
let z = &y;