(
&self,
name: &str,
context: ExpressionContext,
range: TextRange,
)
| 2549 | } |
| 2550 | |
| 2551 | fn check_name( |
| 2552 | &self, |
| 2553 | name: &str, |
| 2554 | context: ExpressionContext, |
| 2555 | range: TextRange, |
| 2556 | ) -> SymbolTableResult { |
| 2557 | if name == "__debug__" { |
| 2558 | let location = Some( |
| 2559 | self.source_file |
| 2560 | .to_source_code() |
| 2561 | .source_location(range.start(), PositionEncoding::Utf8), |
| 2562 | ); |
| 2563 | match context { |
| 2564 | ExpressionContext::Store | ExpressionContext::Iter => { |
| 2565 | return Err(SymbolTableError { |
| 2566 | error: "cannot assign to __debug__".to_owned(), |
| 2567 | location, |
| 2568 | }); |
| 2569 | } |
| 2570 | ExpressionContext::Delete => { |
| 2571 | return Err(SymbolTableError { |
| 2572 | error: "cannot delete __debug__".to_owned(), |
| 2573 | location, |
| 2574 | }); |
| 2575 | } |
| 2576 | _ => {} |
| 2577 | } |
| 2578 | } |
| 2579 | Ok(()) |
| 2580 | } |
| 2581 | |
| 2582 | fn register_name( |
| 2583 | &mut self, |
no test coverage detected