8e585e7008
(The old syntax is still supported as well, for now.) It is now possible to leave out the parens around if, while, and do/while conditions, and around alt expressions. Cases in an alt block can now leave off the case keyword and parens around the pattern. After the next snapshot, we can start migrating our code to use the new alt syntax, probably with a pretty-printer pass. The paren-free syntax will remain optional (you may always parenthesize expressions), but the old case syntax will no longer be supported in the future.
11 lines
181 B
Rust
11 lines
181 B
Rust
fn main() {
|
|
auto x = true;
|
|
if x {
|
|
auto i = 10;
|
|
while i > 0 { i -= 1; }
|
|
}
|
|
alt x {
|
|
true { log "right"; }
|
|
false { log "wrong"; }
|
|
}
|
|
} |