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

Support for a list of lists #93

Closed michael-projectx closed 1 year ago

michael-projectx commented 1 year ago

Currently the grammar seems to support lists containing other lists, but somewhere in the code things are broken. Need to identify where this occurs and fix it.

miker2 commented 1 year ago

Did some digging and it appears that lists of lists can be parsed without issue (e.g. the grammar supports this), but the reader does not have support for lists of lists. The current getValue function needs some modifications in order to support nested calls s.t. a vector of vectors or an array of arrays can be read properly from the underlying data structure.

miker2 commented 1 year ago

Note to self: Further tests need to be added in order to verify that the parsing logic works properly for list of lists. A simple list like this was tested:

multi_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

But it needs to be verified whether something like this would work:

multi_list_mixed = [[1, 2, 3], ["a", "b", "c"], [1.3, 1.5, 1.7]]

I don't think that the above should be supported as I think we want homogenous lists only.

miker2 commented 1 year ago

Found a few small issues during further testing which warrant a fix. Specifically, some of the existing assert calls should be converted to exceptions. Also, added a deeply nested (3-layer) std::vector.