flyx / NimYAML

YAML implementation for Nim
https://nimyaml.org
Other
186 stars 36 forks source link

Handle multi-line arrays #103

Closed jfilby closed 2 years ago

jfilby commented 2 years ago

Currently the only way to handle parsing arrays seems to be when they are on a single line, e.g.:

- myArray: [ This, is, a, test ]

This article highlights some alternatives that should parse: https://newbedev.com/yaml-multi-line-arrays

For example:

- myArray:
  - This
  - is
  - a
  - test

However this doesn't parse successfully with NimYAML.

flyx commented 2 years ago

This should work. In fact, both inputs yield the exact same output on the testing ground as they should. Your problem is likely something else. Have you checked whether you accidentally used tabs for indentation?

If that isn't the problem, try to provide a more complete example with code that works with the first but fails with the second input, and describe the error you get. From what you currently provide, I cannot reproduce any error.

flyx commented 2 years ago

Closing due to missing feedback, unclear what the error is.