FIX: JSON remove space before symbols + quote values

issue#70
Winant Pablo 2017-02-12 12:54:58 +01:00
parent 64642d928c
commit 96b35ff078
2 changed files with 5 additions and 5 deletions

View File

@ -66,9 +66,9 @@ InitParamStatement::writeJuliaOutput(ostream &output, const string &basename)
void void
InitParamStatement::writeJsonOutput(ostream &output) const InitParamStatement::writeJsonOutput(ostream &output) const
{ {
output << "{\"statementName\": \"param_init\", \"name\": \"" << symbol_table.getName(symb_id) << "\", " << "\"value\": "; output << "{\"statementName\": \"param_init\", \"name\": \"" << symbol_table.getName(symb_id) << "\", " << "\"value\": \"";
param_value->writeOutput(output); param_value->writeOutput(output);
output << "}"; output << "\"}";
} }
void void

View File

@ -1025,9 +1025,9 @@ SymbolTable::writeJsonVarVector(ostream &output, const vector<int> &varvec) cons
for (int i = 0; i < varvec.size(); i++) for (int i = 0; i < varvec.size(); i++)
{ {
output << endl << "{" output << endl << "{"
<< "\"name\":\" " << getName(varvec[i]) << "\", " << "\"name\":\"" << getName(varvec[i]) << "\", "
<< "\"texName\":\" " << boost::replace_all_copy(getTeXName(varvec[i]), "\\", "\\\\") << "\", " << "\"texName\":\"" << boost::replace_all_copy(getTeXName(varvec[i]), "\\", "\\\\") << "\", "
<< "\"longName\":\" " << boost::replace_all_copy(getLongName(varvec[i]), "\\", "\\\\") << "\"}"; << "\"longName\":\"" << boost::replace_all_copy(getLongName(varvec[i]), "\\", "\\\\") << "\"}";
if (i < varvec.size() - 1) if (i < varvec.size() - 1)
output << ", "; output << ", ";
} }