Convert a symbol name to a HoleValue and a symbol name. Some symbols (starting with "_JIT_") are special and are converted to their own HoleValues.
(symbol: str)
| 398 | |
| 399 | |
| 400 | def symbol_to_value(symbol: str) -> tuple[HoleValue, str | None]: |
| 401 | """ |
| 402 | Convert a symbol name to a HoleValue and a symbol name. |
| 403 | |
| 404 | Some symbols (starting with "_JIT_") are special and are converted to their |
| 405 | own HoleValues. |
| 406 | """ |
| 407 | if symbol.startswith("_JIT_"): |
| 408 | try: |
| 409 | return HoleValue[symbol.removeprefix("_JIT_")], None |
| 410 | except KeyError: |
| 411 | pass |
| 412 | return HoleValue.ZERO, symbol |
| 413 | |
| 414 | |
| 415 | def _signed(value: int) -> int: |
no test coverage detected
searching dependent graphs…