codetools: fixed FindDeclarationOfIdentAtParam searching keywords

git-svn-id: trunk@12051 -
This commit is contained in:
mattias 2007-09-17 10:25:57 +00:00
parent c3bcc5db17
commit d7a0682a5b
6 changed files with 20 additions and 14 deletions

View File

@ -2686,7 +2686,7 @@ begin
end else begin
Exclude(Params.Flags,fdfIgnoreCurContextNode);
{$IFDEF ShowTriedContexts}
DebugLn('[TFindDeclarationTool.FindIdentifierInContext] IgnoreCurContext');
DebugLn('[TFindDeclarationTool.FindIdentifierInContext] IgnoreCurContext ');
{$ENDIF}
end;
if LastContextNode=ContextNode then begin
@ -5109,7 +5109,7 @@ var
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['.',GetAtom]);
end;
procedure InitAtomQueue;
function InitAtomQueue: boolean;
procedure RaiseInternalError;
begin
@ -5118,18 +5118,25 @@ var
end;
begin
Result:=false;
if StartPos<1 then
StartPos:=FindStartOfVariable(EndPos)
else if EndPos<1 then
EndPos:=FindEndOfVariable(StartPos,true);
if (StartPos<1) then
RaiseInternalError;
if StartPos>SrcLen then exit;
if StartPos=EndPos then begin
// e.g. cursor behind semicolon, keyword or closing bracket
exit;
end;
{$IFDEF ShowExprEval}
DebugLn(' InitAtomQueue Expr="',copy(Src,StartPos,EndPos-StartPos),'"');
DebugLn([' InitAtomQueue StartPos=',StartPos,' EndPos=',EndPos,' Expr="',copy(Src,StartPos,EndPos-StartPos),'"']);
{$ENDIF}
LastAtomType:=vatNone;
MoveCursorToCleanPos(StartPos);
ReadNextAtom;
if CurPos.StartPos>SrcLen then exit;
CurAtom:=CurPos;
CurAtomType:=GetCurrentAtomType;
if CurAtomType in [vatRoundBracketOpen,vatEdgedBracketOpen] then
@ -5143,6 +5150,7 @@ var
NextAtomType:=vatSpace;
MoveCursorToCleanPos(CurAtom.StartPos);
IsIdentEndOfVar:=iieovUnknown;
Result:=true;
end;
procedure ReadNextExpressionAtom;
@ -5658,9 +5666,6 @@ begin
StartFlags:=Params.Flags;
StartContext.Node:=Params.ContextNode;
StartContext.Tool:=Self;
ExprType.Desc:=xtContext;
ExprType.SubDesc:=xtNone;
ExprType.Context:=StartContext;
{$IFDEF ShowExprEval}
DebugLn('[TFindDeclarationTool.FindExpressionTypeOfVariable]',
' Flags=[',FindDeclarationFlagsAsString(Params.Flags),']',
@ -5668,7 +5673,10 @@ begin
);
{$ENDIF}
InitAtomQueue;
if not InitAtomQueue then exit;
ExprType.Desc:=xtContext;
ExprType.SubDesc:=xtNone;
ExprType.Context:=StartContext;
repeat
{$IFDEF ShowExprEval}
DebugLn(' FindExpressionTypeOfVariable CurAtomType=',

View File

@ -12,7 +12,7 @@
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<Title Value="LazReport Designer"/>
<ActiveEditorIndexAtStart Value="3"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<RST OutDir="languages"/>
<PublishOptions>
@ -61,8 +61,8 @@
<IsPartOfProject Value="True"/>
<ResourceFilename Value="maincalleditor.lrs"/>
<UnitName Value="maincalleditor"/>
<CursorPos X="41" Y="222"/>
<TopLine Value="188"/>
<CursorPos X="31" Y="209"/>
<TopLine Value="8"/>
<EditorIndex Value="0"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>

View File

@ -1,5 +1,5 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/09/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/08/16]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

View File

@ -27,6 +27,6 @@ Linux :
Yous must install CUPS and libcups v1.1.19 or more.
FAQ :
Q:If I use Printers unit, the call of printer object générate an exception "Access Violation"
Q:If I use Printers unit, the call of printer object generate an exception "Access Violation"
R:Add in uses clause of your project, osPrinters

View File

@ -801,8 +801,6 @@ begin
end;
function TCUPSPrinter.DoGetPaperName: string;
var
s: string;
begin
if not (cpsPaperNameValid in FStates) then begin
// paper is not yet retrieved for first time