Add an identifier to the set of visited names in `self` and emit a [`SemanticSyntaxError`] if `ident` has already been seen.
(&mut self, ident: &'a ast::Identifier)
| 2412 | /// Add an identifier to the set of visited names in `self` and emit a [`SemanticSyntaxError`] |
| 2413 | /// if `ident` has already been seen. |
| 2414 | fn insert(&mut self, ident: &'a ast::Identifier) { |
| 2415 | if !self.names.insert(&ident.id) { |
| 2416 | SemanticSyntaxChecker::add_error( |
| 2417 | self.ctx, |
| 2418 | SemanticSyntaxErrorKind::MultipleCaseAssignment(ident.id.clone()), |
| 2419 | ident.range(), |
| 2420 | ); |
| 2421 | } |
| 2422 | // test_err debug_shadow_match |
| 2423 | // match x: |
| 2424 | // case __debug__: ... |
| 2425 | SemanticSyntaxChecker::check_identifier(ident, self.ctx); |
| 2426 | } |
| 2427 | } |
| 2428 | |
| 2429 | struct InvalidExpressionVisitor<'a, Ctx> { |