From 0799426c96b85f3b346de122a02b76fc9a01a966 Mon Sep 17 00:00:00 2001 From: Rafael Teixeira Date: Wed, 13 Jul 2005 23:05:51 +0000 Subject: [PATCH] 2005-07-13 Maverson Eduardo Schulze Rosa * 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 | 5 +++++ mcs/mbas/block.cs | 4 ++-- mcs/mbas/mb-parser.jay | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mcs/mbas/ChangeLog b/mcs/mbas/ChangeLog index 1f7b3d7a69e..ec91cedd133 100644 --- a/mcs/mbas/ChangeLog +++ b/mcs/mbas/ChangeLog @@ -1,3 +1,8 @@ +2005-07-13 Maverson Eduardo Schulze Rosa + * 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 *statement.cs: extract class Block into new source block.cs *mbas.exe.sources: added newly extracted block.cs diff --git a/mcs/mbas/block.cs b/mcs/mbas/block.cs index 865baac112b..b69f7d1dbd3 100644 --- a/mcs/mbas/block.cs +++ b/mcs/mbas/block.cs @@ -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) diff --git a/mcs/mbas/mb-parser.jay b/mcs/mbas/mb-parser.jay index 9c909b27173..8b3981eb1cf 100644 --- a/mcs/mbas/mb-parser.jay +++ b/mcs/mbas/mb-parser.jay @@ -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; } ; -- 2.25.1