mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-01 18:26:09 +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 doneparser;
|
||||
|
||||
const
|
||||
parser_current_file : string = '';
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -161,6 +164,7 @@ unit parser;
|
||||
oldaktoptprocessor : tprocessors;
|
||||
oldaktasmmode : tasmmode;
|
||||
oldaktmodeswitches : tmodeswitches;
|
||||
prev_name : pstring;
|
||||
{$ifdef USEEXCEPT}
|
||||
recoverpos : jmp_buf;
|
||||
oldrecoverpos : pjmp_buf;
|
||||
@ -168,6 +172,8 @@ unit parser;
|
||||
|
||||
begin
|
||||
inc(compile_level);
|
||||
prev_name:=stringdup(parser_current_file);
|
||||
parser_current_file:=filename;
|
||||
{ save symtable state }
|
||||
oldsymtablestack:=symtablestack;
|
||||
oldrefsymtable:=refsymtable;
|
||||
@ -407,6 +413,8 @@ unit parser;
|
||||
end;
|
||||
|
||||
dec(compile_level);
|
||||
parser_current_file:=prev_name^;
|
||||
stringdispose(prev_name);
|
||||
{$ifdef USEEXCEPT}
|
||||
if longjump_used then
|
||||
longjmp(recoverpospointer^,1);
|
||||
@ -416,7 +424,10 @@ unit parser;
|
||||
end.
|
||||
{
|
||||
$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
|
||||
+ BrowserCol for browser info in TCollections
|
||||
* released all other UseBrowser
|
||||
|
@ -115,6 +115,8 @@ uses
|
||||
catch,
|
||||
{$endif}
|
||||
{$endif FPC}
|
||||
{ added for parser_current_file info }
|
||||
parser,
|
||||
globals,compiler
|
||||
;
|
||||
|
||||
@ -245,7 +247,10 @@ begin
|
||||
Writeln('Error: Out of memory');
|
||||
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;
|
||||
|
||||
@ -260,11 +265,14 @@ begin
|
||||
{$endif}
|
||||
|
||||
{ Call the compiler with empty command, so it will take the parameters }
|
||||
Halt(Compile(''));
|
||||
Halt(compiler.Compile(''));
|
||||
end.
|
||||
{
|
||||
$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
|
||||
* some changes to compile with TP
|
||||
+ small enhancements for the new code generator
|
||||
|
Loading…
Reference in New Issue
Block a user