diff options
| author | Josh Matthews <josh@joshmatthews.net> | 2011-11-10 06:31:42 -0500 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-10 11:40:34 -0800 |
| commit | 43cb74b830110693e4e54c5670033cbae5c87e24 (patch) | |
| tree | 76a893d796791953a34ed75d519f0e1f0362f2ad /src/comp/syntax | |
| parent | 599baf93257c5fef6600d4c10dbf256965e37fdc (diff) | |
| download | rust-43cb74b830110693e4e54c5670033cbae5c87e24.tar.gz rust-43cb74b830110693e4e54c5670033cbae5c87e24.zip | |
Add float support to #fmt. Fix #1014.
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/ext/fmt.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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; |
