[#475] Rename stack cell on complex instruction
requested to merge heitor.toledo/#475-rename-the-topmost-stack-cell-for-some-complex-instructions into master
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:
- 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. - There is a corner case: some macros such as
IF_RIGHT
andIF_SOME
do not produce snapshots when needed, and the variable doesn't get renamed. Patch the typechecker so that extraNop
s are disregarded and patch the interpreter so thatNested
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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Heitor Toledo Lassarote de Paula