Skip to content

Commit

Permalink
Use unsigned number types
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Dec 18, 2024
1 parent 83566cb commit 779418e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions buildSrc/src/main/kotlin/karakum/browser/IDL.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,11 @@ internal object IDLRegistry {
.removePrefix("unrestricted ")
.substringBefore(" = ")

var type = getNumberType(data.substringBeforeLast(" ").removeSuffix("?"))
val type = getNumberType(data.substringBeforeLast(" ").removeSuffix("?"))
?: return emptySequence()

val name = data.substringAfterLast(" ")

// TEMP
if ((name == "length" || name == "size") && type == "UInt")
type = "Int"

return sequenceOf(
PropertyData(
className = className,
Expand All @@ -200,15 +196,10 @@ internal object IDLRegistry {
.map { it.substringAfter("] ") }
.map { it.removePrefix("optional ") }
.mapNotNull { psource ->
var type = getNumberType(psource.substringBeforeLast(" ").removeSuffix("?"))
val type = getNumberType(psource.substringBeforeLast(" ").removeSuffix("?"))
?: return@mapNotNull null

val name = psource.substringAfterLast(" ")

// TEMP
if (name == "index" && type == "UInt")
type = "Int"

ParameterData(
className = className,
methodName = methodName,
Expand Down

0 comments on commit 779418e

Please sign in to comment.