Skip to content

Commit

Permalink
build(generator): make evaluatedValue to be an Int instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed Aug 11, 2024
1 parent 746c488 commit 6ee9625
Show file tree
Hide file tree
Showing 11 changed files with 1,554 additions and 1,556 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/tool/generator/ast/decl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ open class GenerateAst : DefaultTask() {
decl.qualType,
order++,
decl.value,
lookupEnumEvaluatedValue0(enumDecls, idx).toString(),
lookupEnumEvaluatedValue0(enumDecls, idx),
)
}

Expand Down Expand Up @@ -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
)
}

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,55 +803,55 @@
"qualType" : "IGFD_FileStyleFlags_",
"order" : 0,
"value" : "0",
"evaluatedValue" : "0"
"evaluatedValue" : 0
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByTypeFile",
"docComment" : "define style for all files",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 1,
"value" : "(1 << 0)",
"evaluatedValue" : "1"
"evaluatedValue" : 1
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByTypeDir",
"docComment" : "define style for all dir",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 2,
"value" : "(1 << 1)",
"evaluatedValue" : "2"
"evaluatedValue" : 2
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByTypeLink",
"docComment" : "define style for all link",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 3,
"value" : "(1 << 2)",
"evaluatedValue" : "4"
"evaluatedValue" : 4
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByExtention",
"docComment" : "define style by extention, for files or links",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 4,
"value" : "(1 << 3)",
"evaluatedValue" : "8"
"evaluatedValue" : 8
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByFullName",
"docComment" : "define style for particular file/dir/link full name (filename + extention)",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 5,
"value" : "(1 << 4)",
"evaluatedValue" : "16"
"evaluatedValue" : 16
}, {
"@type" : "AstEnumConstantDecl",
"name" : "IGFD_FileStyleByContainedInFullName",
"docComment" : "define style for file/dir/link when criteria is contained in full name",
"qualType" : "IGFD_FileStyleFlags_",
"order" : 6,
"value" : "(1 << 5)",
"evaluatedValue" : "32"
"evaluatedValue" : 32
} ]
}, {
"@type" : "AstEnumDecl",
Expand All @@ -862,62 +862,62 @@
"qualType" : "ImGuiFileDialogFlags_",
"order" : 0,
"value" : "0",
"evaluatedValue" : "0"
"evaluatedValue" : 0
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_ConfirmOverwrite",
"docComment" : "show confirm to overwrite dialog",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 1,
"value" : "(1 << 0)",
"evaluatedValue" : "1"
"evaluatedValue" : 1
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_DontShowHiddenFiles",
"docComment" : "dont show hidden file (file starting with a .)",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 2,
"value" : "(1 << 1)",
"evaluatedValue" : "2"
"evaluatedValue" : 2
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_DisableCreateDirectoryButton",
"docComment" : "disable the create directory button",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 3,
"value" : "(1 << 2)",
"evaluatedValue" : "4"
"evaluatedValue" : 4
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_HideColumnType",
"docComment" : "hide column file type",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 4,
"value" : "(1 << 3)",
"evaluatedValue" : "8"
"evaluatedValue" : 8
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_HideColumnSize",
"docComment" : "hide column file size",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 5,
"value" : "(1 << 4)",
"evaluatedValue" : "16"
"evaluatedValue" : 16
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_HideColumnDate",
"docComment" : "hide column file date",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 6,
"value" : "(1 << 5)",
"evaluatedValue" : "32"
"evaluatedValue" : 32
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ImGuiFileDialogFlags_Default",
"qualType" : "ImGuiFileDialogFlags_",
"order" : 7,
"value" : "ImGuiFileDialogFlags_ConfirmOverwrite",
"evaluatedValue" : "1"
"evaluatedValue" : 1
} ]
}, {
"@type" : "AstNamespaceDecl",
Expand Down Expand Up @@ -1565,35 +1565,35 @@
"qualType" : "IGFD::FileManager::SortingFieldEnum",
"order" : 0,
"value" : "0",
"evaluatedValue" : "0"
"evaluatedValue" : 0
}, {
"@type" : "AstEnumConstantDecl",
"name" : "FIELD_FILENAME",
"docComment" : "sorted by filename",
"qualType" : "IGFD::FileManager::SortingFieldEnum",
"order" : 1,
"evaluatedValue" : "1"
"evaluatedValue" : 1
}, {
"@type" : "AstEnumConstantDecl",
"name" : "FIELD_TYPE",
"docComment" : "sorted by filetype",
"qualType" : "IGFD::FileManager::SortingFieldEnum",
"order" : 2,
"evaluatedValue" : "2"
"evaluatedValue" : 2
}, {
"@type" : "AstEnumConstantDecl",
"name" : "FIELD_SIZE",
"docComment" : "sorted by filesize (formated file size)",
"qualType" : "IGFD::FileManager::SortingFieldEnum",
"order" : 3,
"evaluatedValue" : "3"
"evaluatedValue" : 3
}, {
"@type" : "AstEnumConstantDecl",
"name" : "FIELD_DATE",
"docComment" : "sorted by filedate",
"qualType" : "IGFD::FileManager::SortingFieldEnum",
"order" : 4,
"evaluatedValue" : "4"
"evaluatedValue" : 4
} ]
}, {
"@type" : "AstFieldDecl",
Expand Down
32 changes: 16 additions & 16 deletions buildSrc/src/main/resources/generator/api/ast/ast-ImGuizmo.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,98 +345,98 @@
"qualType" : "ImGuizmo::OPERATION",
"order" : 0,
"value" : "(1u << 0)",
"evaluatedValue" : "1"
"evaluatedValue" : 1
}, {
"@type" : "AstEnumConstantDecl",
"name" : "TRANSLATE_Y",
"qualType" : "ImGuizmo::OPERATION",
"order" : 1,
"value" : "(1u << 1)",
"evaluatedValue" : "2"
"evaluatedValue" : 2
}, {
"@type" : "AstEnumConstantDecl",
"name" : "TRANSLATE_Z",
"qualType" : "ImGuizmo::OPERATION",
"order" : 2,
"value" : "(1u << 2)",
"evaluatedValue" : "4"
"evaluatedValue" : 4
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ROTATE_X",
"qualType" : "ImGuizmo::OPERATION",
"order" : 3,
"value" : "(1u << 3)",
"evaluatedValue" : "8"
"evaluatedValue" : 8
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ROTATE_Y",
"qualType" : "ImGuizmo::OPERATION",
"order" : 4,
"value" : "(1u << 4)",
"evaluatedValue" : "16"
"evaluatedValue" : 16
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ROTATE_Z",
"qualType" : "ImGuizmo::OPERATION",
"order" : 5,
"value" : "(1u << 5)",
"evaluatedValue" : "32"
"evaluatedValue" : 32
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ROTATE_SCREEN",
"qualType" : "ImGuizmo::OPERATION",
"order" : 6,
"value" : "(1u << 6)",
"evaluatedValue" : "64"
"evaluatedValue" : 64
}, {
"@type" : "AstEnumConstantDecl",
"name" : "SCALE_X",
"qualType" : "ImGuizmo::OPERATION",
"order" : 7,
"value" : "(1u << 7)",
"evaluatedValue" : "128"
"evaluatedValue" : 128
}, {
"@type" : "AstEnumConstantDecl",
"name" : "SCALE_Y",
"qualType" : "ImGuizmo::OPERATION",
"order" : 8,
"value" : "(1u << 8)",
"evaluatedValue" : "256"
"evaluatedValue" : 256
}, {
"@type" : "AstEnumConstantDecl",
"name" : "SCALE_Z",
"qualType" : "ImGuizmo::OPERATION",
"order" : 9,
"value" : "(1u << 9)",
"evaluatedValue" : "512"
"evaluatedValue" : 512
}, {
"@type" : "AstEnumConstantDecl",
"name" : "BOUNDS",
"qualType" : "ImGuizmo::OPERATION",
"order" : 10,
"value" : "(1u << 10)",
"evaluatedValue" : "1024"
"evaluatedValue" : 1024
}, {
"@type" : "AstEnumConstantDecl",
"name" : "TRANSLATE",
"qualType" : "ImGuizmo::OPERATION",
"order" : 11,
"value" : "TRANSLATE_X | TRANSLATE_Y | TRANSLATE_Z",
"evaluatedValue" : "7"
"evaluatedValue" : 7
}, {
"@type" : "AstEnumConstantDecl",
"name" : "ROTATE",
"qualType" : "ImGuizmo::OPERATION",
"order" : 12,
"value" : "ROTATE_X | ROTATE_Y | ROTATE_Z | ROTATE_SCREEN",
"evaluatedValue" : "120"
"evaluatedValue" : 120
}, {
"@type" : "AstEnumConstantDecl",
"name" : "SCALE",
"qualType" : "ImGuizmo::OPERATION",
"order" : 13,
"value" : "SCALE_X | SCALE_Y | SCALE_Z",
"evaluatedValue" : "896"
"evaluatedValue" : 896
} ]
}, {
"@type" : "AstEnumDecl",
Expand All @@ -446,13 +446,13 @@
"name" : "LOCAL",
"qualType" : "ImGuizmo::MODE",
"order" : 0,
"evaluatedValue" : "0"
"evaluatedValue" : 0
}, {
"@type" : "AstEnumConstantDecl",
"name" : "WORLD",
"qualType" : "ImGuizmo::MODE",
"order" : 1,
"evaluatedValue" : "1"
"evaluatedValue" : 1
} ]
}, {
"@type" : "AstFunctionDecl",
Expand Down
Loading

0 comments on commit 6ee9625

Please sign in to comment.