miker2 / flexi_config_reader

A flexible configuration format that supports templated tables and referencing of existing keys.
MIT License
3 stars 1 forks source link

Try resolving reference before merging nested structures #29

Closed miker2 closed 2 years ago

miker2 commented 2 years ago

It makes complete sense to be able to merge structs. Merging a struct and a reference can also work, but makes a bit less sense (existing keys in a struct are like added reference keys ('+' key syntax).

Merging two references makes no sense (especially if they are referencing different protos). Merging protos also doesn't make sense (these aren't concrete structs anyway).

It does make sense to have two references with the same name, referring to different protos, turning those into concrete structs and then merging those structs if able.

Try moving the call to mergeNested after resolveReferences.