Add a new option to set an initial value for an attribute in each feature (#115)

* Starting on --set-attributes

* Add a JSON form to accumulate-attribute

* Fix formatting

* Set attributes, JSON form

* Also handle setting attributes to unquoted values

* Factoring out character-mangling in the names of tests

* Rename tests for new quoting convention

* Test for JSON form of attribute setting

* Test for JSON form of attribute accumulation

* Forgot to increment the version
This commit is contained in:
Erica Fischer
2023-07-14 10:47:55 -07:00
committed by GitHub
parent 48e769c94c
commit 1c3bd5352c
28 changed files with 1145 additions and 66 deletions
+5
View File
@@ -629,6 +629,11 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
exit(EXIT_IMPOSSIBLE);
}
for (auto &kv : set_attributes) {
sf.full_keys.push_back(kv.first);
sf.full_values.push_back(kv.second);
}
for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
coerce_value(sf.full_keys[i], sf.full_values[i].type, sf.full_values[i].s, sst->attribute_types);