aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe/ast.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-27 19:21:51 -0700
committerGraydon Hoare <[email protected]>2010-07-27 19:21:51 -0700
commit80307576245aabf00285db020bbfbc4c3a891766 (patch)
tree7e408956ca3e895844dd30a1afddf64d83157da0 /src/boot/fe/ast.ml
parentCalm some LLVM indigestion of last change. (diff)
downloadrust-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/ast.ml')
-rw-r--r--src/boot/fe/ast.ml17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml
index 767a6426..651b1e65 100644
--- a/src/boot/fe/ast.ml
+++ b/src/boot/fe/ast.ml
@@ -333,10 +333,11 @@ and expr =
and lit =
| LIT_nil
| LIT_bool of bool
- | LIT_mach of (ty_mach * int64 * string)
- | LIT_int of (int64 * string)
- | LIT_uint of (int64 * string)
+ | LIT_mach_int of (ty_mach * int64)
+ | LIT_int of int64
+ | LIT_uint of int64
| LIT_char of int
+ (* FIXME: No support for LIT_mach_float or LIT_float yet. *)
and lval_component =
@@ -835,13 +836,15 @@ and fmt_lit (ff:Format.formatter) (l:lit) : unit =
| LIT_nil -> fmt ff "()"
| LIT_bool true -> fmt ff "true"
| LIT_bool false -> fmt ff "false"
- | LIT_mach (m, _, s) ->
+ | LIT_mach_int (m, i) ->
begin
+ fmt ff "%Ld" i;
fmt_mach ff m;
- fmt ff "(%s)" s
end
- | LIT_int (_,s) -> fmt ff "%s" s
- | LIT_uint (_,s) -> fmt ff "%s" s
+ | LIT_int i -> fmt ff "%Ld" i
+ | LIT_uint i ->
+ fmt ff "%Ld" i;
+ fmt ff "u"
| LIT_char c -> fmt ff "'%s'" (Common.escaped_char c)
and fmt_domain (ff:Format.formatter) (d:domain) : unit =