Files
pork/ast/src/main/kotlin/gay/pizza/pork/ast/FunctionDefinition.kt

33 lines
1.2 KiB
Kotlin
Raw Normal View History

// GENERATED CODE FROM PORK AST CODEGEN
package gay.pizza.pork.ast
2023-09-02 20:22:08 -07:00
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
2023-09-02 23:28:40 -07:00
@SerialName("functionDefinition")
class FunctionDefinition(override val modifiers: DefinitionModifiers, override val symbol: Symbol, val arguments: List<ArgumentSpec>, val block: Block?, val native: Native?) : Definition() {
2023-09-04 03:09:09 -07:00
override val type: NodeType = NodeType.FunctionDefinition
2023-09-02 20:22:08 -07:00
override fun <T> visitChildren(visitor: NodeVisitor<T>): List<T> =
visitor.visitAll(listOf(symbol), listOf(block), listOf(native))
2023-09-02 20:22:08 -07:00
override fun <T> visit(visitor: NodeVisitor<T>): T =
visitor.visitFunctionDefinition(this)
2023-09-02 20:22:08 -07:00
override fun equals(other: Any?): Boolean {
2023-09-02 23:28:40 -07:00
if (other !is FunctionDefinition) return false
return other.modifiers == modifiers && other.symbol == symbol && other.arguments == arguments && other.block == block && other.native == native
2023-09-02 20:22:08 -07:00
}
override fun hashCode(): Int {
2023-09-04 21:50:27 -07:00
var result = modifiers.hashCode()
result = 31 * result + symbol.hashCode()
2023-09-02 20:22:08 -07:00
result = 31 * result + arguments.hashCode()
result = 31 * result + block.hashCode()
result = 31 * result + native.hashCode()
2023-09-02 23:28:40 -07:00
result = 31 * result + type.hashCode()
2023-09-02 20:22:08 -07:00
return result
}
}