Sfoglia il codice sorgente

+ enable non local goto in macpas mode, test/tmacnonlocalgoto.pp does not fail anymore

git-svn-id: trunk@16265 -
florian 14 anni fa
parent
commit
38b90c987b
6 ha cambiato i file con 11 aggiunte e 9 eliminazioni
  1. 2 2
      compiler/globals.pas
  2. 4 2
      compiler/globtype.pas
  3. 2 2
      compiler/nflw.pas
  4. 1 1
      compiler/pdecl.pas
  5. 1 1
      compiler/pstatmnt.pas
  6. 1 1
      compiler/psub.pas

+ 2 - 2
compiler/globals.pas

@@ -68,9 +68,9 @@ interface
          [m_gpc,m_all,m_tp_procvar];
 {$endif}
        macmodeswitches =
-         [m_mac,m_all,m_cvar_support,m_mac_procvar,m_nested_procvars];
+         [m_mac,m_all,m_cvar_support,m_mac_procvar,m_nested_procvars,m_non_local_goto];
        isomodeswitches =
-         [m_iso,m_all,m_tp_procvar,m_duplicate_names,m_nested_procvars];
+         [m_iso,m_all,m_tp_procvar,m_duplicate_names,m_nested_procvars,m_non_local_goto];
 
        { maximum nesting of routines }
        maxnesting = 32;

+ 4 - 2
compiler/globtype.pas

@@ -272,7 +272,8 @@ interface
          m_except,              { allow exception-related keywords }
          m_objectivec1,         { support interfacing with Objective-C (1.0) }
          m_objectivec2,         { support interfacing with Objective-C (2.0) }
-         m_nested_procvars      { support nested procedural variables }
+         m_nested_procvars,     { support nested procedural variables }
+         m_non_local_goto       { support non local gotos (like iso pascal) }
        );
        tmodeswitches = set of tmodeswitch;
 
@@ -391,7 +392,8 @@ interface
          'EXCEPTIONS',
          'OBJECTIVEC1',
          'OBJECTIVEC2',
-         'NESTEDPROCVARS');
+         'NESTEDPROCVARS',
+         'NONLOCALGOTO');
 
 
      type

+ 2 - 2
compiler/nflw.pas

@@ -1699,7 +1699,7 @@ implementation
               { generated by the optimizer? }
                not(assigned(labelsym.owner))) then
               labelnode:=tlabelnode(labelsym.code)
-            else if (m_iso in current_settings.modeswitches) and
+            else if (m_non_local_goto in current_settings.modeswitches) and
               assigned(labelsym.owner) then
               begin
                 if current_procinfo.procdef.parast.symtablelevel>labelsym.owner.symtablelevel then
@@ -1839,7 +1839,7 @@ implementation
 
         if assigned(left) then
           firstpass(left);
-        if (m_iso in current_settings.modeswitches) and
+        if (m_non_local_goto in current_settings.modeswitches) and
           (current_procinfo.procdef.parast.symtablelevel<>labsym.owner.symtablelevel) then
           CGMessage(cg_e_labels_cannot_defined_outside_declaration_scope)
       end;

+ 1 - 1
compiler/pdecl.pas

@@ -284,7 +284,7 @@ implementation
                 else
                   labelsym:=tlabelsym.create(pattern);
                 symtablestack.top.insert(labelsym);
-                if m_iso in current_settings.modeswitches then
+                if m_non_local_goto in current_settings.modeswitches then
                   begin
                     if symtablestack.top.symtabletype=localsymtable then
                       begin

+ 1 - 1
compiler/pstatmnt.pas

@@ -1058,7 +1058,7 @@ implementation
                      else
                        begin
                          { goto is only allowed to labels within the current scope }
-                         if not(m_iso in current_settings.modeswitches) and
+                         if not(m_non_local_goto in current_settings.modeswitches) and
                            (srsym.owner<>current_procinfo.procdef.localst) then
                            CGMessage(parser_e_goto_outside_proc);
                          code:=cgotonode.create(tlabelsym(srsym));

+ 1 - 1
compiler/psub.pas

@@ -379,7 +379,7 @@ implementation
                   internalerror(200305104);
               end;
           end;
-        if m_iso in current_settings.modeswitches then
+        if m_non_local_goto in current_settings.modeswitches then
           tsymtable(current_procinfo.procdef.localst).SymList.ForEachCall(@add_label_init,@newstatement);
       end;