Name expression This refers to a local name, global name or a module.
| 2424 | |
| 2425 | |
| 2426 | class NameExpr(RefExpr): |
| 2427 | """Name expression |
| 2428 | |
| 2429 | This refers to a local name, global name or a module. |
| 2430 | """ |
| 2431 | |
| 2432 | __slots__ = ("name", "is_special_form") |
| 2433 | |
| 2434 | __match_args__ = ("name", "node") |
| 2435 | |
| 2436 | def __init__(self, name: str) -> None: |
| 2437 | super().__init__() |
| 2438 | self.name = name # Name referred to |
| 2439 | # Is this a l.h.s. of a special form assignment like typed dict or type variable? |
| 2440 | self.is_special_form = False |
| 2441 | |
| 2442 | def accept(self, visitor: ExpressionVisitor[T]) -> T: |
| 2443 | return visitor.visit_name_expr(self) |
| 2444 | |
| 2445 | def serialize(self) -> JsonDict: |
| 2446 | assert False, f"Serializing NameExpr: {self}" |
| 2447 | |
| 2448 | |
| 2449 | class MemberExpr(RefExpr): |
no outgoing calls
searching dependent graphs…