From f42dcea977ed9180481cc842531e2c5372acbbe1 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Mon, 16 Dec 2013 09:49:05 -0500 Subject: [PATCH] Better get-value parse error message for common user error. --- src/parser/smt2/Smt2.g | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index e2e52b158..13850aba6 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -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(); } -- 2.30.2