mirror of https://github.com/tbklang/tlang.git
Dependency linearization clean up #41
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 5 hours 23 minutes
Due Date
deavmi
5 hours 23 minutes
Reference: tlang/tlang#41
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?
Calling
print()
will linearize and print a tree whilst doing so, returned as a string from this function. However, it adds to a static field the linearized (DFS searched items), this is thestatic DNode[] poes
list.Problem 1
Calling
tree()
again on the same DNode would technically double this list.Problem 2
Problem 3
public static DNode[] poes
but rather via agetLinearized()
.Problem 4 (not a problem)
This is not really a problem but may be nice.
isVisited
before lineairizng, and use that instead ofisCompleted
Problem 5
Why do we have,
isDone()
again?And is defined as:
Mmmh.... Wait, maybe it decycled things? No surely that is what the
if(!dependancy.isCompleted())
in the for-loop does.Problem 6
DependencyException
when there are any misuses of these functionsI think, for Problem 2, we should have a
linearize()
that then caches (so oneshot execute).Whilst it does this it generates tree and caches, therefore calling (Problem 1)
tree()
will return cached tree generation.I'm going to look at this this afternoon.
Made a new branch for this
linearizer_cleanup
vardec_varass_dependencyto linearizer_cleanupSolutions (so far) ✅
Problem 1
This has been sorted out with a
hasLinearized
check, so caching is enabled. As of commit68e1a25c9a162f4cf6b25278db7bc2cb88f76996
on the branch of this issue.Problem 2
This has been sorted out with our
performLinearization()
,getLinearizedNodes()
andgetTree()
methods. As of commit68e1a25c9a162f4cf6b25278db7bc2cb88f76996
on the branch of this issue.Problem 3
We have removed all references to
static DNode[] poes
in theDNode
class. As of commit68e1a25c9a162f4cf6b25278db7bc2cb88f76996
on the branch of this issue.Merged the fixes for Problem 1, 2 and 3 to
varass_vardec_dependency
✅Problem 6 has been solved with commit
57ebd443b0f0517ad474d004d6e31ae01a3eff02
ov the branch of this issue.Merged the fixes for Problem 6 to
varass_vardec_dependency
✅Thinking 🤔
I think
nodePool
must remainstatic
as this is how severalDNodeGenerator
instances pool a variable processed in the module pass (with a seperate DNodeGenerator) and know it has been visited (i.e. declared and all), because thisstatic DNode[] nodePool
is same place in memory across instances ofDNodeGenerator
as it isstatic
.There isn't anything bad about this, we could - for memory leaking reasons - clear it after each compilation however.
I find this retarded, perhaps each
DNodeGenerator
must be provided with somePoolManager
or something, and passed in. That is the neatest to me, in my opinion.See #161
Also #162
Is this done or not?
According to github, yes: https://github.com/tbklang/tlang/compare/vardec_varass_dependency...linearizer_cleanup?expand=1