Implement const block inference

This commit is contained in:
Lukas Wirth 2020-12-23 12:24:24 +01:00
parent 0a780c0ab3
commit a142beaf01
5 changed files with 25 additions and 6 deletions

View file

@ -358,6 +358,7 @@ pub enum Effect {
Async(SyntaxToken),
Unsafe(SyntaxToken),
Try(SyntaxToken),
Const(SyntaxToken),
// Very much not an effect, but we stuff it into this node anyway
Label(ast::Label),
}
@ -373,6 +374,9 @@ impl ast::EffectExpr {
if let Some(token) = self.try_token() {
return Effect::Try(token);
}
if let Some(token) = self.const_token() {
return Effect::Const(token);
}
if let Some(label) = self.label() {
return Effect::Label(label);
}