mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 23:19:24 +02:00
* Patch from Graeme to show deprecated et al modifiers after record def.
git-svn-id: trunk@15778 -
This commit is contained in:
parent
7c42df69db
commit
a33ac5a082
@ -68,7 +68,6 @@ resourcestring
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
|
||||||
// Visitor pattern.
|
// Visitor pattern.
|
||||||
TPassTreeVisitor = class;
|
TPassTreeVisitor = class;
|
||||||
|
|
||||||
@ -99,6 +98,8 @@ type
|
|||||||
FName: string;
|
FName: string;
|
||||||
FParent: TPasElement;
|
FParent: TPasElement;
|
||||||
FHints : TPasMemberHints;
|
FHints : TPasMemberHints;
|
||||||
|
protected
|
||||||
|
procedure ProcessHints(const ASemiColonPrefix: boolean; var AResult: string); virtual;
|
||||||
public
|
public
|
||||||
SourceFilename: string;
|
SourceFilename: string;
|
||||||
SourceLinenumber: Integer;
|
SourceLinenumber: Integer;
|
||||||
@ -962,6 +963,9 @@ const
|
|||||||
'@','^',
|
'@','^',
|
||||||
'.');
|
'.');
|
||||||
|
|
||||||
|
cPasMemberHint : array[TPasMemberHint] of string =
|
||||||
|
( 'deprecated', 'library', 'platform', 'experimental', 'unimplemented' );
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses SysUtils;
|
uses SysUtils;
|
||||||
@ -1023,6 +1027,21 @@ end;
|
|||||||
|
|
||||||
{ All other stuff: }
|
{ All other stuff: }
|
||||||
|
|
||||||
|
procedure TPasElement.ProcessHints(const ASemiColonPrefix: boolean; var AResult: string);
|
||||||
|
var
|
||||||
|
h: TPasMemberHint;
|
||||||
|
begin
|
||||||
|
if Hints <> [] then
|
||||||
|
begin
|
||||||
|
if ASemiColonPrefix then
|
||||||
|
AResult := AResult + ';';
|
||||||
|
for h := Low(TPasMemberHint) to High(TPasMemberHint) do
|
||||||
|
begin
|
||||||
|
if h in Hints then
|
||||||
|
AResult := AResult + ' ' + cPasMemberHint[h] + ';'
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TPasElement.Create(const AName: string; AParent: TPasElement);
|
constructor TPasElement.Create(const AName: string; AParent: TPasElement);
|
||||||
begin
|
begin
|
||||||
@ -1812,7 +1831,7 @@ Var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
S:=TStringList.Create;
|
S:=TStringList.Create;
|
||||||
T:=TstringList.Create;
|
T:=TStringList.Create;
|
||||||
Try
|
Try
|
||||||
Temp:='record';
|
Temp:='record';
|
||||||
If IsPacked then
|
If IsPacked then
|
||||||
@ -1840,6 +1859,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
S.Add('end');
|
S.Add('end');
|
||||||
Result:=S.Text;
|
Result:=S.Text;
|
||||||
|
ProcessHints(False, Result);
|
||||||
finally
|
finally
|
||||||
S.free;
|
S.free;
|
||||||
T.free;
|
T.free;
|
||||||
@ -1981,7 +2001,8 @@ begin
|
|||||||
Result:=Result+' implements '+ImplementsName;
|
Result:=Result+' implements '+ImplementsName;
|
||||||
end;
|
end;
|
||||||
If IsDefault then
|
If IsDefault then
|
||||||
Result:=Result+'; default'
|
Result:=Result+'; default';
|
||||||
|
ProcessHints(True, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TPasProcedure.GetModifiers(List : TStrings);
|
Procedure TPasProcedure.GetModifiers(List : TStrings);
|
||||||
@ -2534,7 +2555,6 @@ Function TRecordValues.GetDeclaration(Full : Boolean):AnsiString;
|
|||||||
|
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
For I:=0 to Length(Fields) do
|
For I:=0 to Length(Fields) do
|
||||||
begin
|
begin
|
||||||
@ -2542,7 +2562,7 @@ begin
|
|||||||
Result:=Result+'; ';
|
Result:=Result+'; ';
|
||||||
Result:=Result+Fields[I].Name+': '+Fields[i].ValueExp.getDeclaration(Full);
|
Result:=Result+Fields[I].Name+': '+Fields[i].ValueExp.getDeclaration(Full);
|
||||||
end;
|
end;
|
||||||
Result:='('+Result+')'
|
Result:='('+Result+')';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TRecordValues.Create(AParent : TPasElement);
|
constructor TRecordValues.Create(AParent : TPasElement);
|
||||||
|
Loading…
Reference in New Issue
Block a user