aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/token.rs
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-03-21 17:12:05 -0700
committerGraydon Hoare <[email protected]>2011-03-21 18:10:34 -0700
commitcaa22c93415bb106bced82bbabc3d9ffbef7e69c (patch)
tree2a77dc7cfb33c82dcdc83a69a423ebc4340e576e /src/comp/front/token.rs
parentSupport CFG_LLVM_ROOT since CMake-built LLVM has no llvm-config (diff)
downloadrust-caa22c93415bb106bced82bbabc3d9ffbef7e69c.tar.xz
rust-caa22c93415bb106bced82bbabc3d9ffbef7e69c.zip
Started adding support for floating-point type, floating-point literals, and logging of floats. Other operations on float probably don't work yet.
Diffstat (limited to 'src/comp/front/token.rs')
-rw-r--r--src/comp/front/token.rs3
1 files changed, 2 insertions, 1 deletions
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 + "\"";