Expression assignment evaluation for TVMScript parser. Parameters ---------- parser : Parser The parser bound with the evaluator. target : doc.expr The root node of AST tree node of assigned expression to evaluate. source : Any The source to be assigned
(
parser: "Parser",
target: doc.expr,
source: Any,
)
| 469 | |
| 470 | |
| 471 | def eval_assign( |
| 472 | parser: "Parser", |
| 473 | target: doc.expr, |
| 474 | source: Any, |
| 475 | ) -> dict[str, Any]: |
| 476 | """Expression assignment evaluation for TVMScript parser. |
| 477 | |
| 478 | Parameters |
| 479 | ---------- |
| 480 | parser : Parser |
| 481 | The parser bound with the evaluator. |
| 482 | |
| 483 | target : doc.expr |
| 484 | The root node of AST tree node of assigned expression to evaluate. |
| 485 | |
| 486 | source : Any |
| 487 | The source to be assigned with evaluated expression. |
| 488 | |
| 489 | Returns |
| 490 | ------- |
| 491 | res : Any |
| 492 | The evaluation result. |
| 493 | """ |
| 494 | try: |
| 495 | return _eval_assign(target, source) |
| 496 | except Exception as err: # pylint: disable=broad-except |
| 497 | parser.report_error(target, err) |
| 498 | raise |
| 499 | |
| 500 | |
| 501 | def _eval_expr( |
no test coverage detected
searching dependent graphs…