2005-07-13 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
authorRafael Teixeira <monoman@gmail.com>
Wed, 13 Jul 2005 23:05:51 +0000 (23:05 -0000)
committerRafael Teixeira <monoman@gmail.com>
Wed, 13 Jul 2005 23:05:51 +0000 (23:05 -0000)
* mb-parser.jay:
* block.cs: Support and successfully find goto target labels
declared out of block that contains the goto statement.

svn path=/trunk/mcs/; revision=47289

mcs/mbas/ChangeLog
mcs/mbas/block.cs
mcs/mbas/mb-parser.jay

index 1f7b3d7a69e8fe692df0711412cc74aff73ec298..ec91cedd133ddbdb11491ba025e03ec2bf702df9 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-13 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
+       * mb-parser.jay:
+       * block.cs: Support and successfully find goto target labels
+       declared out of block that contains the goto statement.
+
 2005-07-13 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
        *statement.cs: extract class Block into new source block.cs
        *mbas.exe.sources: added newly extracted block.cs
index 865baac112ba8b4f2e5f4d9927a4175ee02626d8..b69f7d1dbd34b3629427e949a0d36d31bc749f70 100644 (file)
@@ -257,8 +257,8 @@ namespace Mono.MonoBASIC {
                                return null;
 
                        foreach (Block child in children) {
-                               if (!child.Implicit)
-                                       continue;
+                       //      if (!child.Implicit)
+                       //              continue;
 
                                s = child.LookupLabel (name);
                                if (s != null) 
index 9c909b27173a95c963d97eee443326d0ddefaa9e..8b3981eb1cfd47b1869579219c8cabb2e3641762 100644 (file)
@@ -2893,7 +2893,14 @@ jump_statement
 goto_statement
        : GOTO label_name  
          {
+               Block block = current_block;
+         
+               while( current_block.Parent != null )
+                       current_block = current_block.Parent;
+
                $$ = new Goto (current_block, (string) $2, lexer.Location);
+
+               current_block = block;
          }
        ;