diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-01 10:40:02 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-01 10:40:02 +0100 |
| commit | 58a41961dccf08171eba6aeb7f16f0a7f5750d14 (patch) | |
| tree | 689870144e363bf0b39ec2d92323ecfbc326704c /src/compiler.rs | |
| parent | 0499cbf559fee79ec895dbbe30b9fed5962426ff (diff) | |
| download | sylt-58a41961dccf08171eba6aeb7f16f0a7f5750d14.tar.gz | |
simplify try_tuple from feedback
Diffstat (limited to 'src/compiler.rs')
| -rw-r--r-- | src/compiler.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index 0ddae1a..f4bec9a 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -358,14 +358,11 @@ impl Compiler { _ => { self.expression(block); num_args += 1; - if self.peek() == Token::Comma { - self.eat(); - continue; - } - if self.peek() == Token::RightParen { - continue; + match self.peek() { + Token::Comma => { self.eat(); }, + Token::RightParen => {}, + _ => { return Err(()); }, } - return Err(()); } } } |
