From 43cb74b830110693e4e54c5670033cbae5c87e24 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 10 Nov 2011 06:31:42 -0500 Subject: Add float support to #fmt. Fix #1014. --- src/comp/syntax/ext/fmt.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/comp/syntax') diff --git a/src/comp/syntax/ext/fmt.rs b/src/comp/syntax/ext/fmt.rs index f3fb25acaf9..575d49e15a6 100644 --- a/src/comp/syntax/ext/fmt.rs +++ b/src/comp/syntax/ext/fmt.rs @@ -196,6 +196,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr]) ty_int(s) { alt s { signed. { ret true; } unsigned. { ret false; } } } + ty_float. { ret true; } _ { ret false; } } } @@ -250,6 +251,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr]) ty_hex(_) { ret make_conv_call(cx, arg.span, "uint", cnv, arg); } ty_bits. { ret make_conv_call(cx, arg.span, "uint", cnv, arg); } ty_octal. { ret make_conv_call(cx, arg.span, "uint", cnv, arg); } + ty_float. { ret make_conv_call(cx, arg.span, "float", cnv, arg); } _ { cx.span_unimpl(sp, unsupported); } } } @@ -301,6 +303,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr]) } } ty_octal. { log "type: octal"; } + ty_float. { log "type: float"; } } } let fmt_sp = args[0].span; -- cgit 1.4.1-3-g733a5