|
@@ -1139,6 +1139,7 @@ function TPas2JSResolver.GetOverloadIndex(Identifier: TPasIdentifier;
|
|
var
|
|
var
|
|
El: TPasElement;
|
|
El: TPasElement;
|
|
ProcScope: TPasProcedureScope;
|
|
ProcScope: TPasProcedureScope;
|
|
|
|
+ C: TClass;
|
|
begin
|
|
begin
|
|
Result:=0;
|
|
Result:=0;
|
|
// iterate from last added to first added
|
|
// iterate from last added to first added
|
|
@@ -1151,7 +1152,13 @@ begin
|
|
Result:=0;
|
|
Result:=0;
|
|
continue;
|
|
continue;
|
|
end;
|
|
end;
|
|
- if El is TPasProcedure then
|
|
|
|
|
|
+ C:=El.ClassType;
|
|
|
|
+ if C=TPasClassType then
|
|
|
|
+ begin
|
|
|
|
+ if TPasClassType(El).IsForward then
|
|
|
|
+ continue;
|
|
|
|
+ end
|
|
|
|
+ else if C.InheritsFrom(TPasProcedure) then
|
|
begin
|
|
begin
|
|
if TPasProcedure(El).IsOverride then
|
|
if TPasProcedure(El).IsOverride then
|
|
continue;
|
|
continue;
|
|
@@ -1239,6 +1246,9 @@ begin
|
|
RenameSubOverloads(aSection.Declarations);
|
|
RenameSubOverloads(aSection.Declarations);
|
|
end;
|
|
end;
|
|
PopOverloadScope;
|
|
PopOverloadScope;
|
|
|
|
+ {$IFDEF VerbosePas2JS}
|
|
|
|
+ writeln('TPas2JSResolver.RenameOverloadsInSection END ',GetObjName(aSection));
|
|
|
|
+ {$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TPas2JSResolver.RenameOverloads(DeclEl: TPasElement;
|
|
procedure TPas2JSResolver.RenameOverloads(DeclEl: TPasElement;
|
|
@@ -1275,6 +1285,9 @@ begin
|
|
ProcScope.ImplProc.Name:=Proc.Name;
|
|
ProcScope.ImplProc.Name:=Proc.Name;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ {$IFDEF VerbosePas2JS}
|
|
|
|
+ writeln('TPas2JSResolver.RenameOverloads END ',GetObjName(DeclEl));
|
|
|
|
+ {$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TPas2JSResolver.RenameSubOverloads(Declarations: TFPList);
|
|
procedure TPas2JSResolver.RenameSubOverloads(Declarations: TFPList);
|
|
@@ -1296,7 +1309,9 @@ begin
|
|
Proc:=TPasProcedure(El);
|
|
Proc:=TPasProcedure(El);
|
|
if Proc.IsAbstract or Proc.IsExternal then continue;
|
|
if Proc.IsAbstract or Proc.IsExternal then continue;
|
|
ProcScope:=Proc.CustomData as TPasProcedureScope;
|
|
ProcScope:=Proc.CustomData as TPasProcedureScope;
|
|
- //writeln('TPas2JSResolver.RenameSubOverloads Proc=',Proc.Name,' DeclarationProc=',GetObjName(ProcScope.DeclarationProc),' ImplProc=',GetObjName(ProcScope.ImplProc),' ClassScope=',GetObjName(ProcScope.ClassScope));
|
|
|
|
|
|
+ {$IFDEF VerbosePas2JS}
|
|
|
|
+ writeln('TPas2JSResolver.RenameSubOverloads Proc=',Proc.Name,' DeclarationProc=',GetObjName(ProcScope.DeclarationProc),' ImplProc=',GetObjName(ProcScope.ImplProc),' ClassScope=',GetObjName(ProcScope.ClassScope));
|
|
|
|
+ {$ENDIF}
|
|
if ProcScope.DeclarationProc<>nil then
|
|
if ProcScope.DeclarationProc<>nil then
|
|
// proc implementation (not forward) -> skip
|
|
// proc implementation (not forward) -> skip
|
|
continue;
|
|
continue;
|
|
@@ -1318,6 +1333,7 @@ begin
|
|
else if C=TPasClassType then
|
|
else if C=TPasClassType then
|
|
begin
|
|
begin
|
|
ClassEl:=TPasClassType(El);
|
|
ClassEl:=TPasClassType(El);
|
|
|
|
+ if ClassEl.IsForward then continue;
|
|
ClassScope:=El.CustomData as TPas2JSClassScope;
|
|
ClassScope:=El.CustomData as TPas2JSClassScope;
|
|
OldScopeCount:=FOverloadScopes.Count;
|
|
OldScopeCount:=FOverloadScopes.Count;
|
|
|
|
|
|
@@ -1341,6 +1357,9 @@ begin
|
|
else if C.InheritsFrom(TPasVariable) and (El.Parent.ClassType=TPasClassType) then
|
|
else if C.InheritsFrom(TPasVariable) and (El.Parent.ClassType=TPasClassType) then
|
|
RenameOverload(El);
|
|
RenameOverload(El);
|
|
end;
|
|
end;
|
|
|
|
+ {$IFDEF VerbosePas2JS}
|
|
|
|
+ writeln('TPas2JSResolver.RenameSubOverloads END');
|
|
|
|
+ {$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TPas2JSResolver.PushOverloadScope(Scope: TPasIdentifierScope);
|
|
procedure TPas2JSResolver.PushOverloadScope(Scope: TPasIdentifierScope);
|