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

View File

@ -32,6 +32,16 @@ uses
const RangeCheckDisabledConst1 = Byte(300);
{$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);
{$IfDef RangeCheck}

View File

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