Replaced owner field by fileindex field in tpreprocstack class, in order to display correct include file for scan_e_endif_expected error

git-svn-id: trunk@35557 -
This commit is contained in:
pierre 2017-03-09 22:43:23 +00:00
parent 3d1c988d02
commit e87cc28b64

View File

@ -51,7 +51,7 @@ interface
next : tpreprocstack; next : tpreprocstack;
name : TIDString; name : TIDString;
line_nb : longint; line_nb : longint;
owner : tscannerfile; fileindex : longint;
constructor Create(atyp:preproctyp;a:boolean;n:tpreprocstack); constructor Create(atyp:preproctyp;a:boolean;n:tpreprocstack);
end; end;
@ -3710,7 +3710,8 @@ type
while assigned(preprocstack) do while assigned(preprocstack) do
begin begin
Message4(scan_e_endif_expected,preprocstring[preprocstack.typ],preprocstack.name, Message4(scan_e_endif_expected,preprocstring[preprocstack.typ],preprocstack.name,
preprocstack.owner.inputfile.name,tostr(preprocstack.line_nb)); current_module.sourcefiles.get_file_name(preprocstack.fileindex),
tostr(preprocstack.line_nb));
poppreprocstack; poppreprocstack;
end; end;
end; end;
@ -3747,7 +3748,7 @@ type
preprocstack:=tpreprocstack.create(atyp, condition, preprocstack); preprocstack:=tpreprocstack.create(atyp, condition, preprocstack);
preprocstack.name:=valuedescr; preprocstack.name:=valuedescr;
preprocstack.line_nb:=line_no; preprocstack.line_nb:=line_no;
preprocstack.owner:=self; preprocstack.fileindex:=current_filepos.fileindex;
if preprocstack.accept then if preprocstack.accept then
Message2(messid,preprocstack.name,'accepted') Message2(messid,preprocstack.name,'accepted')
else else
@ -3766,6 +3767,7 @@ type
preprocstack.accept:=not preprocstack.accept; preprocstack.accept:=not preprocstack.accept;
preprocstack.typ:=pp_else; preprocstack.typ:=pp_else;
preprocstack.line_nb:=line_no; preprocstack.line_nb:=line_no;
preprocstack.fileindex:=current_filepos.fileindex;
if preprocstack.accept then if preprocstack.accept then
Message2(scan_c_else_found,preprocstack.name,'accepted') Message2(scan_c_else_found,preprocstack.name,'accepted')
else else
@ -3801,6 +3803,7 @@ type
end; end;
preprocstack.line_nb:=line_no; preprocstack.line_nb:=line_no;
preprocstack.fileindex:=current_filepos.fileindex;
if preprocstack.accept then if preprocstack.accept then
Message2(scan_c_else_found,preprocstack.name,'accepted') Message2(scan_c_else_found,preprocstack.name,'accepted')
else else