WIP on IR

This commit is contained in:
alex committed 2023-11-22 07:23:33 -08:00
1 parent 76290a401a
commit 2d88666f05
35 files changed
+532

No files matched your search

@@ -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
}
}
@@ -0,0 +1,6 @@
package gay.pizza.pork.frontend.scope
enum class SymbolType {
Variable,
Function
}