Allow the empty field separator to be empty; use in config framework.

This small change allows the empty field separator to be empty. This
means that we can represent an empty list by a empty input string, which
was not possible before.

Before, an empty empty field separator meant that there is no empty
field - to get back to this behavior one now has to set the empty field
separator to a string that is guaranteed to not be part of the input
data. Note that we did not use "empty" empty field separators anywhere
and I am not aware of this being used by anyone - the new behavior seems
like it is much more useful in practice.

This also changes the config framework to interpret empty lists as...
empty, instead of interpreting them as lists that have one zero-length
element; this seems like the saner default.
This commit is contained in:
Johanna Amann 2018-01-29 10:21:25 -08:00
parent 01005e99af
commit 196994a48d
4 changed files with 8 additions and 2 deletions

View file

@ -329,6 +329,9 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
if ( separators.empty_field.size() > 0 && s.compare(separators.empty_field) == 0 )
length = 0;
if ( separators.empty_field.empty() && s.empty() )
length = 0;
threading::Value** lvals = new threading::Value* [length];
if ( type == TYPE_TABLE )