MCPcopy Create free account
hub / github.com/astral-sh/ruff / check_identifier

Method check_identifier

crates/ruff_python_parser/src/semantic_errors.rs:682–690  ·  view source on GitHub ↗

Check if `ident` is equal to `__debug__` and emit a [`SemanticSyntaxErrorKind::WriteToDebug`] if so.

(ident: &ast::Identifier, ctx: &Ctx)

Source from the content-addressed store, hash-verified

680 /// Check if `ident` is equal to `__debug__` and emit a
681 /// [`SemanticSyntaxErrorKind::WriteToDebug`] if so.
682 fn check_identifier<Ctx: SemanticSyntaxContext>(ident: &ast::Identifier, ctx: &Ctx) {
683 if ident.id == "__debug__" {
684 Self::add_error(
685 ctx,
686 SemanticSyntaxErrorKind::WriteToDebug(WriteToDebugKind::Store),
687 ident.range,
688 );
689 }
690 }
691
692 fn duplicate_type_parameter_name<Ctx: SemanticSyntaxContext>(
693 type_params: &ast::TypeParams,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected