From 80307576245aabf00285db020bbfbc4c3a891766 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 27 Jul 2010 19:21:51 -0700 Subject: Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closes #129. --- src/boot/fe/ast.ml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/boot/fe/ast.ml') 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 = -- cgit v1.2.3