Allow running Eldarica from the command line

This commit is contained in:
Leo Alt
2022-11-22 21:16:45 +01:00
parent be8ecb17d8
commit 24df40de9a
67 changed files with 386 additions and 3187 deletions
+2 -2
View File
@@ -653,7 +653,7 @@ void CommandLineInterface::processInput()
{
solAssert(m_standardJsonInput.has_value());
StandardCompiler compiler(m_fileReader.reader(), m_options.formatting.json);
StandardCompiler compiler(m_universalCallback.callback(), m_options.formatting.json);
sout() << compiler.compile(std::move(m_standardJsonInput.value())) << endl;
m_standardJsonInput.reset();
break;
@@ -692,7 +692,7 @@ void CommandLineInterface::compile()
{
solAssert(CompilerInputModes.count(m_options.input.mode) == 1);
m_compiler = make_unique<CompilerStack>(m_fileReader.reader());
m_compiler = make_unique<CompilerStack>(m_universalCallback.callback());
SourceReferenceFormatter formatter(serr(false), *m_compiler, coloredOutput(m_options), m_options.formatting.withErrorIds);
+4
View File
@@ -27,6 +27,8 @@
#include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/DebugSettings.h>
#include <libsolidity/interface/FileReader.h>
#include <libsolidity/interface/UniversalCallback.h>
#include <libsolidity/interface/SMTSolverCommand.h>
#include <libyul/YulStack.h>
#include <iostream>
@@ -138,6 +140,8 @@ private:
std::ostream& m_serr;
bool m_hasOutput = false;
FileReader m_fileReader;
SMTSolverCommand m_solverCommand{"eld"};
UniversalCallback m_universalCallback{m_fileReader, m_solverCommand};
std::optional<std::string> m_standardJsonInput;
std::unique_ptr<frontend::CompilerStack> m_compiler;
CommandLineOptions m_options;
+1 -1
View File
@@ -828,7 +828,7 @@ General Information)").c_str(),
)
(
g_strModelCheckerSolvers.c_str(),
po::value<string>()->value_name("all,cvc4,z3,smtlib2")->default_value("all"),
po::value<string>()->value_name("cvc4,eld,z3,smtlib2")->default_value("z3"),
"Select model checker solvers."
)
(