Blame lenses/postfix_access.aug
|
Packit Service |
a2ae7a |
(* Parsing /etc/postfix/access *)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Postfix_Access =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let sep_tab = Util.del_ws_tab
|
|
Packit Service |
a2ae7a |
let sep_spc = Util.del_ws_spc
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let eol = del /[ \t]*\n/ "\n"
|
|
Packit Service |
a2ae7a |
let indent = del /[ \t]*/ ""
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let char = /[^# \n\t]/
|
|
Packit Service |
a2ae7a |
let text =
|
|
Packit Service |
a2ae7a |
let cont = /\n[ \t]+/ in
|
|
Packit Service |
a2ae7a |
let any = /[^#\n]/ in
|
|
Packit Service |
a2ae7a |
char | (char . (any | cont)* .char)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let word = char+
|
|
Packit Service |
a2ae7a |
let record = [ seq "spec" .
|
|
Packit Service |
a2ae7a |
[ label "pattern" . store word ] . sep_tab .
|
|
Packit Service |
a2ae7a |
[ label "action" . store word ] .
|
|
Packit Service |
a2ae7a |
[ label "parameters" . sep_spc . store text ]? . eol ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let lns = ( empty | comment | record )*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns (incl "/etc/postfix/access" . incl "/usr/local/etc/postfix/access")
|