Skip to content

structure: Add support for brackets as nested structures/caps specifiers

This introduces a more human friendly syntax to specify nested structures It does so by using 2 different markers for opening and closing them instead of abusing quotes which lead to requiring an insane amount of escaping to match nesting levels.

The brackets ([ and ]) have been chosen as they avoid complex constructions with curly brackets (or lower/higher than signs) where you could have structures embedded inside arrays (which also use curly brackets), ie. s, array=(structure){{struct}} should be parsed as an array of structures, but the cast seems to imply something different. We do not have this issue with brackets as they are currently used for ranges, which can only be casted to numeric types.

This commit does not make use of that new syntax for serialization as that would break backward compatibility, so it is basically a 'sugar' syntax for humans. A notice has been explicitly made in the documentation to let the user know about it.

Edited by Thibault Saunier

Merge request reports