From: Morgan Deters Date: Fri, 8 Feb 2013 22:23:32 +0000 (-0500) Subject: Fix user-values in SMT-LIB v1.2 X-Git-Tag: cvc5-1.0.0~7418 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3162008b628174bd8bce70b336ce928e88ae07c6;p=cvc5.git Fix user-values in SMT-LIB v1.2 --- diff --git a/src/parser/smt1/Smt1.g b/src/parser/smt1/Smt1.g index 0f76baace..e3c36cf91 100644 --- a/src/parser/smt1/Smt1.g +++ b/src/parser/smt1/Smt1.g @@ -783,7 +783,15 @@ FLET_IDENTIFIER */ userValue[std::string& s] : USER_VALUE - { s = AntlrInput::tokenText($USER_VALUE); } + { s = AntlrInput::tokenText($USER_VALUE); + assert(*s.begin() == '{'); + assert(*s.rbegin() == '}'); + // trim whitespace + s.erase(s.begin(), s.begin() + 1); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(std::isspace)))); + s.erase(s.end() - 1); + s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(std::isspace))).base(), s.end()); + } ; PATTERN_ANNOTATION_BEGIN