If a configuration variable starts with numbers and has a character
that such as K/k/G/g/etc.. it would assume that it was a number
(expressed in Kb, Gb, etc..).
This PR checks that if the special characters are not the suffix,
that is, the variable does not end after those characters, then
the parsing will treat the whole thing as a string.
Resolves#3431
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
The configuration format from the server is almost already a superset
of JSON with exception of two cases:
1) trailing commas from values at the top level (although they are
supported inside of maps)
2) initial and final brackets on the top level section.
This change relaxes the two cases above to just skip those tokens so
that the config syntax can also support valid JSON objects for
configuring the server which might be helpful when generating it
programmatically.
This involves evaluating and interpolating \-escaped sequences
in double-quoted and undelimited strings.
Added tests on various edge-conditions, as well as ruling out bare
strings like '\true' as a bool.
This allows blocked scoped variables to be set and retrieved as values using the $ prefix.
e.g. foo = 22; bar = $foo
Also supports env variables being used as variables and will properly parse to the correct type.