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

Add infix math support #33

Closed miker2 closed 2 years ago

miker2 commented 2 years ago

See https://github.com/taocpp/PEGTL/blob/main/src/example/pegtl/calculator.cpp as a starting point.

We should support maths of both numbers & variables.

Possible syntax:

Given the order in which $VAR and $(var) are resolved, we probably want to detect maths during the config grammar parse, resolve all $VAR and $(var) instances, then evaluate the maths at the end.