diff options
| author | Graydon Hoare <[email protected]> | 2010-07-27 19:21:51 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-27 19:21:51 -0700 |
| commit | 80307576245aabf00285db020bbfbc4c3a891766 (patch) | |
| tree | 7e408956ca3e895844dd30a1afddf64d83157da0 /src/boot/fe/token.ml | |
| parent | Calm some LLVM indigestion of last change. (diff) | |
| download | rust-80307576245aabf00285db020bbfbc4c3a891766.tar.xz rust-80307576245aabf00285db020bbfbc4c3a891766.zip | |
Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closes #129.
Diffstat (limited to 'src/boot/fe/token.ml')
| -rw-r--r-- | src/boot/fe/token.ml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/boot/fe/token.ml b/src/boot/fe/token.ml index cb3bb0b0..64aef2a4 100644 --- a/src/boot/fe/token.ml +++ b/src/boot/fe/token.ml @@ -103,8 +103,11 @@ type token = | JOIN (* Literals *) - | LIT_INT of (int64 * string) - | LIT_FLO of string + | LIT_INT of int64 + | LIT_UINT of int64 + | LIT_FLOAT of float + | LIT_MACH_INT of Common.ty_mach * int64 + | LIT_MACH_FLOAT of Common.ty_mach * float | LIT_STR of string | LIT_CHAR of int | LIT_BOOL of bool @@ -253,8 +256,13 @@ let rec string_of_tok t = | JOIN -> "join" (* Literals *) - | LIT_INT (_,s) -> s - | LIT_FLO n -> n + | LIT_INT i -> Int64.to_string i + | LIT_UINT i -> (Int64.to_string i) ^ "u" + | LIT_FLOAT s -> string_of_float s + | LIT_MACH_INT (tm, i) -> + (Int64.to_string i) ^ (Common.string_of_ty_mach tm) + | LIT_MACH_FLOAT (tm, f) -> + (string_of_float f) ^ (Common.string_of_ty_mach tm) | LIT_STR s -> ("\"" ^ (String.escaped s) ^ "\"") | LIT_CHAR c -> ("'" ^ (Common.escaped_char c) ^ "'") | LIT_BOOL b -> if b then "true" else "false" |