Skip to content

[#475] Rename stack cell on complex instruction

Description

Problem: It would make the experience more intuitive if cells got renamed according to the complex instruction that it is executing, if the instruction produces some element on the stack.

Solution: This consists in two parts:

  1. Change the debugger so that a snapshot stores what kind of instruction it produced, whether it should be named or not, and add an appropriate name if needed. Change issFullStack so that it appropriately records the index of the cell which should be named (for cases like DIP, where it doesn't make sense to simply rename the topmost element). Change variables so that it appropriately replaces such cell with the given name, if present.
  2. There is a corner case: some macros such as IF_RIGHT and IF_SOME do not produce snapshots when needed, and the variable doesn't get renamed. Patch the typechecker so that extra Nops are disregarded and patch the interpreter so that Nested instructions are taken into account.

Related issue(s)

Resolves #475 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Heitor Toledo Lassarote de Paula

Merge request reports