Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closes #129.

This commit is contained in:
Graydon Hoare 2010-07-27 19:21:51 -07:00
parent 6662aeb779
commit 8030757624
24 changed files with 156 additions and 207 deletions

View file

@ -1,8 +1,8 @@
// -*- rust -*-
fn main() {
let i32 x = i32(-400);
x = i32(0) - x;
check(x == i32(400));
let i32 x = -400_i32;
x = 0_i32 - x;
check(x == 400_i32);
}

View file

@ -1,9 +1,9 @@
// -*- rust -*-
fn main() {
let i8 x = i8(-12);
let i8 y = i8(-12);
x = x + i8(1);
x = x - i8(1);
let i8 x = -12i8;
let i8 y = -12i8;
x = x + 1i8;
x = x - 1i8;
check(x == y);
}

View file

@ -1,8 +1,8 @@
// -*- rust -*-
fn main() {
let u32 word = (200000 as u32);
word = word - (1 as u32);
check(word == (199999 as u32));
let u32 word = (200000u32);
word = word - (1u32);
check(word == (199999u32));
}

View file

@ -4,9 +4,9 @@
// in the rest of the generated code so they're easily grep-able.
fn main() {
let u8 x = 19 as u8; // 0x13
let u8 y = 35 as u8; // 0x23
x = x + (7 as u8); // 0x7
y = y - (9 as u8); // 0x9
let u8 x = 19u8; // 0x13
let u8 y = 35u8; // 0x23
x = x + (7u8); // 0x7
y = y - (9u8); // 0x9
check(x == y);
}

View file

@ -1,12 +1,12 @@
// -*- rust -*-
fn main() {
let u8 x = 12 as u8;
let u8 y = 12 as u8;
x = x + (1 as u8);
x = x - (1 as u8);
let u8 x = 12u8;
let u8 y = 12u8;
x = x + (1u8);
x = x - (1u8);
check(x == y);
//x = 14 as u8;
//x = x + 1 as u8;
// x = 14u8;
// x = x + 1u8;
}