Finishes a `{}` set after the first element; mirrors `dict_tail` with `SetUpdate`/`SetAdd` and `BuildSet`. */
(&mut self, mut count: u16, mut incremental: bool)
| 117 | |
| 118 | /* Finishes a `{}` set after the first element; mirrors `dict_tail` with `SetUpdate`/`SetAdd` and `BuildSet`. */ |
| 119 | fn set_tail(&mut self, mut count: u16, mut incremental: bool) { |
| 120 | while self.eat_if(TokenType::Comma) { |
| 121 | if matches!(self.peek(), Some(TokenType::Rbrace)) { break; } |
| 122 | if self.eat_if(TokenType::Star) { |
| 123 | if !incremental { self.chunk.emit(OpCode::BuildSet, count); incremental = true; } |
| 124 | self.expr(); |
| 125 | self.chunk.emit(OpCode::SetUpdate, 0); |
| 126 | } else { |
| 127 | self.expr(); |
| 128 | if incremental { self.chunk.emit(OpCode::SetAdd, 0); } else { count += 1; } |
| 129 | } |
| 130 | } |
| 131 | self.eat(TokenType::Rbrace); |
| 132 | if !incremental { self.chunk.emit(OpCode::BuildSet, count); } |
| 133 | } |
| 134 | |
| 135 | /* Finishes a `[]` list after the first element; mirrors `dict_tail` with `ListExtend`/`ListAppend` and `BuildList`. */ |
| 136 | fn list_tail(&mut self, mut count: u16, mut incremental: bool) { |
no test coverage detected