Closed jslee02 closed 4 years ago
This is looking much better -- but it seems like the
markLast
behavior should not be recursive, right?
I think it's necessary if we want to mark every last map element for all the nested map sequences.
For example:
classes
- name: ClassA
- name: ClassB
bases:
- BaseA
- BaseB
- BaseC
last: true
- name: ClassC
last: true
Hmm.. should we just make a mangled name like __last
and always mark the end of sequences?
I am worried that this behavior is a bit inconsistent if it is only applied to a few locations. Here it is only applied to the nested contents of bases()
! :thinking:
Hmm.. should we just make a mangled name like
__last
and always mark the end of sequences?
Make sense to me since #105 is one case that caused by inconsistency.
Chimera uses
{{last}}
in each template to indicate whether the parent map in a sequence is the last entry. However, this convention is not obeyed when parsing sequence in configuration YAML usingwrapYAMLNode()
.This PR fixes the issue by updating
wrapYAMLNode()
to take an optional flag whether to insertlast: true
entry for the last map entry in a sequence.Fixes #105