build(generator): make evaluatedValue to be an Int instead of String
This commit is contained in:
1 parent
746c4887b8
commit
6ee9625e3f
11 files changed
+1554
-1556
No files matched your search
@@ -115,7 +115,7 @@ data class AstEnumConstantDecl(
|
||||
val qualType: String = "",
|
||||
val order: Int = -1,
|
||||
val value: String? = null,
|
||||
val evaluatedValue: String? = null,
|
||||
val evaluatedValue: Int? = null,
|
||||
) : Decl
|
||||
|
||||
data class AstRecordDecl(
|
||||
|
||||
@@ -314,7 +314,7 @@ open class GenerateAst : DefaultTask() {
|
||||
decl.qualType,
|
||||
order++,
|
||||
decl.value,
|
||||
lookupEnumEvaluatedValue0(enumDecls, idx).toString(),
|
||||
lookupEnumEvaluatedValue0(enumDecls, idx),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ open class GenerateAst : DefaultTask() {
|
||||
// We provide a proper order in EnumDecl, after sorting all enums by their offset.
|
||||
-1,
|
||||
declValue,
|
||||
evaluatedValue.toString()
|
||||
evaluatedValue
|
||||
)
|
||||
}
|
||||
|
||||
@@ -431,9 +431,7 @@ open class GenerateAst : DefaultTask() {
|
||||
val decl = decls[idx]
|
||||
|
||||
if (decl.evaluatedValue != null) {
|
||||
decl.evaluatedValue.toIntOrNull()?.let {
|
||||
return it
|
||||
}
|
||||
return decl.evaluatedValue
|
||||
}
|
||||
|
||||
if (decl.value != null) {
|
||||
|
||||
Reference in new issue
Block a user