Create String formatting function for JavaScript export, similar to CIF fmt / Java format
See discussion: eclipse/escet/escet!686 (merged)
For the JavaScript export feature utils class, we need a fmt() function for String formatting, that has the same capabilities as CIF's fmt() / Java's format(). This is so that we can log the same things for JavaScript as for other platforms / ESCET simulator. Currently, the fmt() function only supports %s and %d, we'll need to expand this.
See: https://eclipse.dev/escet/cif/tools/cifsim/output/print/ref-fmt.html
The realToStr() function in the same file also requires a String formatting function:
- Format this to CIF syntax: (0|[1-9][0-9]*)(.[0-9]+|(.[0-9]+)?[eE][-+]?[0-9]+)
Initially, I've implemented only the functionality required for the exports I've been testing with (so, %s and %d). Will have to implement this properly, but since it looked like it might be a sizeable separate task (to support all the notations for Java format / CIF's fmt), I've left it out initially and have added only the minimum implementation, so as to complete higher prio tasks first.