Clean up
This commit is contained in:
parent
2eff51815a
commit
80bf09d807
@ -157,13 +157,8 @@ impl<'src> Parser<'src> {
|
||||
|
||||
end
|
||||
} else {
|
||||
return Err(ParseError::ExpectedToken {
|
||||
expected: TokenKind::Semicolon,
|
||||
actual: self.current_token.to_owned(),
|
||||
position: self.current_position,
|
||||
});
|
||||
value.position().1
|
||||
};
|
||||
|
||||
let r#let = if is_mutable {
|
||||
LetStatement::LetMut { identifier, value }
|
||||
} else {
|
||||
|
@ -1,8 +1,8 @@
|
||||
let mut count = 1;
|
||||
let mut count = 1
|
||||
|
||||
while count <= 15 {
|
||||
let divides_by_3 = count % 3 == 0;
|
||||
let divides_by_5 = count % 5 == 0;
|
||||
let divides_by_3 = count % 3 == 0
|
||||
let divides_by_5 = count % 5 == 0
|
||||
|
||||
let output = if divides_by_3 && divides_by_5 {
|
||||
"fizzbuzz"
|
||||
@ -12,7 +12,7 @@ while count <= 15 {
|
||||
"buzz"
|
||||
} else {
|
||||
count.to_string()
|
||||
};
|
||||
}
|
||||
|
||||
write_line(output)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
io.write_line("Guess the number.")
|
||||
write_line("Guess the number.")
|
||||
|
||||
secret_number = int.random_range(0..100)
|
||||
let secret_number = random(0..100);
|
||||
|
||||
loop {
|
||||
io.write_line("Input your guess.")
|
||||
write_line("Input your guess.")
|
||||
|
||||
input = io.read_line()
|
||||
guess = int.parse(input)
|
||||
let input = io.read_line();
|
||||
let guess = int.parse(input);
|
||||
|
||||
if guess < secret_number {
|
||||
io.write_line("Too low!")
|
||||
|
@ -1,6 +1,6 @@
|
||||
write_line("Hello, world!")
|
||||
write_line("Enter your name...")
|
||||
|
||||
let name = read_line();
|
||||
let name = read_line()
|
||||
|
||||
write_line("Hello " + name + "!")
|
||||
|
Loading…
Reference in New Issue
Block a user