Explorar o código

* moved preprocessfile into a conditional

peter %!s(int64=24) %!d(string=hai) anos
pai
achega
377e4c5927
Modificáronse 4 ficheiros con 30 adicións e 7 borrados
  1. 4 3
      compiler/compiler.pas
  2. 8 1
      compiler/parser.pas
  3. 6 1
      compiler/scandir.inc
  4. 12 2
      compiler/scanner.pas

+ 4 - 3
compiler/compiler.pas

@@ -270,9 +270,11 @@ begin
      do_stop:={$ifdef FPCPROCVAR}@{$endif}recoverstop;
 {$endif USEEXCEPT}
      starttime:=getrealtime;
+{$ifdef PREPROCWRITE}
      if parapreprocess then
       parser.preprocess(inputdir+inputfile+inputextension)
      else
+{$endif PREPROCWRITE}
       parser.compile(inputdir+inputfile+inputextension,false);
      if status.errorcount=0 then
       begin
@@ -319,9 +321,8 @@ end;
 end.
 {
   $Log$
-  Revision 1.12  2000-12-23 19:59:35  peter
-    * object to class for ow/og objects
-    * split objectdata from objectoutput
+  Revision 1.13  2000-12-24 12:24:38  peter
+    * moved preprocessfile into a conditional
 
   Revision 1.11  2000/11/29 00:30:30  florian
     * unused units removed from uses clause

+ 8 - 1
compiler/parser.pas

@@ -26,7 +26,9 @@ unit parser;
 
 interface
 
+{$ifdef PREPROCWRITE}
     procedure preprocess(const filename:string);
+{$endif PREPROCWRITE}
     procedure compile(const filename:string;compile_system:boolean);
     procedure initparser;
     procedure doneparser;
@@ -133,6 +135,7 @@ implementation
       end;
 
 
+{$ifdef PREPROCWRITE}
     procedure preprocess(const filename:string);
       var
         i : longint;
@@ -200,6 +203,7 @@ implementation
        { close }
          dispose(preprocfile,done);
       end;
+{$endif PREPROCWRITE}
 
 
     procedure compile(const filename:string;compile_system:boolean);
@@ -585,7 +589,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.11  2000-11-29 00:30:34  florian
+  Revision 1.12  2000-12-24 12:24:38  peter
+    * moved preprocessfile into a conditional
+
+  Revision 1.11  2000/11/29 00:30:34  florian
     * unused units removed from uses clause
     * some changes for widestrings
 

+ 6 - 1
compiler/scandir.inc

@@ -1390,8 +1390,10 @@ const
             t:=Get_Directive(hs);
             if not(is_conditional(t) or (t=_DIR_DEFINE) or (t=_DIR_UNDEF)) then
              begin
+{$ifdef PREPROCWRITE}
                preprocfile^.AddSpace;
                preprocfile^.Add('{$'+hs+current_scanner^.readcomment+'}');
+{$endif PREPROCWRITE}
                exit;
              end;
           end;
@@ -1459,7 +1461,10 @@ const
 
 {
   $Log$
-  Revision 1.13  2000-12-12 19:48:52  peter
+  Revision 1.14  2000-12-24 12:24:38  peter
+    * moved preprocessfile into a conditional
+
+  Revision 1.13  2000/12/12 19:48:52  peter
     * fixed lost char after $I directive (merged)
 
   Revision 1.12  2000/11/12 22:17:47  peter

+ 12 - 2
compiler/scanner.pas

@@ -135,6 +135,7 @@ interface
           function  asmgetchar:char;
        end;
 
+{$ifdef PREPROCWRITE}
        ppreprocfile=^tpreprocfile;
        tpreprocfile=object
          f   : text;
@@ -146,7 +147,7 @@ interface
          procedure Add(const s:string);
          procedure AddSpace;
        end;
-
+{$endif PREPROCWRITE}
 
     var
         { read strings }
@@ -161,7 +162,9 @@ interface
 
         current_scanner : pscannerfile;
         aktcommentstyle : tcommentstyle; { needed to use read_comment from directives }
+{$ifdef PREPROCWRITE}
         preprocfile     : ppreprocfile; { used with only preprocessing }
+{$endif PREPROCWRITE}
 
 
 implementation
@@ -238,6 +241,7 @@ implementation
                             Preprocessor writting
 *****************************************************************************}
 
+{$ifdef PREPROCWRITE}
     constructor tpreprocfile.init(const fn:string);
       begin
       { open outputfile }
@@ -282,6 +286,7 @@ implementation
             spacefound:=false;
           end;
       end;
+{$endif PREPROCWRITE}
 
 
 {*****************************************************************************
@@ -1261,6 +1266,7 @@ implementation
               skipcomment;
             ' ',#9..#13 :
               begin
+{$ifdef PREPROCWRITE}
                 if parapreprocess then
                  begin
                    if c=#10 then
@@ -1268,6 +1274,7 @@ implementation
                    else
                     preprocfile^.spacefound:=true;
                  end;
+{$endif PREPROCWRITE}
                 skipspace;
               end
             else
@@ -1939,7 +1946,10 @@ exit_label:
 end.
 {
   $Log$
-  Revision 1.11  2000-12-18 17:59:01  peter
+  Revision 1.12  2000-12-24 12:24:38  peter
+    * moved preprocessfile into a conditional
+
+  Revision 1.11  2000/12/18 17:59:01  peter
     * fixed skipuntildirective
 
   Revision 1.10  2000/12/16 15:36:02  peter