mirror of
				https://github.com/GayPizzaSpecifications/pork.git
				synced 2025-11-04 09:59:39 +00:00 
			
		
		
		
	IR WIP
This commit is contained in:
		@ -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
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user