-
|
Hi, I'm wanting to reuse some yaml configuration files from another project for use with ryaml, but it seems like it can't handle there not being braces or no space between a parameter key and the value (as per below) The error claims the 2nd ':' is on the same line as the first. Once I add braces as per the quick start example, it then doesn't like the key and ':' not having a space between them, nor not having a coma between params at the same level. Modifying the yaml as below solves all the issues. Is it possible to use a yaml file without braces, without the proceeding spaces and the comas with ryaml? So it takes the cues from the indents, instead of punctuation? For reference, I am loading the yaml from file using the following snippet, in case it's more what I'm doing than any particular limitation of ryaml. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Figured it out: the get_line was removing the endlines (as it is used as a delimiter), so simply adding it back in when constructing the string holding the contents of the yaml solved it at the parsing level. However, it then seg faults when attempting to access the parameters (this doesn't happen when using the braces). |
Beta Was this translation helpful? Give feedback.
-
|
Re-opened once I realised that whilst adding the newlines back in solved the parsing error, the parameters couldn't be accessed: seg faulting |
Beta Was this translation helpful? Give feedback.
-
|
As this is, it's impossible to help you with the segfault. If you want any help, you need to provide a minimal example of the code that triggers the segfault. |
Beta Was this translation helpful? Give feedback.
-
|
Creating a minimal working example for here made me realise that the issue seemed to be caused by incorrectly setting the paths to the yaml needed, and not using the correct fields (working with too many test yamls) Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Creating a minimal working example for here made me realise that the issue seemed to be caused by incorrectly setting the paths to the yaml needed, and not using the correct fields (working with too many test yamls)
Thanks for your help!