23 lines
432 B
C++
23 lines
432 B
C++
#include <jjx.hpp>
|
|
#include <iostream>
|
|
|
|
using namespace jjx;
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc == 1) {
|
|
std::cerr << "Expected JSON input argument to parse" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
std::string in{argv[1]};
|
|
|
|
auto [ast, error] = json::parse(in);
|
|
if (error.size()) {
|
|
std::cerr << error << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
std::cout << json::deparse(ast);
|
|
return 0;
|
|
}
|