JS IDL2K spaces in functional types
This commit is contained in:
committed by
Sergey Mashkov
parent
b34da5713d
commit
002b26e4ed
@@ -67,7 +67,7 @@ fun generateFunctions(repository: Repository, function: Operation): List<Generat
|
||||
it.copy(type = callbackFunction.parameters
|
||||
.map { it.copy(type = mapType(repository, it.type)) }
|
||||
.map { it.formatFunctionTypePart() }
|
||||
.join(",", "(", ") -> ${mapType(repository, callbackFunction.returnType)}")
|
||||
.join(", ", "(", ") -> ${mapType(repository, callbackFunction.returnType)}")
|
||||
.copyNullabilityFrom(it.type))
|
||||
}
|
||||
else -> it
|
||||
|
||||
@@ -290,7 +290,7 @@ class DefinitionVisitor(val extendedAttributes: List<ExtendedAttribute>, val nam
|
||||
name = getName(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()
|
||||
return defaultResult()
|
||||
|
||||
@@ -60,7 +60,7 @@ data class FunctionType(val parameterTypes : List<Attribute>, val returnType : S
|
||||
val FunctionType.arity : Int
|
||||
get() = parameterTypes.size()
|
||||
val FunctionType.text : String
|
||||
get() = "(${parameterTypes.map { it.formatFunctionTypePart() }.join(",")}) -> ${returnType}"
|
||||
get() = "(${parameterTypes.map { it.formatFunctionTypePart() }.join(", ")}) -> ${returnType}"
|
||||
|
||||
fun FunctionType(text : String) : FunctionType {
|
||||
val (parameters, returnType) = text.split("->".toRegex()).map { it.trim() }.filter { it != "" }
|
||||
|
||||
Reference in New Issue
Block a user