--- /dev/null
+// CS0742: Unexpected symbol `;'. A query body must end with select or group clause
+// Line: 10
+
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var q = from i in "abcd" where i;
+ }
+}
;
query_body
- : opt_query_body_clauses select_or_group_clause opt_query_continuation
+ : query_body_clauses select_or_group_clause opt_query_continuation
{
Linq.AQueryClause head = (Linq.AQueryClause)$2;
$$ = head;
}
- | opt_query_body_clauses COMPLETE_COMPLETION
+ | select_or_group_clause opt_query_continuation
+ {
+ Linq.AQueryClause head = (Linq.AQueryClause)$2;
+
+ if ($1 != null) {
+ Linq.AQueryClause clause = (Linq.AQueryClause)$1;
+ clause.Tail.Next = head;
+ head = clause;
+ }
+
+ $$ = head;
+ }
+ | query_body_clauses COMPLETE_COMPLETION
+ | query_body_clauses error
+ {
+ report.Error (742, GetLocation ($2), "Unexpected symbol `{0}'. A query body must end with select or group clause", GetSymbolName (yyToken));
+ $$ = $1;
+ }
| error
{
Error_SyntaxError (yyToken);
}
;
-opt_query_body_clauses
- : /* empty */
- | query_body_clauses
- ;
-
query_body_clauses
: query_body_clause
| query_body_clauses query_body_clause
<entry il="0x22" row="35" file_ref="1" hidden="false" />
<entry il="0x2d" row="36" file_ref="1" hidden="false" />
<entry il="0x8b" row="37" file_ref="1" hidden="false" />
- <entry il="0x380" row="38" file_ref="1" hidden="false" />
- <entry il="0x490" row="39" file_ref="1" hidden="false" />
+ <entry il="0x3b1" row="38" file_ref="1" hidden="false" />
+ <entry il="0x4c1" row="39" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<scopes>
- <entry index="0" start="0x22" end="0x470" />
+ <entry index="0" start="0x22" end="0x4a1" />
</scopes>
</method>
<method token="0x6000011">