mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
ffi: new native function format
This commit is contained in:
@ -300,8 +300,8 @@ types:
|
||||
values:
|
||||
- name: form
|
||||
type: Symbol
|
||||
- name: definition
|
||||
type: StringLiteral
|
||||
- name: definitions
|
||||
type: List<StringLiteral>
|
||||
IndexedBy:
|
||||
parent: Expression
|
||||
values:
|
||||
|
@ -6,23 +6,23 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@SerialName("native")
|
||||
class Native(val form: Symbol, val definition: StringLiteral) : Node() {
|
||||
class Native(val form: Symbol, val definitions: List<StringLiteral>) : Node() {
|
||||
override val type: NodeType = NodeType.Native
|
||||
|
||||
override fun <T> visitChildren(visitor: NodeVisitor<T>): List<T> =
|
||||
visitor.visitNodes(form, definition)
|
||||
visitor.visitAll(listOf(form), definitions)
|
||||
|
||||
override fun <T> visit(visitor: NodeVisitor<T>): T =
|
||||
visitor.visitNative(this)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is Native) return false
|
||||
return other.form == form && other.definition == definition
|
||||
return other.form == form && other.definitions == definitions
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = form.hashCode()
|
||||
result = 31 * result + definition.hashCode()
|
||||
result = 31 * result + definitions.hashCode()
|
||||
result = 31 * result + type.hashCode()
|
||||
return result
|
||||
}
|
||||
|
Reference in New Issue
Block a user