codetools: fixed result of ExploreUnitDirectives

git-svn-id: trunk@41678 -
This commit is contained in:
mattias 2013-06-11 14:14:02 +00:00
parent c1b253f642
commit 2334f84a57
3 changed files with 13 additions and 1 deletions

View File

@ -1859,6 +1859,7 @@ end;
function TCodeToolManager.ExploreUnitDirectives(Code: TCodeBuffer; out function TCodeToolManager.ExploreUnitDirectives(Code: TCodeBuffer; out
aScanner: TLinkScanner): boolean; aScanner: TLinkScanner): boolean;
begin begin
Result:=false;
if not InitCurCodeTool(Code) then exit; if not InitCurCodeTool(Code) then exit;
{$IFDEF CTDEBUG} {$IFDEF CTDEBUG}
DebugLn('TCodeToolManager.ExploreUnitDirectives A ',dbgs(FCurCodeTool.Scanner<>nil)); DebugLn('TCodeToolManager.ExploreUnitDirectives A ',dbgs(FCurCodeTool.Scanner<>nil));
@ -1868,6 +1869,7 @@ begin
if not aScanner.StoreDirectives then if not aScanner.StoreDirectives then
aScanner.DemandStoreDirectives; aScanner.DemandStoreDirectives;
aScanner.Scan(lsrEnd,true); aScanner.Scan(lsrEnd,true);
Result:=true;
except except
on e: Exception do Result:=HandleException(e); on e: Exception do Result:=HandleException(e);
end; end;

View File

@ -32,6 +32,16 @@ uses
const RangeCheckDisabledConst1 = Byte(300); const RangeCheckDisabledConst1 = Byte(300);
{$EndIf} {$EndIf}
{$IF defined(de)}
const t1 = 1;
{$ELSEIF defined(ru)}
const t2 = 2;
{$ELSEIF defined(fr)}
const t3 = 3;
{$ELSE}
const t4 = 4;
{$IFEND}
const RangeCheckDisabledConst2 = Word(-1); const RangeCheckDisabledConst2 = Word(-1);
{$IfDef RangeCheck} {$IfDef RangeCheck}

View File

@ -46,7 +46,7 @@ begin
writeln(' ',ParamStr(0)); writeln(' ',ParamStr(0));
writeln(' ',ParamStr(0),' <filename>'); writeln(' ',ParamStr(0),' <filename>');
end; end;
Filename:=ExpandFileName('scanexamples'+PathDelim+'directives1.pas'); Filename:=ExpandFileName(SetDirSeparators('scanexamples/directives1.pas'));
// load the file // load the file
Code:=CodeToolBoss.LoadFile(Filename,true,false); Code:=CodeToolBoss.LoadFile(Filename,true,false);