Skip to content

Commit

Permalink
implement enum as integer
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Sep 14, 2024
1 parent 2f96966 commit 06b05e4
Show file tree
Hide file tree
Showing 37 changed files with 579 additions and 631 deletions.
5 changes: 0 additions & 5 deletions addons/clang/library/clang/AvailabilityKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.AvailabilityKind
---@operator call(integer): clang.AvailabilityKind
local AvailabilityKind = {
---The entity is available.
Available = 0,
Expand All @@ -20,8 +19,4 @@ local AvailabilityKind = {
NotAvailable = 2,
}

---@param v integer
---@return clang.AvailabilityKind
function AvailabilityKind:__call(v) end

return AvailabilityKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/CXXAccessSpecifier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ local VALUE

---
---@enum clang.CXXAccessSpecifier
---@operator call(integer): clang.CXXAccessSpecifier
local CXXAccessSpecifier = {
InvalidAccessSpecifier = 0,
Private = 3,
Protected = 2,
Public = 1,
}

---@param v integer
---@return clang.CXXAccessSpecifier
function CXXAccessSpecifier:__call(v) end

return CXXAccessSpecifier
5 changes: 0 additions & 5 deletions addons/clang/library/clang/CallingConv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.CallingConv
---@operator call(integer): clang.CallingConv
local CallingConv = {
AAPCS = 6,
AAPCS_VFP = 7,
Expand Down Expand Up @@ -35,8 +34,4 @@ local CallingConv = {
X86_64Win64 = 10,
}

---@param v integer
---@return clang.CallingConv
function CallingConv:__call(v) end

return CallingConv
5 changes: 0 additions & 5 deletions addons/clang/library/clang/CursorKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.CursorKind
---@operator call(integer): clang.CursorKind
local CursorKind = {
---The GNU address of label extension, representing &&label.
AddrLabelExpr = 120,
Expand Down Expand Up @@ -675,8 +674,4 @@ local CursorKind = {
WhileStmt = 207,
}

---@param v integer
---@return clang.CursorKind
function CursorKind:__call(v) end

return CursorKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/DiagnosticSeverity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.DiagnosticSeverity
---@operator call(integer): clang.DiagnosticSeverity
local DiagnosticSeverity = {
---This diagnostic indicates that the code is ill-formed.
Error = 3,
Expand All @@ -25,8 +24,4 @@ local DiagnosticSeverity = {
Warning = 2,
}

---@param v integer
---@return clang.DiagnosticSeverity
function DiagnosticSeverity:__call(v) end

return DiagnosticSeverity
5 changes: 0 additions & 5 deletions addons/clang/library/clang/ErrorCode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.ErrorCode
---@operator call(integer): clang.ErrorCode
local ErrorCode = {
---An AST deserialization error has occurred.
ASTReadError = 4,
Expand All @@ -24,8 +23,4 @@ local ErrorCode = {
Success = 0,
}

---@param v integer
---@return clang.ErrorCode
function ErrorCode:__call(v) end

return ErrorCode
5 changes: 0 additions & 5 deletions addons/clang/library/clang/GlobalOptFlags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.GlobalOptFlags
---@operator call(integer): clang.GlobalOptFlags
local GlobalOptFlags = {
---Used to indicate that no special CXIndex options are needed.
None = 0,
Expand All @@ -27,8 +26,4 @@ local GlobalOptFlags = {
ThreadBackgroundPriorityForIndexing = 1,
}

---@param v integer
---@return clang.GlobalOptFlags
function GlobalOptFlags:__call(v) end

return GlobalOptFlags
5 changes: 0 additions & 5 deletions addons/clang/library/clang/LanguageKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ local VALUE

---
---@enum clang.LanguageKind
---@operator call(integer): clang.LanguageKind
local LanguageKind = {
C = 1,
CPlusPlus = 3,
Invalid = 0,
ObjC = 2,
}

---@param v integer
---@return clang.LanguageKind
function LanguageKind:__call(v) end

return LanguageKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/LinkageKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.LinkageKind
---@operator call(integer): clang.LinkageKind
local LinkageKind = {
---This is the linkage for entities with true, external linkage.
External = 4,
Expand All @@ -23,8 +22,4 @@ local LinkageKind = {
UniqueExternal = 3,
}

---@param v integer
---@return clang.LinkageKind
function LinkageKind:__call(v) end

return LinkageKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/RefQualifierKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.RefQualifierKind
---@operator call(integer): clang.RefQualifierKind
local RefQualifierKind = {
---An lvalue ref-qualifier was provided (`&)`.
LValue = 1,
Expand All @@ -16,8 +15,4 @@ local RefQualifierKind = {
RValue = 2,
}

---@param v integer
---@return clang.RefQualifierKind
function RefQualifierKind:__call(v) end

return RefQualifierKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/StorageClass.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.StorageClass
---@operator call(integer): clang.StorageClass
local StorageClass = {
Auto = 6,
Extern = 2,
Expand All @@ -18,8 +17,4 @@ local StorageClass = {
Static = 3,
}

---@param v integer
---@return clang.StorageClass
function StorageClass:__call(v) end

return StorageClass
5 changes: 0 additions & 5 deletions addons/clang/library/clang/TLSKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ local VALUE

---
---@enum clang.TLSKind
---@operator call(integer): clang.TLSKind
local TLSKind = {
Dynamic = 1,
None = 0,
Static = 2,
}

---@param v integer
---@return clang.TLSKind
function TLSKind:__call(v) end

return TLSKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/TemplateArgumentKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.TemplateArgumentKind
---@operator call(integer): clang.TemplateArgumentKind
local TemplateArgumentKind = {
Declaration = 2,
Expression = 7,
Expand All @@ -20,8 +19,4 @@ local TemplateArgumentKind = {
Type = 1,
}

---@param v integer
---@return clang.TemplateArgumentKind
function TemplateArgumentKind:__call(v) end

return TemplateArgumentKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/TranslationUnitFlags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.TranslationUnitFlags
---@operator call(integer): clang.TranslationUnitFlags
local TranslationUnitFlags = {
---DEPRECATED: Enabled chained precompiled preambles in C++.
---
Expand Down Expand Up @@ -106,8 +105,4 @@ local TranslationUnitFlags = {
VisitImplicitAttributes = 8192,
}

---@param v integer
---@return clang.TranslationUnitFlags
function TranslationUnitFlags:__call(v) end

return TranslationUnitFlags
5 changes: 0 additions & 5 deletions addons/clang/library/clang/TypeKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.TypeKind
---@operator call(integer): clang.TypeKind
local TypeKind = {
Accum = 34,
Atomic = 177,
Expand Down Expand Up @@ -143,8 +142,4 @@ local TypeKind = {
WChar = 15,
}

---@param v integer
---@return clang.TypeKind
function TypeKind:__call(v) end

return TypeKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/TypeNullabilityKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.TypeNullabilityKind
---@operator call(integer): clang.TypeNullabilityKind
local TypeNullabilityKind = {
---Nullability is not applicable to this type.
Invalid = 3,
Expand All @@ -26,8 +25,4 @@ local TypeNullabilityKind = {
Unspecified = 2,
}

---@param v integer
---@return clang.TypeNullabilityKind
function TypeNullabilityKind:__call(v) end

return TypeNullabilityKind
5 changes: 0 additions & 5 deletions addons/clang/library/clang/VisibilityKind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local VALUE

---
---@enum clang.VisibilityKind
---@operator call(integer): clang.VisibilityKind
local VisibilityKind = {
---Symbol seen by the linker and acts like a normal symbol.
Default = 3,
Expand All @@ -19,8 +18,4 @@ local VisibilityKind = {
Protected = 2,
}

---@param v integer
---@return clang.VisibilityKind
function VisibilityKind:__call(v) end

return VisibilityKind
1 change: 0 additions & 1 deletion examples/00-testapi/src/Example.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ class Hello : public ExportParent, public Singleton<Hello> {
#ifdef TEST_OLUA_MACRO
void testMacro() {}
#endif

private:
std::function<int (Hello *, Point *)> _callback;
std::string _name;
Expand Down
Loading

0 comments on commit 06b05e4

Please sign in to comment.