It is useful mainly for updating the comment of the expression.
parameters:
expr:
type: NamedExpr
Source code in packages/astx/src/astx/symbol_table.py
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 | def update(self, expr: NamedExpr) -> None:
"""
title: Update the expression on the SymbolTable.
summary: |-
It is useful mainly for updating the comment of the expression.
parameters:
expr:
type: NamedExpr
"""
if not self.scopes.current:
raise Exception("SymbolTable: No scope active.")
if expr.name not in self.scopes.current.named_expr:
raise Exception("This name doesn't exist in the SymbolTable.")
self.scopes.current.named_expr[expr.name] = expr
|