mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:59:16 +02:00
codetools: fixed result of ExploreUnitDirectives
git-svn-id: trunk@41678 -
This commit is contained in:
parent
c1b253f642
commit
2334f84a57
@ -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;
|
||||||
|
@ -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}
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user