From 3162008b628174bd8bce70b336ce928e88ae07c6 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Fri, 8 Feb 2013 17:23:32 -0500 Subject: [PATCH] Fix user-values in SMT-LIB v1.2 --- src/parser/smt1/Smt1.g | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.30.2