about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Expr/Parser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp
index a5c6123f..a2a5d2e2 100644
--- a/lib/Expr/Parser.cpp
+++ b/lib/Expr/Parser.cpp
@@ -589,12 +589,6 @@ DeclResult ParserImpl::ParseQueryCommand() {
     return DeclResult();
   }
 
-  if (Tok.kind != Token::LSquare) {
-    Error("malformed query, expected expression list.");
-    SkipUntilRParen();
-    return DeclResult();
-  }
-
   ConsumeLSquare();
   // FIXME: Should avoid reading past unbalanced parens here.
   while (Tok.kind != Token::RSquare) {
@@ -642,6 +636,12 @@ DeclResult ParserImpl::ParseQueryCommand() {
   if (Tok.kind == Token::RParen)
     goto exit;
 
+  if (Tok.kind != Token::LSquare) {
+    Error("malformed query, expected array list.");
+    SkipUntilRParen();
+    return DeclResult();
+  }
+
   ConsumeLSquare();
   // FIXME: Should avoid reading past unbalanced parens here.
   while (Tok.kind != Token::RSquare) {