diff options
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index bc8515836..2798937a6 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -699,7 +699,22 @@ impl ExprCollector { | |||
699 | // TODO: actually parse integer | 699 | // TODO: actually parse integer |
700 | Literal::Int(0u64, ty) | 700 | Literal::Int(0u64, ty) |
701 | } | 701 | } |
702 | SyntaxKind::FLOAT_NUMBER => Literal::Float(0, UncertainFloatTy::Unknown), | 702 | SyntaxKind::FLOAT_NUMBER => { |
703 | let text = c.text().to_string(); | ||
704 | |||
705 | // FIXME: don't do it like this. maybe use something like | ||
706 | // the IntTy::from_name functions | ||
707 | let ty = if text.ends_with("f64") { | ||
708 | UncertainFloatTy::Known(FloatTy::F64) | ||
709 | } else if text.ends_with("f32") { | ||
710 | UncertainFloatTy::Known(FloatTy::F32) | ||
711 | } else { | ||
712 | UncertainFloatTy::Unknown | ||
713 | }; | ||
714 | |||
715 | // TODO: actually parse value | ||
716 | Literal::Float(0, ty) | ||
717 | } | ||
703 | SyntaxKind::STRING => { | 718 | SyntaxKind::STRING => { |
704 | // FIXME: this likely includes the " characters | 719 | // FIXME: this likely includes the " characters |
705 | let text = c.text().to_string(); | 720 | let text = c.text().to_string(); |