yaml / yaml-test-suite

Comprehensive, language independent Test Suite for YAML
MIT License
172 stars 58 forks source link

4FJ6 events #130

Closed matajoh closed 5 months ago

matajoh commented 5 months ago

I'm somewhat confused by the 4FJ6 test case and can't find the answer in the spec, so I thought I'd ask here. The test case specifies that for this input:

---
[
  [ a, [ [[b,c]]: d, e]]: 23
]

The events are:

+STR
+DOC ---
+SEQ []
+MAP {}
+SEQ []
=VAL :a
+SEQ []
+MAP {}
+SEQ []
+SEQ []
=VAL :b
=VAL :c
-SEQ
-SEQ
=VAL :d
-MAP
=VAL :e
-SEQ
-SEQ
=VAL :23
-MAP
-SEQ
-DOC
-STR

however, I would have thought that the two maps here which use sequences as colons are not flow style (i.e. no curly braces). Is it the case that the "flow" style is inherited by all child maps and sequences?

perlpunk commented 5 months ago

Yes, everything inside flow is also flow automatically. The inner maps are implicit. Of course it would be an option to change the events in this case, so that such implicit mappings can be marked as such in the event output, but this would require that libraries make this distinction in order to pass the test suite.

matajoh commented 5 months ago

Thank you for the clarification!