diff --git a/compiler/scandir.inc b/compiler/scandir.inc index d2409049f2..8a6f7ada99 100644 --- a/compiler/scandir.inc +++ b/compiler/scandir.inc @@ -664,6 +664,12 @@ const Message1(scan_f_cannot_open_includefile,hs); Message1(scan_t_start_include_file,current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^); current_scanner^.reload; + { process first read char } + case c of + #26 : current_scanner^.reload; + #10, + #13 : current_scanner^.linebreak; + end; { register for refs } current_module^.sourcefiles^.register_file(hp); end; @@ -1157,7 +1163,11 @@ const { $Log$ - Revision 1.64 1999-09-27 23:38:17 peter + Revision 1.65 1999-10-30 12:32:30 peter + * fixed line counter when the first line had #10 only. This was buggy + for both the main file as for include files + + Revision 1.64 1999/09/27 23:38:17 peter * bracket support for macro define Revision 1.63 1999/09/20 16:39:02 peter diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 297dc92d7b..75211ce8f1 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -216,6 +216,12 @@ implementation if not openinputfile then Message1(scan_f_cannot_open_input,fn); reload; + { process first read char } + case c of + #26 : reload; + #10, + #13 : linebreak; + end; end; @@ -1107,7 +1113,14 @@ implementation insertmacro(pattern,mac^.buftext,mac^.buflen); { handle empty macros } if c=#0 then - reload; + begin + reload; + case c of + #26 : reload; + #10, + #13 : linebreak; + end; + end; { play it again ... } inc(yylexcount); if yylexcount>16 then @@ -1671,7 +1684,11 @@ exit_label: end. { $Log$ - Revision 1.96 1999-09-27 23:40:10 peter + Revision 1.97 1999-10-30 12:32:30 peter + * fixed line counter when the first line had #10 only. This was buggy + for both the main file as for include files + + Revision 1.96 1999/09/27 23:40:10 peter * fixed macro within macro endless-loop Revision 1.95 1999/09/03 10:02:48 peter