Better error for invalid concrete syntax of sorts with too many parens, like (Int...
authorMorgan Deters <mdeters@cs.nyu.edu>
Wed, 18 Jun 2014 16:02:37 +0000 (12:02 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Wed, 18 Jun 2014 16:02:37 +0000 (12:02 -0400)
src/parser/smt2/Smt2.g

index 63179cf42467c490368954edbf37f92af6e05d89..8590229a2017407e8abd7aec9a1212be8b4446ba 100644 (file)
@@ -1483,7 +1483,9 @@ sortSymbol[CVC4::Type& t, CVC4::parser::DeclarationCheck check]
     }
   | LPAREN_TOK symbol[name,CHECK_NONE,SYM_SORT] sortList[args] RPAREN_TOK
     {
-      if(name == "Array" &&
+      if(args.empty()) {
+        PARSER_STATE->parseError("Extra parentheses around sort name not permitted in SMT-LIB");
+      } else if(name == "Array" &&
          PARSER_STATE->isTheoryEnabled(Smt2::THEORY_ARRAYS) ) {
         if(args.size() != 2) {
           PARSER_STATE->parseError("Illegal array type.");