Przeglądaj źródła

* on o : tobject do should also work now, the exceptsymtable shouldn't be
disposed by dellexlevel

florian 27 lat temu
rodzic
commit
8eb9f6121d
2 zmienionych plików z 27 dodań i 11 usunięć
  1. 12 9
      compiler/pstatmnt.pas
  2. 15 2
      compiler/tree.pas

+ 12 - 9
compiler/pstatmnt.pas

@@ -481,10 +481,9 @@ unit pstatmnt;
          p_default,p_specific : ptree;
          ot : pobjectdef;
          sym : pvarsym;
-
          old_in_except_block : boolean;
-
          exceptsymtable : psymtable;
+         objname : stringid;
 
       begin
          procinfo.flags:=procinfo.flags or
@@ -539,14 +538,14 @@ unit pstatmnt;
                      if token=ID then
                        begin
                           getsym(pattern,false);
-
+                          objname:=pattern;
+                          consume(ID);
                           { is a explicit name for the exception given ? }
-                          if not(assigned(srsym)) then
+                          if token=COLON then
                             begin
-                               sym:=new(pvarsym,init(pattern,nil));
+                               sym:=new(pvarsym,init(objname,nil));
                                exceptsymtable:=new(psymtable,init(stt_exceptsymtable));
                                exceptsymtable^.insert(sym);
-                               consume(ID);
                                consume(COLON);
                                getsym(pattern,false);
                                consume(ID);
@@ -576,7 +575,7 @@ unit pstatmnt;
                                if srsym^.typ=unitsym then
                                  begin
                                     consume(POINT);
-                                    getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
+                                    getsymonlyin(punitsym(srsym)^.unitsymtable,objname);
                                     consume(ID);
                                  end;
                                consume(ID);
@@ -608,7 +607,7 @@ unit pstatmnt;
                      { set the informations }
                      last^.excepttype:=ot;
                      last^.exceptsymtable:=exceptsymtable;
-
+                     last^.disposetyp:=dt_onn;
                      { remove exception symtable }
                      if assigned(exceptsymtable) then
                        dellexlevel;
@@ -1241,7 +1240,11 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.30  1998-07-30 16:07:10  florian
+  Revision 1.31  1998-08-02 16:41:59  florian
+    * on o : tobject do should also work now, the exceptsymtable shouldn't be
+      disposed by dellexlevel
+
+  Revision 1.30  1998/07/30 16:07:10  florian
     * try ... expect <statement> end; works now
 
   Revision 1.29  1998/07/30 13:30:37  florian

+ 15 - 2
compiler/tree.pas

@@ -152,7 +152,7 @@ unit tree;
        tdisposetyp = (dt_nothing,dt_leftright,dt_left,
                       dt_mbleft,dt_string,dt_typeconv,dt_inlinen,
                       dt_mbleft_and_method,dt_constset,dt_loop,dt_case,
-                      dt_with);
+                      dt_with,dt_onn);
 
       { different assignment types }
 
@@ -554,6 +554,15 @@ unit tree;
                  if assigned(p^.t2) then
                    disposetree(p^.t2);
               end;
+            dt_onn:
+              begin
+                 if assigned(p^.left) then
+                   disposetree(p^.left);
+                 if assigned(p^.right) then
+                   disposetree(p^.right);
+                 if assigned(p^.exceptsymtable) then
+                   dispose(p^.exceptsymtable,done);
+              end;
             dt_with :
               begin
                  if assigned(p^.left) then
@@ -1598,7 +1607,11 @@ unit tree;
 end.
 {
   $Log$
-  Revision 1.24  1998-07-30 11:18:23  florian
+  Revision 1.25  1998-08-02 16:42:02  florian
+    * on o : tobject do should also work now, the exceptsymtable shouldn't be
+      disposed by dellexlevel
+
+  Revision 1.24  1998/07/30 11:18:23  florian
     + first implementation of try ... except on .. do end;
     * limitiation of 65535 bytes parameters for cdecl removed