MG: fixed parser for dephis activex

git-svn-id: trunk@1502 -
This commit is contained in:
lazarus 2002-03-11 20:22:37 +00:00
parent c40bc842d5
commit 22fcb1c759
2 changed files with 7 additions and 11 deletions

View File

@ -287,9 +287,10 @@ writeln('TMethodJumpingCodeTool.FindJumpPoint D ',CleanCursorPos,', |',copy(Src,
TypeSectionNode:=TypeSectionNode.Parent;
// search the method node under the cursor
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,false);
if (CursorNode=nil)
or (not (CursorNode.Desc in [ctnProcedureHead,ctnProcedure])) then
exit;
while (CursorNode<>nil)
and (not (CursorNode.Desc in [ctnProcedureHead,ctnProcedure])) do
CursorNode:=CursorNode.Parent;
if (CursorNode=nil) then exit;
// search corresponding proc node
Result:=FindBestProcNode(CursorNode,[phpAddClassName,phpInUpperCase],
TypeSectionNode,[phpIgnoreForwards,phpInUpperCase]);

View File

@ -2768,14 +2768,9 @@ begin
if AtomIsChar(')') or UpAtomIs('END') then break;
CreateChildNode;
CurNode.Desc:=ctnRecordVariant;
repeat
ReadNextAtom; // read till ':'
if AtomIsChar(':') then break
else if AtomIsChar('(') or AtomIsChar('[') then
ReadTilBracketClose(true)
else if UpAtomIs('END') or AtomIsChar(')') or AtomIsKeyWord then
RaiseException(': expected, but '+GetAtom+' found');
until false;
ReadConstant(true,false,[]);
if not AtomIsChar(':') then
RaiseException(': expected, but '+GetAtom+' found');
ReadNextAtom; // read '('
if not AtomIsChar('(') then
RaiseException('( expected, but '+GetAtom+' found');