Skip to content

Instantly share code, notes, and snippets.

@raphink
Created April 17, 2014 10:10
Show Gist options
  • Save raphink/10970910 to your computer and use it in GitHub Desktop.
Save raphink/10970910 to your computer and use it in GitHub Desktop.
module Sssd =
let entry = Build.key_value_line Rx.word Sep.space_equal (store Rx.word)
let rec subsection = [ Util.del_str "/" . key Rx.word
. ( subsection
| Util.del_str "]" . Util.eol . entry*)
]
let section = [ Util.del_str "[" . key Rx.word
. ( subsection
| Util.del_str "]" . Util.eol . entry*)
]
let lns = (section | Util.empty | Util.comment)*
test lns get
"
[sssd]
key = value
[domain/LDAP]
key = value
[domain/AD/BC]
key = value\n" =
{ "sssd" { "key" = "value" } }
{ "domain" { "LDAP" { "key" = "value" } } }
{ "domain" { "AD" { "key" = "value" } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment