language: today, we killed lambdas

This commit is contained in:
2023-09-05 19:37:23 -07:00
parent 073ea09b13
commit ddff6cb365
12 changed files with 5 additions and 171 deletions

View File

@ -8,11 +8,14 @@ import gay.pizza.pork.parser.TokenStreamSource
import gay.pizza.pork.parser.Tokenizer
class World(val contentSource: ContentSource) {
private val units = mutableMapOf<String, CompilationUnit>()
private val internalUnits = mutableMapOf<String, CompilationUnit>()
val units: List<CompilationUnit>
get() = internalUnits.values.toList()
private fun loadOneUnit(path: String): CompilationUnit {
val stableIdentity = contentSource.stableContentIdentity(path)
val cached = units[stableIdentity]
val cached = internalUnits[stableIdentity]
if (cached != null) {
return cached
}