Better get-value parse error message for common user error.
authorMorgan Deters <mdeters@cs.nyu.edu>
Mon, 16 Dec 2013 14:49:05 +0000 (09:49 -0500)
committerMorgan Deters <mdeters@cs.nyu.edu>
Tue, 24 Dec 2013 17:51:14 +0000 (12:51 -0500)
src/parser/smt2/Smt2.g

index e2e52b1580070a232c4b0e183a6225aee647d49d..13850aba6962fdf89000f816e3ff69de0daa85b9 100644 (file)
@@ -336,8 +336,10 @@ command returns [CVC4::Command* cmd = NULL]
     }
   | /* value query */
     GET_VALUE_TOK { PARSER_STATE->checkThatLogicIsSet(); }
-    LPAREN_TOK termList[terms,expr] RPAREN_TOK
-    { $cmd = new GetValueCommand(terms); }
+    ( LPAREN_TOK termList[terms,expr] RPAREN_TOK
+      { $cmd = new GetValueCommand(terms); }
+    | term[expr, expr2]
+      { PARSER_STATE->parseError("The get-value command expects a list of terms.  Perhaps you forgot a pair of parentheses?"); } )
   | /* get-assignment */
     GET_ASSIGNMENT_TOK { PARSER_STATE->checkThatLogicIsSet(); }
     { cmd = new GetAssignmentCommand(); }