codetools: fixed parsing class const section

git-svn-id: trunk@28517 -
This commit is contained in:
mattias 2010-11-28 09:16:05 +00:00
parent 0206d775d7
commit e051968939

View File

@ -3703,13 +3703,13 @@ function TPascalParserTool.KeyWordFuncClass: boolean;
// the nodes for the methods and properties are created in a second // the nodes for the methods and properties are created in a second
// parsing phase (in KeyWordFuncClassMethod) // parsing phase (in KeyWordFuncClassMethod)
var var
BracketLvl: Integer;
ChildCreated: boolean; ChildCreated: boolean;
ClassAtomPos: TAtomPosition; ClassAtomPos: TAtomPosition;
Level: integer; Level: integer;
ContextDesc: Word; ContextDesc: Word;
IsForward: Boolean; IsForward: Boolean;
p: PChar; p: PChar;
BracketLvl: Integer;
ClassDesc: TCodeTreeNodeDesc; ClassDesc: TCodeTreeNodeDesc;
begin begin
ContextDesc:=CurNode.Desc; ContextDesc:=CurNode.Desc;
@ -3820,9 +3820,13 @@ begin
if CompareSrcIdentifiers(p,'BEGIN') then if CompareSrcIdentifiers(p,'BEGIN') then
SaveRaiseException(ctsEndForClassNotFound); SaveRaiseException(ctsEndForClassNotFound);
'C': 'C':
if CompareSrcIdentifiers(p,'CONST') if CompareSrcIdentifiers(p,'CONST') then begin
and (not (LastAtomIs(0,';') or LastAtomIs(0,'(') or LastAtomIs(0,'[') or LastAtomIs(0,'of'))) then if BracketLvl>0 then begin
if (not (LastAtomIs(0,';') or LastAtomIs(0,'(')
or LastAtomIs(0,'[') or LastUpAtomIs(0,'OF'))) then
SaveRaiseException(ctsEndForClassNotFound); SaveRaiseException(ctsEndForClassNotFound);
end;
end;
'I': 'I':
if CompareSrcIdentifiers(p,'INTERFACE') if CompareSrcIdentifiers(p,'INTERFACE')
or CompareSrcIdentifiers(p,'IMPLEMENTATION') then or CompareSrcIdentifiers(p,'IMPLEMENTATION') then
@ -3837,12 +3841,16 @@ begin
and (BracketLvl>0) then and (BracketLvl>0) then
SaveRaiseException(ctsEndForClassNotFound); SaveRaiseException(ctsEndForClassNotFound);
'V': 'V':
if CompareSrcIdentifiers(p,'VAR') if CompareSrcIdentifiers(p,'VAR') then begin
and (not (LastAtomIs(0,';') or LastAtomIs(0,'(') or LastAtomIs(0,'['))) then if BracketLvl>0 then begin
if (not (LastAtomIs(0,';') or LastAtomIs(0,'(')
or LastAtomIs(0,'[') or LastUpAtomIs(0,'OF'))) then
SaveRaiseException(ctsEndForClassNotFound); SaveRaiseException(ctsEndForClassNotFound);
end; end;
end; end;
end; end;
end;
end;
ReadNextAtom; ReadNextAtom;
end; end;
if (CurPos.StartPos>SrcLen) then if (CurPos.StartPos>SrcLen) then