ogma
ogma copied to clipboard
[TASK] Rework how inline nested defs are detected
Goal
Currently, defs are detected at the parsing stage, using the known defs list. With the introduction of partitions and lazy parsing of those partitions, this quickly becomes tricky to determine which def needs to get parsed first.
A more structured approach to the parsing may be required, one which scans the partition tree first, setting up pointers to potential defs (fairly easy with the def
keyword).
Ultimately, thought needs to go into how much of the partition tree needs to be fully parsed and memoised. I would prefer a lazy approach which only parses the referenced defs, with some caching to avoid continually hitting the disk.