Remove footer, since not all docs rendered are by Mono
authorMiguel de Icaza <miguel@gnome.org>
Fri, 2 Mar 2012 15:09:39 +0000 (10:09 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 2 Mar 2012 15:11:08 +0000 (10:11 -0500)
mcs/mcs/Makefile
mcs/mcs/cs-parser.jay
mcs/tools/monodoc/Resources/mono-ecma-impl.xsl

index 989c4d1e0de6b6daca27755992d25f4df3d58818..94c69974557524ca2696954ed57b2ef11d315207 100644 (file)
@@ -1,6 +1,6 @@
 # To produce a debugging parser, use the version that says "-cvt"
-JAY_FLAGS=-c
-JAY_FLAGS=-cvt
+#JAY_FLAGS=-c
+JAY_FLAGS=-cvt
 
 thisdir := mcs
 SUBDIRS := 
index 2d204a78d9a282206edf82245595d74a98d3dc46..b63b0e5f5259b1dd109d8c4d8d6dda8001102abe 100644 (file)
@@ -3957,11 +3957,16 @@ null_coalescing_expression
 
 conditional_expression
        : null_coalescing_expression
-       | null_coalescing_expression INTERR expression COLON expression_or_error
+       | null_coalescing_expression INTERR expression COLON expression
          {
                $$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, (Expression) $5, GetLocation ($2));
                lbag.AddLocation ($$, GetLocation ($4));
          }
+       | null_coalescing_expression INTERR expression COLON CLOSE_BRACE {
+               report.Error (1525, GetLocation ($5), "Unexpected symbol '}', expecting expression");
+               lexer.putback ('}');
+               $$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, (Expression) $3, GetLocation ($2));
+         }
        ;
 
 assignment_expression
@@ -4798,7 +4803,7 @@ block_variable_declaration
                current_block.AddLocalName (li);
                current_variable = new BlockVariableDeclaration ((FullNamedExpression) $1, li);
          }
-         opt_local_variable_initializer opt_variable_declarators SEMICOLON
+         opt_local_variable_initializer opt_variable_declarators semicolon_or_handle_error_close_brace
          {
                $$ = current_variable;
                current_variable = null;
@@ -4819,6 +4824,15 @@ block_variable_declaration
          }
        ;
 
+semicolon_or_handle_error_close_brace 
+       : SEMICOLON
+       | CLOSE_BRACE {
+                     // Redundant, but wont regress
+               report.Error (1525, lexer.Location, "Unexpected symbol }");
+               lexer.putback ('}');
+               $$ = $1;
+         }
+       ;
 opt_local_variable_initializer
        : /* empty */
        | ASSIGN block_variable_initializer
@@ -5166,7 +5180,7 @@ for_statement
        ;
        
 // Has to use be extra rule to recover started block
-for_statement_cont
+xfor_statement_cont
        : opt_for_initializer SEMICOLON
          {
                ((For) $0).Initializer = (Statement) $1;
@@ -5197,6 +5211,56 @@ for_statement_cont
          }
        ;
 
+iterator_part
+       :  opt_for_condition SEMICOLON
+         {
+               For f = (For) oob_stack.Peek ();
+               f.Condition = (BooleanExpression) $1;
+         }
+         opt_for_iterator CLOSE_PARENS
+         {
+               For f = (For) oob_stack.Peek ();
+               f.Iterator = (Statement) $4;
+               $$ = new Tuple<Location,Location> (GetLocation ($2), GetLocation ($5));
+         }
+
+         // Handle errors in the case of opt_for_condition being followed by
+         // a close parenthesis
+       | opt_for_condition CLOSE_PARENS {
+             report.Error (1525, GetLocation ($2), "Unexpected symbol ')', expected ';'");
+             For f = (For) oob_stack.Peek ();
+             f.Condition = (BooleanExpression) $1;
+             $$ = new Tuple<Location,Location> (GetLocation ($2), GetLocation ($2));
+         }
+       ;
+
+// Has to use be extra rule to recover started block
+for_statement_cont
+       : opt_for_initializer SEMICOLON
+         {
+               ((For) $0).Initializer = (Statement) $1;
+               oob_stack.Push ($0);
+         }
+         iterator_part
+         embedded_statement
+         {
+               oob_stack.Pop ();
+               if ($5 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
+                       Warning_EmptyStatement (GetLocation ($5));
+         
+               For f = ((For) $0);
+               f.Statement = (Statement) $5;
+               lbag.AddStatement (f, current_block.StartLocation, GetLocation ($2), ((Tuple<Location,Location>) $5).Item1, ((Tuple<Location,Location>) $5).Item2);
+
+               $$ = end_block (GetLocation ($2));
+         }
+       | error
+         {
+               Error_SyntaxError (yyToken);
+               $$ = end_block (current_block.StartLocation);
+         }
+       ;
+
 opt_for_initializer
        : /* empty */           { $$ = new EmptyStatement (lexer.Location); }
        | for_initializer       
index 9b8ac0bdc6780fca6259d2bcda854a1606183d49..61d827ef11aeffa16b51f52ff04b03f1440dd8a0 100644 (file)
                <!-- FOOTER -->
                
                <div class="Footer">
-               <hr/>
-                       This documentation is part of the <a target="_top" title="Mono Project" href="http://www.mono-project.com/">Mono Project</a>.
                </div>
 
        </xsl:template>