* Merge * Support for $I %unit% %module% %filename% includes

This commit is contained in:
michael 2020-11-10 21:54:45 +00:00
parent 6b2fb0f806
commit 992481dffe
3 changed files with 16 additions and 0 deletions

View File

@ -3060,6 +3060,7 @@ begin
FCurModule:=Module;
HasFinished:=true;
try
Scanner.CurModuleName:=AUnitName;
if Assigned(Engine.Package) then
begin
Module.PackageName := Engine.Package.Name;
@ -3231,6 +3232,7 @@ begin
HasFinished:=true;
FCurModule:=Module;
try
Scanner.CurModuleName:=N;
if Assigned(Engine.Package) then
begin
Module.PackageName := Engine.Package.Name;
@ -3307,6 +3309,7 @@ begin
HasFinished:=true;
FCurModule:=Module;
try
Scanner.CurModuleName:=N;
if Assigned(Engine.Package) then
begin
Module.PackageName := Engine.Package.Name;

View File

@ -703,6 +703,7 @@ type
FAllowedModeSwitches: TModeSwitches;
FAllowedValueSwitches: TValueSwitches;
FConditionEval: TCondDirectiveEvaluator;
FCurModulename: string;
FCurrentBoolSwitches: TBoolSwitches;
FCurrentModeSwitches: TModeSwitches;
FCurrentValueSwitches: TValueSwitchArray;
@ -864,6 +865,7 @@ type
property Files: TStrings read FFiles;
property CurSourceFile: TLineReader read FCurSourceFile;
property CurFilename: string read FCurFilename;
property CurModuleName: string read FCurModulename Write FCurModuleName;
property CurLine: string read FCurLine;
property CurRow: Integer read FCurRow;
property CurColumn: Integer read GetCurColumn;

View File

@ -2877,6 +2877,17 @@ begin
SetStr(CurFilename);
exit;
end;
'%filename%':
begin
SetStr(ExtractFileName(CurFilename));
exit;
end;
'%unit%',
'%module%':
begin
SetStr(CurModuleName);
exit;
end;
'%line%':
begin
SetStr(IntToStr(CurRow));