From caa22c93415bb106bced82bbabc3d9ffbef7e69c Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 21 Mar 2011 17:12:05 -0700 Subject: Started adding support for floating-point type, floating-point literals, and logging of floats. Other operations on float probably don't work yet. --- src/comp/front/token.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/comp/front/token.rs') diff --git a/src/comp/front/token.rs b/src/comp/front/token.rs index 62c6406a..a1fb1cd0 100644 --- a/src/comp/front/token.rs +++ b/src/comp/front/token.rs @@ -126,6 +126,7 @@ tag token { LIT_INT(int); LIT_UINT(uint); LIT_MACH_INT(ty_mach, int); + LIT_FLOAT(str); LIT_STR(str); LIT_CHAR(char); LIT_BOOL(bool); @@ -295,7 +296,7 @@ fn to_str(token t) -> str { ret _int.to_str(i, 10u) + "_" + ty_mach_to_str(tm); } - + case (LIT_FLOAT(?s)) { ret s; } case (LIT_STR(?s)) { // FIXME: escape. ret "\"" + s + "\""; -- cgit v1.2.3