mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 17:40:28 +02:00
* Fixed parsing of hints in alias types
git-svn-id: trunk@15063 -
This commit is contained in:
parent
332b67ecfb
commit
154b30b724
@ -117,6 +117,7 @@ type
|
|||||||
AParent: TPasElement): TPasElement;overload;
|
AParent: TPasElement): TPasElement;overload;
|
||||||
function CreateElement(AClass: TPTreeElement; const AName: String;
|
function CreateElement(AClass: TPTreeElement; const AName: String;
|
||||||
AParent: TPasElement; AVisibility: TPasMemberVisibility): TPasElement;overload;
|
AParent: TPasElement; AVisibility: TPasMemberVisibility): TPasElement;overload;
|
||||||
|
Function IsHint(Const S : String; AHint : TPasMemberHint) : Boolean;
|
||||||
Function CheckHint(Element : TPasElement; ExpectSemiColon : Boolean) : TPasMemberHints;
|
Function CheckHint(Element : TPasElement; ExpectSemiColon : Boolean) : TPasMemberHints;
|
||||||
public
|
public
|
||||||
Options : set of TPOptions;
|
Options : set of TPOptions;
|
||||||
@ -331,30 +332,43 @@ begin
|
|||||||
Result:=ParseType(Parent,'');
|
Result:=ParseType(Parent,'');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function TPasParser.IsHint(Const S : String; AHint : TPasMemberHint) : Boolean;
|
||||||
|
|
||||||
|
Var
|
||||||
|
T : string;
|
||||||
|
|
||||||
|
begin
|
||||||
|
T:=LowerCase(S);
|
||||||
|
Result:=(T='deprecated');
|
||||||
|
If Result then
|
||||||
|
Ahint:=hDeprecated
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Result:=(T='library');
|
||||||
|
if Result then
|
||||||
|
Ahint:=hLibrary
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Result:=(T='platform');
|
||||||
|
If result then
|
||||||
|
AHint:=hPlatform;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Function TPasParser.CheckHint(Element : TPasElement; ExpectSemiColon : Boolean) : TPasMemberHints;
|
Function TPasParser.CheckHint(Element : TPasElement; ExpectSemiColon : Boolean) : TPasMemberHints;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
Found : Boolean;
|
Found : Boolean;
|
||||||
|
h : TPasMemberHint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=[];
|
Result:=[];
|
||||||
Repeat
|
Repeat
|
||||||
NextToken;
|
NextToken;
|
||||||
Found:=CompareText(CurTokenString,'deprecated')=0;
|
Found:=IsHint(CurTokenString,h);
|
||||||
If Found then
|
If Found then
|
||||||
Include(Result,hDeprecated)
|
Include(Result,h)
|
||||||
else
|
|
||||||
begin
|
|
||||||
Found:=CompareText(CurTokenString,'library')=0;
|
|
||||||
if Found then
|
|
||||||
Include(Result,hLibrary)
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Found:=CompareText(CurTokenString,'platform')=0;
|
|
||||||
If Found then
|
|
||||||
Include(Result,hPlatform);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Until Not Found;
|
Until Not Found;
|
||||||
UnGetToken;
|
UnGetToken;
|
||||||
If Assigned(Element) then
|
If Assigned(Element) then
|
||||||
@ -1180,6 +1194,7 @@ var
|
|||||||
Prefix : String;
|
Prefix : String;
|
||||||
HadPackedModifier : Boolean; // 12/04/04 - Dave - Added
|
HadPackedModifier : Boolean; // 12/04/04 - Dave - Added
|
||||||
IsBitPacked : Boolean;
|
IsBitPacked : Boolean;
|
||||||
|
H : TPasMemberHint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
TypeName := CurTokenString;
|
TypeName := CurTokenString;
|
||||||
@ -1248,7 +1263,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
Prefix:='';
|
Prefix:='';
|
||||||
if CurToken = tkSemicolon then
|
if (CurToken = tkSemicolon) or IsHint(CurtokenString,h)then
|
||||||
begin
|
begin
|
||||||
UngetToken;
|
UngetToken;
|
||||||
UngetToken;
|
UngetToken;
|
||||||
@ -1276,7 +1291,8 @@ begin
|
|||||||
Result.Free;
|
Result.Free;
|
||||||
raise;
|
raise;
|
||||||
end;
|
end;
|
||||||
end else
|
end
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
UngetToken;
|
UngetToken;
|
||||||
UngetToken;
|
UngetToken;
|
||||||
|
Loading…
Reference in New Issue
Block a user