aboutsummaryrefslogtreecommitdiffstats
path: root/common/command.cc
diff options
context:
space:
mode:
Diffstat (limited to 'common/command.cc')
-rw-r--r--common/command.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/common/command.cc b/common/command.cc
index fd310789..c2f02b27 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -35,7 +35,7 @@
#include <iostream>
#include "command.h"
#include "design_utils.h"
-#include "jsonparse.h"
+#include "json_frontend.h"
#include "jsonwrite.h"
#include "log.h"
#include "timing.h"
@@ -265,9 +265,8 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
if (vm.count("json")) {
std::string filename = vm["json"].as<std::string>();
std::ifstream f(filename);
- if (!parse_json_file(f, filename, w.getContext()))
+ if (!parse_json(f, filename, w.getContext()))
log_error("Loading design failed.\n");
-
customAfterLoad(w.getContext());
w.notifyChangeContext();
w.updateActions();
@@ -284,7 +283,7 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
if (vm.count("json")) {
std::string filename = vm["json"].as<std::string>();
std::ifstream f(filename);
- if (!parse_json_file(f, filename, ctx.get()))
+ if (!parse_json(f, filename, ctx.get()))
log_error("Loading design failed.\n");
customAfterLoad(ctx.get());
@@ -382,12 +381,6 @@ int CommandHandler::exec()
return 0;
std::unordered_map<std::string, Property> values;
- if (vm.count("json")) {
- std::string filename = vm["json"].as<std::string>();
- std::ifstream f(filename);
- if (!load_json_settings(f, filename, values))
- log_error("Loading design failed.\n");
- }
std::unique_ptr<Context> ctx = createContext(values);
setupContext(ctx.get());
setupArchContext(ctx.get());
@@ -404,17 +397,12 @@ std::unique_ptr<Context> CommandHandler::load_json(std::string filename)
{
vm.clear();
std::unordered_map<std::string, Property> values;
- {
- std::ifstream f(filename);
- if (!load_json_settings(f, filename, values))
- log_error("Loading design failed.\n");
- }
std::unique_ptr<Context> ctx = createContext(values);
setupContext(ctx.get());
setupArchContext(ctx.get());
{
std::ifstream f(filename);
- if (!parse_json_file(f, filename, ctx.get()))
+ if (!parse_json(f, filename, ctx.get()))
log_error("Loading design failed.\n");
}
customAfterLoad(ctx.get());