mirror of https://github.com/tbklang/tlang.git
⚡ Feature: Pluggable predicate-based resolution method #166
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: 2 hours 6 minutes
Due Date
deavmi
2 hours 6 minutes
Blocks
#157 ⚡ Feature: Multi-module support
tlang/tlang
Reference: tlang/tlang#166
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?
Purpose ✍️
The purpose of this is to re-work many of the methods within the
Resolver
such that they can be parameterised by aPredicate
when doing searches. This predicate will be used to match against whether something is found or not found.We would then make every existing search method basically be a predicate-custom call to these few base methods.
Todo 🏁
resolveWithin(..., ...)
resolveUp(..., ...)
resolveBest(..., ...)⚡ Feature: Pluggable predicate-nased resolution methodto ⚡ Feature: Pluggable predicate-based resolution methodWorking on this now...
feature/multi_moduleto feature/predicate_based_resolverFrom BNET's
#programming
:I may as well add the access modifier function I want now as it would be a good test for the searching that I want to do.
It wuld effcievtly be something whereby I give it some
Container
and then a predicate which disregards any non-Function
and then only returns those with an access modifier of my choice.Got this all coded up now.
Working on documentation now.
Resolver
resolveWithin(...)
which now takes in aPredicate!(Entity)
instead of a name and then uses that as the final matching step when iterating over the givenContainer
'sStatement[]
(the container's immediate body)derive_nameMatch(string name)
which returns aPredicate!(Entity)
closure which matches based on namesresolveWithin(Container, string)
to make use of these above two changesresolveUp(...)
, of which there is now a version available asresolveUp(Container, Predicate!(Entity))
resolveBest(Container c, Predicate!(Entity) d)
added but not implemented yetSearchCtx
andfindFrom!(...)(...)
respectivelyderive_functionAccMod(AccessorType)
(this is to be moved intoDGen
as that is where it is needed)All tests pass (local and CI/CD ✅ )
I will merge this once I can figure out that last part, the one of
resolveBest(Container, strng)
which I may very well keep as s and change maybe later. The main thing I required was basicallyresolveWithin(Container, Predicate!(Entity))
because now I can do a hritntal search forFunction
(s) and find those with a given access mdifier.Documented and cleaned up
Remaining thing is
resolveBest(...)
. I would really like to get that done in a generic fashion.Not doing
resolveBest(..., ...)
maybe at a later stage.Testing now.... then will merge
Need to clean up actually
Done
All good local and CI/CD ✅
Merging...
Merged ✅