mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-06 13:56:26 +02:00
+ currently compiled file name added on errors
This commit is contained in:
parent
7974fe193c
commit
7ffa0f6ac0
@ -42,6 +42,9 @@ unit parser;
|
|||||||
procedure initparser;
|
procedure initparser;
|
||||||
procedure doneparser;
|
procedure doneparser;
|
||||||
|
|
||||||
|
const
|
||||||
|
parser_current_file : string = '';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -161,6 +164,7 @@ unit parser;
|
|||||||
oldaktoptprocessor : tprocessors;
|
oldaktoptprocessor : tprocessors;
|
||||||
oldaktasmmode : tasmmode;
|
oldaktasmmode : tasmmode;
|
||||||
oldaktmodeswitches : tmodeswitches;
|
oldaktmodeswitches : tmodeswitches;
|
||||||
|
prev_name : pstring;
|
||||||
{$ifdef USEEXCEPT}
|
{$ifdef USEEXCEPT}
|
||||||
recoverpos : jmp_buf;
|
recoverpos : jmp_buf;
|
||||||
oldrecoverpos : pjmp_buf;
|
oldrecoverpos : pjmp_buf;
|
||||||
@ -168,6 +172,8 @@ unit parser;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
inc(compile_level);
|
inc(compile_level);
|
||||||
|
prev_name:=stringdup(parser_current_file);
|
||||||
|
parser_current_file:=filename;
|
||||||
{ save symtable state }
|
{ save symtable state }
|
||||||
oldsymtablestack:=symtablestack;
|
oldsymtablestack:=symtablestack;
|
||||||
oldrefsymtable:=refsymtable;
|
oldrefsymtable:=refsymtable;
|
||||||
@ -407,6 +413,8 @@ unit parser;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
dec(compile_level);
|
dec(compile_level);
|
||||||
|
parser_current_file:=prev_name^;
|
||||||
|
stringdispose(prev_name);
|
||||||
{$ifdef USEEXCEPT}
|
{$ifdef USEEXCEPT}
|
||||||
if longjump_used then
|
if longjump_used then
|
||||||
longjmp(recoverpospointer^,1);
|
longjmp(recoverpospointer^,1);
|
||||||
@ -416,7 +424,10 @@ unit parser;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.64 1999-01-12 14:25:29 peter
|
Revision 1.65 1999-01-22 12:19:31 pierre
|
||||||
|
+ currently compiled file name added on errors
|
||||||
|
|
||||||
|
Revision 1.64 1999/01/12 14:25:29 peter
|
||||||
+ BrowserLog for browser.log generation
|
+ BrowserLog for browser.log generation
|
||||||
+ BrowserCol for browser info in TCollections
|
+ BrowserCol for browser info in TCollections
|
||||||
* released all other UseBrowser
|
* released all other UseBrowser
|
||||||
|
@ -115,6 +115,8 @@ uses
|
|||||||
catch,
|
catch,
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif FPC}
|
{$endif FPC}
|
||||||
|
{ added for parser_current_file info }
|
||||||
|
parser,
|
||||||
globals,compiler
|
globals,compiler
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -245,7 +247,10 @@ begin
|
|||||||
Writeln('Error: Out of memory');
|
Writeln('Error: Out of memory');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Writeln('Compilation aborted at line ',aktfilepos.line);
|
{ we cannot use aktfilepos.file because all memory might have been
|
||||||
|
freed already !
|
||||||
|
But we can use global parser_current_file var }
|
||||||
|
Writeln('Compilation aborted ',parser_current_file,':',aktfilepos.line);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -260,11 +265,14 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{ Call the compiler with empty command, so it will take the parameters }
|
{ Call the compiler with empty command, so it will take the parameters }
|
||||||
Halt(Compile(''));
|
Halt(compiler.Compile(''));
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.38 1999-01-19 10:19:03 florian
|
Revision 1.39 1999-01-22 12:19:30 pierre
|
||||||
|
+ currently compiled file name added on errors
|
||||||
|
|
||||||
|
Revision 1.38 1999/01/19 10:19:03 florian
|
||||||
* bug with mul. of dwords fixed, reported by Alexander Stohr
|
* bug with mul. of dwords fixed, reported by Alexander Stohr
|
||||||
* some changes to compile with TP
|
* some changes to compile with TP
|
||||||
+ small enhancements for the new code generator
|
+ small enhancements for the new code generator
|
||||||
|
Loading…
Reference in New Issue
Block a user