JS IDL2K spaces in functional types
This commit is contained in:
committed by
Sergey Mashkov
parent
b34da5713d
commit
002b26e4ed
@@ -290,7 +290,7 @@ native public open class Document : Node {
|
|||||||
var onended: ((Event) -> dynamic)?
|
var onended: ((Event) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onerror: ((dynamic,dynamic,String,Int,Int,dynamic) -> dynamic)?
|
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onfocus: ((Event) -> dynamic)?
|
var onfocus: ((Event) -> dynamic)?
|
||||||
@@ -623,7 +623,7 @@ native public trait HTMLElement : Element {
|
|||||||
var onended: ((Event) -> dynamic)?
|
var onended: ((Event) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onerror: ((dynamic,dynamic,String,Int,Int,dynamic) -> dynamic)?
|
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onfocus: ((Event) -> dynamic)?
|
var onfocus: ((Event) -> dynamic)?
|
||||||
@@ -3170,7 +3170,7 @@ native public trait Window : EventTarget {
|
|||||||
var onended: ((Event) -> dynamic)?
|
var onended: ((Event) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onerror: ((dynamic,dynamic,String,Int,Int,dynamic) -> dynamic)?
|
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onfocus: ((Event) -> dynamic)?
|
var onfocus: ((Event) -> dynamic)?
|
||||||
@@ -3796,7 +3796,7 @@ native public trait WorkerGlobalScope : EventTarget {
|
|||||||
var location: WorkerLocation
|
var location: WorkerLocation
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onerror: ((dynamic,dynamic,String,Int,Int,dynamic) -> dynamic)?
|
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
var onlanguagechange: ((Event) -> dynamic)?
|
var onlanguagechange: ((Event) -> dynamic)?
|
||||||
@@ -4279,7 +4279,7 @@ native public trait HTMLCollection : UnionElementOrHTMLCollection {
|
|||||||
nativeGetter fun get(name: String): Element? = noImpl
|
nativeGetter fun get(name: String): Element? = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
native public open class MutationObserver(callback: (Array<MutationRecord>,MutationObserver) -> Unit) {
|
native public open class MutationObserver(callback: (Array<MutationRecord>, MutationObserver) -> Unit) {
|
||||||
fun observe(target: Node, options: MutationObserverInit): Unit = noImpl
|
fun observe(target: Node, options: MutationObserverInit): Unit = noImpl
|
||||||
fun disconnect(): Unit = noImpl
|
fun disconnect(): Unit = noImpl
|
||||||
fun takeRecords(): Array<MutationRecord> = noImpl
|
fun takeRecords(): Array<MutationRecord> = noImpl
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ fun generateFunctions(repository: Repository, function: Operation): List<Generat
|
|||||||
it.copy(type = callbackFunction.parameters
|
it.copy(type = callbackFunction.parameters
|
||||||
.map { it.copy(type = mapType(repository, it.type)) }
|
.map { it.copy(type = mapType(repository, it.type)) }
|
||||||
.map { it.formatFunctionTypePart() }
|
.map { it.formatFunctionTypePart() }
|
||||||
.join(",", "(", ") -> ${mapType(repository, callbackFunction.returnType)}")
|
.join(", ", "(", ") -> ${mapType(repository, callbackFunction.returnType)}")
|
||||||
.copyNullabilityFrom(it.type))
|
.copyNullabilityFrom(it.type))
|
||||||
}
|
}
|
||||||
else -> it
|
else -> it
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ class DefinitionVisitor(val extendedAttributes: List<ExtendedAttribute>, val nam
|
|||||||
name = getName(ctx)
|
name = getName(ctx)
|
||||||
|
|
||||||
val function = OperationVisitor(memberAttributes.toList()).visit(ctx)
|
val function = OperationVisitor(memberAttributes.toList()).visit(ctx)
|
||||||
typedefType = "(${function.parameters.map { it.formatFunctionTypePart() }.join(",")}) -> ${function.returnType}"
|
typedefType = "(${function.parameters.map { it.formatFunctionTypePart() }.join(", ")}) -> ${function.returnType}"
|
||||||
|
|
||||||
memberAttributes.clear()
|
memberAttributes.clear()
|
||||||
return defaultResult()
|
return defaultResult()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ data class FunctionType(val parameterTypes : List<Attribute>, val returnType : S
|
|||||||
val FunctionType.arity : Int
|
val FunctionType.arity : Int
|
||||||
get() = parameterTypes.size()
|
get() = parameterTypes.size()
|
||||||
val FunctionType.text : String
|
val FunctionType.text : String
|
||||||
get() = "(${parameterTypes.map { it.formatFunctionTypePart() }.join(",")}) -> ${returnType}"
|
get() = "(${parameterTypes.map { it.formatFunctionTypePart() }.join(", ")}) -> ${returnType}"
|
||||||
|
|
||||||
fun FunctionType(text : String) : FunctionType {
|
fun FunctionType(text : String) : FunctionType {
|
||||||
val (parameters, returnType) = text.split("->".toRegex()).map { it.trim() }.filter { it != "" }
|
val (parameters, returnType) = text.split("->".toRegex()).map { it.trim() }.filter { it != "" }
|
||||||
|
|||||||
Reference in New Issue
Block a user