[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: YAML parser?

From: Matt Wette
Subject: Re: YAML parser?
Date: Tue, 24 Mar 2020 18:04:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 3/4/20 6:21 AM, Matt Wette wrote:
On 2/23/20 7:29 AM, Matt Wette wrote:
On 2/21/20 8:12 PM, Aleix Conchillo Flaqué wrote:

does anyone know if there's any YAML parser for Guile? Haven't been able to
find any.



Hi Aleix,

I don't know of a YAML parser for Guile, but if you look at my email posted 2/22 I have a Guile package called NYACC.  This includes a "FFI Helper" that can generate the Guile FFI code based on yaml.h from libyaml.   The API is going to be C-like but if you do some
work to paste something on the front you will have something, I think.

I have something working for reads.   Check github dot com / mwette / guile-libyaml

Download and run "guile demo1.scm".  Compare to demo1.yml.


I have updated this.   I now have a procedure read-yaml-file which will read a yaml file and convert to a scheme tree.


$ GUILE_LOAD_PATH= guile demo1.scm
(("doe" . "a deer, a female deer")
 ("ray" . "a drop of golden sun")
 ("pi" . "3.14159")
 ("xmas" . "true")
 ("french-hens" . "3")
  #("huey" "dewey" "louie" "fred"))
  ("calling-birds" . "four")
  ("french-hens" . "3")
  ("golden-rings" . "5")
   ("count" . "1")
   ("location" . "a pear tree"))
  ("turtle-doves" . "two"))


$ cat demo1.yml
 doe: "a deer, a female deer"
 ray: "a drop of golden sun"
 pi: 3.14159
 xmas: true
 french-hens: 3
   - huey
   - dewey
   - louie
   - fred
   calling-birds: four
   french-hens: 3
   golden-rings: 5
     count: 1
     location: "a pear tree"
   turtle-doves: two

reply via email to

[Prev in Thread] Current Thread [Next in Thread]