summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-12-16 03:33:03 -0600
committerGitHub <noreply@github.com>2020-12-16 10:33:03 +0100
commit5b90fdad09209da667cc281f5425300a4b2bb9c9 (patch)
tree4e7140050faf3bbc03ae08b4fe7c0286b3c2ecaf /src/parser
parentaac53f510e1f21a46a49cb31475a8851a3097089 (diff)
Use uint64 utility when parsing tuple selectors in smt2 (#5681)
The smt2 parser is now 100% independent from the Expr-layer.
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/smt2/smt2.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp
index 2474c89c2..f069a486f 100644
--- a/src/parser/smt2/smt2.cpp
+++ b/src/parser/smt2/smt2.cpp
@@ -18,7 +18,6 @@
#include <algorithm>
#include "base/check.h"
-#include "expr/expr.h"
#include "options/options.h"
#include "parser/antlr_input.h"
#include "parser/parser.h"
@@ -1072,13 +1071,11 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector<api::Term>& args)
else if (p.d_kind == api::APPLY_SELECTOR && !p.d_expr.isNull())
{
// tuple selector case
- std::string indexString = p.d_expr.toString();
- Integer x = p.d_expr.getExpr().getConst<Rational>().getNumerator();
- if (!x.fitsUnsignedInt())
+ if (!p.d_expr.isUInt64())
{
- parseError("index of tupSel is larger than size of unsigned int");
+ parseError("index of tupSel is larger than size of uint64_t");
}
- unsigned int n = x.toUnsignedInt();
+ uint64_t n = p.d_expr.getUInt64();
if (args.size() != 1)
{
parseError("tupSel should only be applied to one tuple argument");
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback