diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-01 15:52:32 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-01 15:52:32 +0200 |
commit | d5d8213871d8cb68b2e4ef9b3557879c80ff5b51 (patch) | |
tree | 03b1c06d747986941187e2b5d72cc2f93ac2702b /json/jsonwrite.cc | |
parent | ccbe2dd18d12d9d201afd5499e9e70ed8d2539de (diff) | |
download | nextpnr-d5d8213871d8cb68b2e4ef9b3557879c80ff5b51.tar.gz nextpnr-d5d8213871d8cb68b2e4ef9b3557879c80ff5b51.tar.bz2 nextpnr-d5d8213871d8cb68b2e4ef9b3557879c80ff5b51.zip |
Added support for attributes/properties types
Diffstat (limited to 'json/jsonwrite.cc')
-rw-r--r-- | json/jsonwrite.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc index bedb2449..8c1f914f 100644 --- a/json/jsonwrite.cc +++ b/json/jsonwrite.cc @@ -48,13 +48,16 @@ std::string get_name(IdString name, Context *ctx) return get_string(name.c_str(ctx)); } -bool write_parameters(std::ostream &f, Context *ctx, const std::unordered_map<IdString, std::string> ¶meters, bool for_module=false) +bool write_parameters(std::ostream &f, Context *ctx, const std::unordered_map<IdString, Property> ¶meters, bool for_module=false) { bool first = true; for (auto ¶m : parameters) { f << stringf("%s\n", first ? "" : ","); f << stringf(" %s%s: ", for_module ? "" : " ", get_name(param.first,ctx).c_str()); - f << get_string(param.second); + if (param.second.isString()) + f << get_string(param.second); + else + f << param.second.num; first = false; } return first; |