Add: Multiple-time and recursive dereferencing of config parser. #1938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In-string references will be supported now then.
Specifically, config parser will dereference all references shown in a field. Besides, if there are nested references, it will dereference them recursively until there is no "${}" left.
Though this cause some uncompatibility. If someone wrote "${}" in a 'exec' script, config parser will try to dereference it. One has to add another '$' before "${}" to get avoid of this. That is, one should use "$${}" if he wants to use "${" without being dereferenced.
This commit is experiment with the following config file:
[A]
a1 = a1
a2 = a2
a3 = a3
a4 = a4
[B]
b1 = ${A.a1}
b2 = b2${A.a2}
b3 = ${A.a3}b3
b4 = b4${A.a4}b4
[C]
c1 = ${B.b1}
c2 = c2${B.b2}
c3 = ${B.b3}c3
c4 = c4${B.b4}c4
[bar/bar]
a1 = ${A.a1}
a2 = ${A.a2}
a3 = ${A.a3}
a4 = ${A.a4}
b1 = ${B.b1}
b2 = ${B.b2}
b3 = ${B.b3}
b4 = ${B.b4}
c1 = ${C.c1}
c2 = ${C.c2}
c3 = ${C.c3}
c4 = ${C.c4}
d1 = d1${C.c1}${C.c1}
d2 = ${C.c2}${C.c2}d2
d3 = d3${C.c3}d3${C.c3}
d4 = ${C.c4}${C.c4}d4
e1 = ${A.${A.${A.a1}}}
e2 = e2${A.${A.a2}}
f1 = $$f1
f2 = $$${C.c2}
f3 = $${C.c3}
Maintainer EDIT:
Fixes #954