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

Method check_identifier

crates/ruff_python_parser/src/semantic_errors.rs:692–700  ·  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

690 /// Check if `ident` is equal to `__debug__` and emit a
691 /// [`SemanticSyntaxErrorKind::WriteToDebug`] if so.
692 fn check_identifier<Ctx: SemanticSyntaxContext>(ident: &ast::Identifier, ctx: &Ctx) {
693 if ident.id == "__debug__" {
694 Self::add_error(
695 ctx,
696 SemanticSyntaxErrorKind::WriteToDebug(WriteToDebugKind::Store),
697 ident.range,
698 );
699 }
700 }
701
702 fn duplicate_type_parameter_name<Ctx: SemanticSyntaxContext>(
703 type_params: &ast::TypeParams,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected