From 0720ea721663177c3919eb2415dccdcc018f5c73 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Wed, 18 Jun 2014 12:02:37 -0400 Subject: [PATCH] Better error for invalid concrete syntax of sorts with too many parens, like (Int). Thanks to Dan Liew for the report. --- src/parser/smt2/Smt2.g | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 63179cf42..8590229a2 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -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."); -- 2.30.2