浏览代码

* Fixed bug in readcomment that was dropping * characters

michael 25 年之前
父节点
当前提交
10b7a3ccbe
共有 2 个文件被更改,包括 42 次插入6 次删除
  1. 15 3
      compiler/scandir.inc
  2. 27 3
      compiler/scanner.pas

+ 15 - 3
compiler/scandir.inc

@@ -765,7 +765,16 @@ const
         s : string;
       begin
         current_scanner^.skipspace;
-        s:=AddExtension(FixFileName(current_scanner^.readcomment),target_info.resext);
+        s:=current_scanner^.readcomment;
+        { replace * with current module name.
+          This should always be defined. }
+        if s[1]='*' then
+          if Assigned(Current_Module) then
+            begin
+            delete(S,1,1);
+            insert(lower(current_module^.modulename^),S,1);
+            end;
+        s:=AddExtension(FixFileName(s),target_info.resext);
         if target_info.res<>res_none then
           current_module^.resourcefiles.insert(FixFileName(s))
         else
@@ -1299,7 +1308,10 @@ const
 
 {
   $Log$
-  Revision 1.76  2000-02-28 17:23:57  daniel
+  Revision 1.77  2000-04-08 20:18:53  michael
+  * Fixed bug in readcomment that was dropping * characters
+
+  Revision 1.76  2000/02/28 17:23:57  daniel
   * Current work of symtable integration committed. The symtable can be
     activated by defining 'newst', but doesn't compile yet. Changes in type
     checking and oop are completed. What is left is to write a new
@@ -1378,4 +1390,4 @@ const
     * C alignment added for records
     * PPU version increased to solve .12 <-> .13 probs
 
-}
+}

+ 27 - 3
compiler/scanner.pas

@@ -829,7 +829,28 @@ implementation
                    readchar;
                    dec_comment_level;
                    break;
-                 end;
+                 end
+                else
+                 { Add both characters !!}
+                 if (i<255) then
+                   begin
+                   inc(i);
+                   readcomment[i]:='*';
+                   if (i<255) then
+                     begin
+                     inc(i);
+                     readcomment[i]:='*';
+                     end;
+                   end;
+              end
+             else
+              { Not old TP comment, so add...}
+              begin
+              if (i<255) then
+               begin
+               inc(i);
+               readcomment[i]:='*';
+               end;
               end;
            #26 :
               end_of_file;
@@ -1790,7 +1811,10 @@ exit_label:
 end.
 {
   $Log$
-  Revision 1.109  2000-03-13 21:21:57  peter
+  Revision 1.110  2000-04-08 20:18:53  michael
+  * Fixed bug in readcomment that was dropping * characters
+
+  Revision 1.109  2000/03/13 21:21:57  peter
     * ^m support also after a string
 
   Revision 1.108  2000/03/12 17:53:16  florian
@@ -1875,4 +1899,4 @@ end.
     * directives are allowed in (* *)
     * fixed parsing of (* between conditional code
 
-}
+}