MG: fixed finddeclaration Result in with statement

git-svn-id: trunk@1728 -
This commit is contained in:
lazarus 2002-06-05 17:02:31 +00:00
parent 5688e3f382
commit e77137ac52
2 changed files with 8 additions and 5 deletions

View File

@ -131,7 +131,8 @@ const
ctnProcedureType,ctnSetType,ctnRangeType,ctnEnumerationType,
ctnEnumIdentifier,ctnLabelType,ctnTypeType,ctnFileType,ctnPointerType,
ctnClassOfType,ctnVariantType];
AllPascalStatements = [ctnBeginBlock,ctnWithStatement,ctnCaseStatement];
AllPascalStatements = [ctnBeginBlock,ctnWithStatement,ctnWithVariable,
ctnCaseStatement,ctnCaseVariable];
AllSourceTypes =
[ctnProgram,ctnPackage,ctnLibrary,ctnUnit];
AllUsableSourceTypes =

View File

@ -47,12 +47,12 @@ interface
// activate for debug:
{ $DEFINE CTDEBUG}
{$DEFINE CTDEBUG}
{ $DEFINE ShowSearchPaths}
{ $DEFINE ShowTriedFiles}
{ $DEFINE ShowTriedContexts}
{ $DEFINE ShowTriedIdentifiers}
{ $DEFINE ShowExprEval}
{$DEFINE ShowExprEval}
{ $DEFINE ShowFoundIdentifier}
{ $DEFINE ShowInterfaceCache}
{ $DEFINE ShowNodeCache}
@ -2976,10 +2976,12 @@ var
procedure InitAtomQueue;
begin
//writeln('AAA1');
if StartPos<1 then
StartPos:=FindStartOfVariable(EndPos)
else if EndPos<1 then
EndPos:=FindEndOfVariable(StartPos,true);
//writeln('AAA2');
if (StartPos<1) then
RaiseException('internal codetool error: FindExpressionTypeOfVariable '
+' StartPos='+IntToStr(StartPos)+' EndPos='+IntToStr(EndPos));
@ -3053,10 +3055,10 @@ var
begin
if (CurContext.Node<>nil) then begin
// check if at the end of the variable
if (NextAtom.EndPos>EndPos) and (fdfFindVariable in StartFlags) then
if IsIdentifierEndOfVariable and (fdfFindVariable in StartFlags) then
// the variable is wanted, not its type
exit;
// find base type
Exclude(Params.Flags,fdfFunctionResult);
ExprType:=CurContext.Tool.ConvertNodeToExpressionType(CurContext.Node,