diff --git a/test/test_files/basic_yaml_block.yaml b/test/test_files/basic_yaml_block.yaml index aa536c38..b61f32e3 100644 --- a/test/test_files/basic_yaml_block.yaml +++ b/test/test_files/basic_yaml_block.yaml @@ -2,7 +2,7 @@ - Boston Red Sox - Detroit Tigers - New York - Yankees + Yankees # this should be folded to "New York Yankees" ! national: - New York Mets - Chicago Cubs diff --git a/test/test_files/yaml_block_array1.yaml b/test/test_files/yaml_block_array1.yaml index 776374e9..0d79f4b9 100644 --- a/test/test_files/yaml_block_array1.yaml +++ b/test/test_files/yaml_block_array1.yaml @@ -1,4 +1,5 @@ -- Boston Red Sox -- Detroit Tigers -- New York Yankees +- A +- B +- C - [x, y, z] +- D \ No newline at end of file diff --git a/test/test_files/yaml_block_array2.yaml b/test/test_files/yaml_block_array2.yaml new file mode 100644 index 00000000..61c16179 --- /dev/null +++ b/test/test_files/yaml_block_array2.yaml @@ -0,0 +1,7 @@ +- A +- B +- C +- [x, y, z] +- D +- E : yabba dabba + diff --git a/yaml/parser/yaml_def.hpp b/yaml/parser/yaml_def.hpp index c77885bc..1c2e7898 100644 --- a/yaml/parser/yaml_def.hpp +++ b/yaml/parser/yaml_def.hpp @@ -88,7 +88,7 @@ namespace omd { namespace parser blocks %= save_indent - >> (block_main | restore_indent) + >> (block_main | !restore_indent) >> restore_indent ; @@ -111,7 +111,7 @@ namespace omd { namespace parser omit[*blank_line] // Ignore blank lines >> omit[repeat(_r1)[blank]] // Indent _r1 spaces >> omit['-' >> blank] // Get the sequence indicator '-' - >> flow_value // Get the value + >> yaml_nested // Get the entry ; auto block_map_indicator = // Lookahead and see if we have a