codetools: skip 'OPTIONAL' and 'REQUIRED' sections in objcprotocol

git-svn-id: trunk@33683 -
This commit is contained in:
paul 2011-11-22 01:47:51 +00:00
parent be91d94a0d
commit 2aaf758a1e
2 changed files with 13 additions and 3 deletions

View File

@ -35,9 +35,11 @@ type
private
end;
NSAlertDelegateProtocol = objcprotocol external name 'NSAlertDelegate'
NSDockTilePlugInProtocol = objcprotocol external name 'NSDockTilePlugIn'
required
procedure setDockTile(dockTile: NSDockTile); message 'setDockTile:';
optional
function alertShowHelp(alert: NSAlert): Boolean; message 'alertShowHelp:';
function dockMenu: NSMenu; message 'dockMenu';
end;
implementation

View File

@ -422,7 +422,7 @@ end;
function TPascalParserTool.ParseInnerClass(StartPos, WordLen: integer
): boolean;
// KeyWordFunctions for parsing in a class/object/record
// KeyWordFunctions for parsing in a class/object/record/interface
var
p: PChar;
begin
@ -3984,6 +3984,14 @@ begin
ReadGUID;
// parse till "end" of interface
repeat
// ObjCProtocol can have 'OPTIONAL' and 'REQUIRED' sections
if (IntfDesc=ctnObjCProtocol) and (CurPos.Flag=cafWord) then begin
if UpAtomIs('OPTIONAL') then
ReadNextAtom
else
if UpAtomIs('REQUIRED') then
ReadNextAtom;
end;
if not ParseInnerClass(CurPos.StartPos,CurPos.EndPos-CurPos.StartPos) then
begin
if CurPos.Flag<>cafEnd then