WIP on IR

This commit is contained in:
2023-11-22 07:23:33 -08:00
parent 76290a401a
commit 2d88666f05
35 changed files with 532 additions and 0 deletions

View File

@ -6,4 +6,16 @@ import gay.pizza.pork.ast.gen.Symbol
class ScopeSymbol(val slabScope: SlabScope, val definition: Definition) {
val symbol: Symbol = definition.symbol
val scope: DefinitionScope by lazy { DefinitionScope(slabScope, definition) }
override fun equals(other: Any?): Boolean {
if (other !is ScopeSymbol) return false
return other.slabScope.slab == slabScope.slab && other.symbol == symbol
}
override fun hashCode(): Int {
var result = slabScope.hashCode()
result = 31 * result + definition.hashCode()
result = 31 * result + symbol.hashCode()
return result
}
}

View File

@ -0,0 +1,6 @@
package gay.pizza.pork.frontend.scope
enum class SymbolType {
Variable,
Function
}