Browse Source

+ nil constants

peter 27 years ago
parent
commit
fdb8d828a6
3 changed files with 18 additions and 4 deletions
  1. 8 1
      compiler/pdecl.pas
  2. 5 1
      compiler/pexpr.pas
  3. 5 2
      compiler/symsymh.inc

+ 8 - 1
compiler/pdecl.pas

@@ -169,6 +169,10 @@ unit pdecl;
                           ps^:=p^.value_set^;
                           symtablestack^.insert(new(pconstsym,init(name,constset,longint(ps),p^.resulttype)));
                         end;
+                      niln :
+                        begin
+                          symtablestack^.insert(new(pconstsym,init(name,constnil,0,p^.resulttype)));
+                        end;
                       else
                         Message(cg_e_illegal_expression);
                    end;
@@ -2086,7 +2090,10 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.79  1998-11-05 12:02:51  peter
+  Revision 1.80  1998-11-13 10:18:09  peter
+    + nil constants
+
+  Revision 1.79  1998/11/05 12:02:51  peter
     * released useansistring
     * removed -Sv, its now available in fpc modes
 

+ 5 - 1
compiler/pexpr.pas

@@ -1004,6 +1004,7 @@ unit pexpr;
                                                 psetdef(pconstsym(srsym)^.definition));
                                constord : p1:=genordinalconstnode(pconstsym(srsym)^.value,
                                                 pconstsym(srsym)^.definition);
+                               constnil : p1:=genzeronode(niln);
                               end;
                               pd:=p1^.resulttype;
                             end;
@@ -1903,7 +1904,10 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.73  1998-11-05 12:02:52  peter
+  Revision 1.74  1998-11-13 10:18:11  peter
+    + nil constants
+
+  Revision 1.73  1998/11/05 12:02:52  peter
     * released useansistring
     * removed -Sv, its now available in fpc modes
 

+ 5 - 2
compiler/symsymh.inc

@@ -269,7 +269,7 @@
        end;
 
        tconsttype = (constord,conststring,constreal,constbool,
-                     constint,constchar,constset);
+                     constint,constchar,constset,constnil);
 
        pconstsym = ^tconstsym;
        tconstsym = object(tsym)
@@ -319,7 +319,10 @@
 
 {
   $Log$
-  Revision 1.5  1998-11-05 23:39:32  peter
+  Revision 1.6  1998-11-13 10:18:12  peter
+    + nil constants
+
+  Revision 1.5  1998/11/05 23:39:32  peter
     + typedconst.getsize
 
   Revision 1.4  1998/10/20 08:07:02  pierre