(* Parsing /etc/modules.autoload.d/* *)

module ModulesAutoload=
  autoload xfm

  let sep_tab = Util.del_ws_tab
  let sep_spc = Util.del_ws_spc
  let eol = Util.eol
  let indent = Util.indent
  let s = Sep.space
  let comment = Util.comment
  let word = Rx.word | Rx.integer
  let empty   = Util.empty
  let eq = Util.del_str "="

  let optword = /[^ \t\n#:]+/

  let opt = [ key word . ( eq . store optword | empty ) ]

  let record = [ key word . (s . Build.opt_list opt s)? . eol ]

  let lns = ( empty | comment | record ) *


  let xfm = transform lns (
    incl "/etc/modules.autoload.d/*" .
    Util.stdexcl
  )

