mirror of https://github.com/tbklang/tlang.git
Make preLoopStatement
a part of the for-loops body #78
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
Blocks
#74 for loops
tlang/tlang
Reference: tlang/tlang#78
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to be able to lookup any definitions made in it, such that if we have a for loop such as:
We can properly resolve
idx
. I guess it is fine if we effectively make it the first statement of the body. We will, of course need to manage that such that we don't place it in the body when doing code-emit for example. Because then we will generate C code which repeatedly pushes and pops from stack when it should only push once, loop and then pop when the for loop goes out of scope (i.e. we finish all iterations of the for loop). This can be accomplished by assuming there is always one body instruction and then in codegen we alwaystailPop()
it, reverse and take the first and embed it correctly.Todo
Solution ✅
ForLoop
parser node.Branch
's body (which (theBranch
) is in turn a part of the ody of theForLoop
).We have sorted this out with the above solution!