26 lines
575 B
C++
26 lines
575 B
C++
#include <fmt/format.h>
|
|
|
|
#include "CalculatorCli.hpp"
|
|
|
|
constexpr std::array kInitialCommands{
|
|
std::string_view{"a = 2 + 3"},
|
|
std::string_view{"b = e - 2"},
|
|
std::string_view{"c = 1 + 2"},
|
|
std::string_view{"d = e / 3"},
|
|
std::string_view{"e = a + c"},
|
|
std::string_view{"f = 3 + 4"},
|
|
std::string_view{"undo 2"},
|
|
std::string_view{"e = 2 + 2"},
|
|
std::string_view{"f = g * 7"},
|
|
};
|
|
|
|
auto main() -> int
|
|
{
|
|
CalculatorCli cli;
|
|
for (const auto commands : kInitialCommands) {
|
|
cli.parse(commands);
|
|
}
|
|
cli.runLoop();
|
|
return 0;
|
|
}
|