2003-05-27 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / cs-parser.jay
index ff3beba20aef5fbcef89cea5ed7e038fa944e109..9550f25894bb4ac941e4e0ca82ac9f9eb372d09d 100755 (executable)
@@ -1481,6 +1481,10 @@ constructor_initializer
          {
                $$ = new ConstructorThisInitializer ((ArrayList) $4, current_local_parameters, lexer.Location);
          }
+       | COLON error {
+               Report.Error (1018, lexer.Location, "Keyword this or base expected");
+               $$ = null;
+         }
        ;
 
 destructor_declaration
@@ -3033,7 +3037,7 @@ switch_sections
 switch_section
        : switch_labels
          {
-               current_block = new Block (current_block, lexer.Location, lexer.Location);
+               current_block = current_block.CreateSwitchBlock (lexer.Location);
          }
          statement_list 
          {
@@ -3124,7 +3128,7 @@ for_statement
 
                        foreach (VariableDeclaration decl in var_declarators){
 
-                               VariableInfo vi;
+                               LocalInfo vi;
 
                                vi = current_block.AddVariable (
                                        type, decl.identifier, current_local_parameters, decl.Location);
@@ -3231,7 +3235,7 @@ foreach_statement
                Block foreach_block = new Block (current_block, Block.Flags.Implicit);
                LocalVariableReference v = null;
                Location l = lexer.Location;
-               VariableInfo vi;
+               LocalInfo vi;
 
                vi = foreach_block.AddVariable ((Expression) $3, (string) $4, current_local_parameters, l);
                if (vi != null) {
@@ -3508,7 +3512,7 @@ fixed_statement
 
                for (int i = 0; i < top; i++){
                        Pair p = (Pair) list [i];
-                       VariableInfo v;
+                       LocalInfo v;
 
                        v = current_block.AddVariable (type, (string) p.First,current_local_parameters, l);
                        if (v == null)
@@ -3585,7 +3589,7 @@ using_statement
 
                        foreach (VariableDeclaration decl in var_declarators){
 
-                               VariableInfo vi = current_block.AddVariable (
+                               LocalInfo vi    = current_block.AddVariable (
                                        type, decl.identifier, 
                                        current_local_parameters, decl.Location);
                                if (vi == null)