I want to read config in YAML with elisp code. Searched but didn't find ready-to-use parser in elisp. Did I miss something useful?
Three years later, we have dynamic modules, and emacs-libyaml looks pretty interesting. It uses the dynamic module system to expose the C bindings of libyaml in Elisp. I would expect the performance to be fantastic, although I haven't tested it.
Six months later, it appears that the answer is "there exists no solid easily-available elisp YAML parser."
If you really want to read a YAML document in elisp and turn it into something that elisp can interact with, you're going to have to put in some gnarly work. The EmacsWiki YAML page hasn't got much for you, and the canonical YAML mode has syntax hints, but no actual parser. Fortunately someone has implemented a YAML-parsing web-app that takes YAML and outputs JSON or Python - you could try to get a look under the hood of that and-or use it to check any YAML parser you may write yourself.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With