uid / snapdown

Draw snapshot diagrams with plain text
MIT License
3 stars 0 forks source link

Multi-step diagrams with variable stack #43

Open dwhatley19 opened 3 years ago

dwhatley19 commented 3 years ago

Possible syntax:

main() {
a -> 2
}
---
higherInStack() {
b -> 3
}

Step 2 of this diagram should look equivalent to: http://web.mit.edu/dwhatley/www/snapdown/web/production.html#higherInStack()%20%7B%0Ab%20-%3E%203%0A%7D%0Amain()%20%7B%0Aa%20-%3E%202%0A%7D

This might be unintuitive, though. In the multi-step version, the stack frames look to be introduced in "reverse" order that they are presented in the final diagram. Need a way to resolve.

Proposed syntax for removing stack frames:

main() {
a -> 2
}
---
higherInStack() {
b -> 3
}
---
higherInStack() returns