bytecode: enhance symbol table with both slab and symbol name

This commit is contained in:
2023-11-21 23:27:21 -08:00
parent 6211ad4ff1
commit 76290a401a
9 changed files with 20 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import gay.pizza.pork.ast.gen.FunctionDefinition
import gay.pizza.pork.execution.ArgumentList
class FunctionContext(val slabContext: SlabContext, val node: FunctionDefinition) : CallableFunction {
val name: String by lazy { "${slabContext.slab.location.commonFriendlyName} ${node.symbol.id}" }
val name: String by lazy { "${slabContext.slab.location.commonLocationIdentity} ${node.symbol.id}" }
private fun resolveMaybeNative(): CallableFunction? = if (node.nativeFunctionDescriptor == null) {
null

View File

@ -7,8 +7,8 @@ import gay.pizza.pork.ast.gen.visit
import gay.pizza.pork.frontend.Slab
class SlabContext(val slab: Slab, val evaluator: Evaluator, rootScope: Scope) {
val internalScope = rootScope.fork("internal ${slab.location.commonFriendlyName}")
val externalScope = rootScope.fork("external ${slab.location.commonFriendlyName}")
val internalScope = rootScope.fork("internal ${slab.location.commonLocationIdentity}")
val externalScope = rootScope.fork("external ${slab.location.commonLocationIdentity}")
init {
processAllDefinitions()