Skip to content

Commit

Permalink
FunctionList: Fix enum element text
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 3, 2023
1 parent 4418b33 commit f2359a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Source/forms/simba.functionlistform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,24 @@ function GetText(const Decl: TDeclaration): String;
begin
if (Decl is TDeclaration_Method) and Decl.isObjectMethod then
Result := TDeclaration_Method(Decl).ObjectName + '.' + TDeclaration_Method(Decl).Name
else
if (Decl is TDeclaration_EnumElement) then
if (Decl.Owner is TDeclaration_TypeEnumScoped) then
Result := Decl.Owner.Name + '.' + Decl.Name
else
Result := Decl.Name
else
Result := Decl.Name;
end;

function GetHint(const Decl: TDeclaration): String;
begin
if (Decl is TDeclaration_EnumElement) then
if (Decl.Owner is TDeclaration_TypeEnumScoped) then
Result := Decl.Owner.Name + '.' + Decl.Name
else
Result := Decl.Name
else
if (Decl is TDeclaration_Method) then Result := TDeclaration_Method(Decl).HeaderString else
if (Decl is TDeclaration_Type) then Result := 'type ' + Decl.Name + ' = ' + Decl.TextNoCommentsSingleLine else
if (Decl is TDeclaration_Const) then Result := 'const ' + Decl.Name + TDeclaration_Var(Decl).VarTypeString + TDeclaration_Var(Decl).VarDefaultString else
Expand Down
2 changes: 0 additions & 2 deletions Source/script/simba.compiler_dump.pas
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ procedure TSimbaCompilerDump.DumpToFile(FileName: String);
Add('System', 'function IndexOf(const Item: T; const A: array): Integer; external;');
Add('System', 'function IndicesOf(const Item: T; const A: array): TIntegerArray; external;');
Add('System', 'function Contains(const Item: T; const A: array): Boolean; external;');

Add('System', 'function RTTIFields(constref AnyRecord): TRTTIFields; external;');
Add('System', 'function RTTIClassFields(constref AnyRecord): TRTTIFields; external;');

Add('System', 'function GetCallerAddress: Pointer; external;');
Add('System', 'function GetCallerName: String; external;');
Expand Down

0 comments on commit f2359a9

Please sign in to comment.