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

`[override]` tag doesn't seem to work if the value is an expression #141

Open michael-projectx opened 2 months ago

michael-projectx commented 2 months ago

Reproducible example:

In a.cfg:

struct foo {
  struct bar {
    a = ${{ 3 * 7.1 ** 2 }}
    b = 1.23
  }
}

In a_override.cfg:

struct foo {
  struct bar {
    a [[override]] = ${{ 2 * pi }}
  }
}

If a file includes a.cfg and a_override.cfg, then the parse will fail due to a duplicate key exception

If instead the value of a [[override]] in a_override.cfg is a simple number (e.g. 6.28), then the parsing passes as expected.