make in and foreach get treated as keywords

This commit is contained in:
Daniel Micay 2013-07-31 17:59:59 -04:00
parent c47be6929b
commit dabd476203
30 changed files with 184 additions and 184 deletions

View file

@ -62,10 +62,10 @@ fn square_from_char(c: char) -> square {
}
}
fn read_board_grid<rdr:'static + io::Reader>(in: rdr) -> ~[~[square]] {
let in = @in as @io::Reader;
fn read_board_grid<rdr:'static + io::Reader>(input: rdr) -> ~[~[square]] {
let input = @input as @io::Reader;
let mut grid = ~[];
for in.each_line |line| {
for input.each_line |line| {
let mut row = ~[];
for line.iter().advance |c| {
row.push(square_from_char(c))

View file

@ -27,11 +27,11 @@ pub fn main() {
assert_eq!(foobar, somefoobar.get());
}
fn optint(in: int) -> Option<int> {
if in == 0 {
fn optint(input: int) -> Option<int> {
if input == 0 {
return None;
}
else {
return Some(in);
return Some(input);
}
}

View file

@ -12,8 +12,8 @@ enum t1 { a(int), b(uint), }
struct T2 {x: t1, y: int}
enum t3 { c(T2, uint), }
fn m(in: t3) -> int {
match in {
fn m(input: t3) -> int {
match input {
c(T2 {x: a(m), _}, _) => { return m; }
c(T2 {x: b(m), y: y}, z) => { return ((m + z) as int) + y; }
}