From 23e23bd762a4b5a14ff2abcbabfd2349621a3dbe Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 22 Mar 2011 17:25:40 -0700 Subject: Further support for floating-point. Literals with exponents work and literals with the 'f32' or 'f64' suffixes work as well. In addition, logging things with the f32 or f64 type works. (float is still assumed to be a synonym for f64). --- src/comp/front/parser.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/comp/front/parser.rs') diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index f1f8a918..9e13e706 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -545,6 +545,10 @@ impure fn parse_lit(parser p) -> ast.lit { p.bump(); lit = ast.lit_mach_int(tm, i); } + case (token.LIT_MACH_FLOAT(?tm, ?s)) { + p.bump(); + lit = ast.lit_mach_float(tm, s); + } case (token.LIT_CHAR(?c)) { p.bump(); lit = ast.lit_char(c); -- cgit v1.2.3