mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Update fizzbuzz.er
This commit is contained in:
parent
e74c9fa707
commit
36402a417e
2 changed files with 7 additions and 6 deletions
|
@ -469,7 +469,8 @@ impl Parser {
|
|||
}
|
||||
}
|
||||
}
|
||||
Some(t) if t.is(LSqBr) => {
|
||||
// x[...] (`x [...]` will interpreted as `x([...])`)
|
||||
Some(t) if t.is(LSqBr) && acc.col_end().unwrap() == t.col_begin().unwrap() => {
|
||||
self.skip();
|
||||
let index = self
|
||||
.try_reduce_expr(false, false)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
for! 1..<100, i =>
|
||||
match (i % 3, i % 5):
|
||||
(0, 0) => print! "FizzBuzz"
|
||||
(0, _) => print! "Fizz"
|
||||
(_, 0) => print! "Buzz"
|
||||
(_, _) => print! i
|
||||
match [i % 3, i % 5]:
|
||||
[0, 0] => print! "FizzBuzz"
|
||||
[0, _] => print! "Fizz"
|
||||
[_, 0] => print! "Buzz"
|
||||
[_, _] => print! i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue