1 (* Parsing /etc/hosts *)
6 let sep_tab = Util.del_ws_tab
7 let sep_spc = Util.del_ws_spc
10 let indent = Util.indent
12 let comment = Util.comment
13 let comment_or_eol = Util.comment_or_eol
14 let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
16 let word = /[^# \n\t]+/
17 let record = [ seq "host" . indent .
18 [ label "ipaddr" . store word ] . sep_tab .
19 [ label "canonical" . store word ] .
20 [ label "alias" . sep_spc . store word ]*
23 let lns = ( empty | comment | record ) *
25 let xfm = transform lns (incl "/etc/hosts")