Uses Build.opt_list to generate a list of labels
let label_opt_list (l:string) (r:lens) (s:lens) = Build.opt_list [ label l . r ] s
Either label_opt_list matches something or it emits a single label with the “or” string.
let label_opt_list_or (l:string) (r:lens) (s:lens) (or:string) = ( label_opt_list l r s | [ label l . store or ] )
let langs = let lang = [ label "lang" . store Rx.word ] in Build.opt_list lang plus
ldif-attrval-record = dn-spec SEP 1*attrval-spec
let ldif_attrval_record = [ seq "record" . attr_dn . ( sep_line* . attr_val_spec )+ ]
ldif-change-record = dn-spec SEP *control changerecord
let ldif_change_record = [ seq "record" . attr_dn . ( ( sep_line | change_control )* . change_control )? . sep_line* . change_record ]
ldif-changes = version-spec 1*(1*SEP ldif-change-record)
let ldif_changes = [ label "@changes" . ( sep_record . attr_version )? . ( sep_record . ldif_change_record )+ . sep_record ]
ldif-content = version-spec 1*(1*SEP ldif-attrval-record)
let ldif_content = [ label "@content" . ( sep_record . attr_version )? . ( sep_record . ldif_attrval_record )+ . sep_record ]
A generic block with a title lens.
let lens_block (title:lens) (sto:lens) = [ indent . title . Build.block_newlines sto comment . eol ]
A simple, uncommented, line
let line = let line_re = /[^# \t\n].*[^ \t\n]|[^# \t\n]/ in [ seq "line" . Util.indent . store line_re . Util.eol ]
Build a list of identical lenses separated with a given separator (at least 2 elements)
let list (lns:lens) (sep:lens) = lns . ( sep . lns )+
A list of lenses
let list (kw:regexp) (lns:lens) = [ rspace lbrace . key kw . lrspace comma . opt_list lns . lspace rbrace ]
A list of items
let list (kw:regexp) (elem:string) = let list_elems = Build.opt_list [seq elem . store Rx.word] (Sep.comma) in Build.key_value_line kw Sep.space list_elems
A list of values
let list (kw:string) (val:regexp) = let item = [ seq kw . store val ] in let comma = del /[ \t]*,[ \t]*/ ", " in [ Util.indent . key kw . Sep.space . Build.opt_list item comma . Util.comment_or_eol ]
let list = Build.list [ key Rx.word ] Sep.space
A list entry
let list = let entry = [ label "entry" . store Rx.no_spaces ] in let entry_list = Build.opt_list entry Sep.space in [ key /PRUNE(FS|NAMES|PATHS)/ . Sep.space_equal . Quote.do_dquote entry_list . Util.doseol ]
let list_item = store ( Rx.word - /EXCEPT/i )
let list_sep = del ( comma_sep | ws_sep ) ", "
A list of values with given lens
let list_sto (kw:regexp) (lns:lens) = counter "item" . entry kw (Build.opt_list [lns] Sep.comma)
listen on address [rtable table-id]
let listen = let addr = [ label "address" . store address_re ] in key_opt_rtable_line "listen on" addr
A tcp/ssl listener
let listeners = let value = Erlang.make_value Erlang.integer | Erlang.tuple Erlang.quoted Erlang.integer in Erlang.list /(tcp|ssl)_listeners/ value
Uses standard INI File lens
let lns = IniFile.lns record comment
The access.conf lens, any amount of
let lns = (comment|empty|entry) *
let lns = (Util.empty | Util.comment | entry | empty_entry )*
let lns = (empty | comment | entry)*
let lns = (comment | empty | alias)*
The anacron lens
let lns = ( Util.empty | Util.comment | shellvar | entry )*
let lns = (empty | comment | kv) *
let lns = IniFile.lns record comment
The apt.conf lens
let lns = (empty|comment|entry|include|clear)*
let lns = Util.empty* . (Build.opt_list record Util.eol+ . Util.empty*)?
let lns = ( comment | empty | record ) *
The authorized_keys lens
let lns = ( Util.empty | Util.comment | authorized_key)*
let lns = ( empty | comment | map_mount | map_master ) *
let lns = ( empty | comment | entry | include ) *
let lns = IniFile.lns record comment
let lns = ( Util.empty | Util.comment | record ) *
let lns = ( empty | comment | command | single_command )*
let lns = (empty | comment | cacheconfig | nocull_entry)*
The main lens, any amount of
let lns = ( empty | comment | user_record | group_record )*
let lns = entry_or_comment* . group*
The crony lens
let lns = ( empty | comment | settings )*
Collectd is essentially Httpd-compliant configuration files
let lns = Httpd.lns
The CPanel lens
let lns = (Util.comment | Util.empty | kv)*
The cron lens
let lns = ( empty | comment | shellvar | entry )*
The crypttab lens
let lns = ( empty | comment | record ) *
let lns = Httpd.lns
The Dovecot lens
let lns = (comment|empty|entry|command|block)*
Any number of empty lines, comments, and records.
let lns = ( empty | comment | record ) *
let lns = Xml.lns
The fuse.conf lens
let lns = ( Util.empty | Util.comment | mount_max | user_allow_other )*
let lns = (comment | empty | menu_setting | debian)* . (boot . (comment | empty | boot)*)?
let lns = (empty | entry)*
let lns = ( Util.empty | Util.comment | entry )*
let lns = [ label "hostname" . store Rx.word . Util.eol ]
let lns = (Util.empty | Util.comment | entry)*
Generic INI File lens
let lns (record:lens) (comment:lens) = lns_noempty record (comment|empty)
The inputrc lens
let lns = (Util.empty | Util.comment | condition | variable | entry)*
let lns = ( Util.comment | Util.empty | realm_entry )*
let lns = ( Util.comment | Util.empty | access_entry )*
let lns = ( Util.comment | Util.empty | pass_entry )*
The options lens
let lns = ( empty | comment | option )*
The keepalived lens
let lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*
The known_hosts lens
let lns = (Util.empty | Util.comment | entry)*
let lns = sep_record | ldif_content | ldif_changes
The login.defs lens
let lns = (record | Util.comment | Util.empty) *
The main lens
let lns = (nondef | def)*
The mke2fs lens
let lns = (empty|comment)* . (defaults|fs_types)*
let lns = (comment|empty|entry)*
let lns = ( Util.empty | Util.comment | record ) *
let lns = (Util.empty | Util.comment | entry)*
main structure
let lns = ( Util.empty | Util.comment | entry )*
let lns = ( empty | comment | entry )*
let lns = ( Util.empty | Util.comment | entry )*
let lns = ( Util.comment | Util.empty | directive )*
The Nrpe lens
let lns = ( command | include | include_dir | item | comment | empty ) *
let lns = ( empty | comment | database )*
let lns = ( empty | comment | keyword )*
let lns = (Util.empty | Util.comment | primary_entry | empty_entry )*
let lns = Httpd.lns
let lns = (Util.empty | json )*
The pbuilder lens
let lns = Shellvars.lns
The pg_hba.conf lens
let lns = ( record | Util.comment | Util.empty ) *
let lns = (Util.empty | Util.comment | record)*
let lns = (Util.empty | Util.comment | record)*
let lns = (Util.empty | Util.comment | entry)*
The protocols lens
let lns = (Util.empty | Util.comment | entry)*
let lns = (Util.empty | Util.comment | record)*
the Puppetfile lens
let lns = (Util.empty | Util.comment | forge | metadata | mod)*
let lns = (Util.empty | Util.comment | entry)*
A top-level Erlang.config
let lns = Erlang.config rabbit
The Redis lens
let lns = (comment | empty | entry )*
The lens is made of Util.empty, Util.comment and entry lines
let lns = (Util.empty|Util.comment|entry)*
let lns = ( empty | comment | entry )*
An IniFile.lns
let lns = IniFile.lns record comment
The services lens is either empty, comment or record
let lns = ( empty | comment | record )*
The shells lens
let lns = ( empty | comment | shell )*
The simplelines lens
let lns = (Util.empty | Util.comment | line)*
let lns = (Util.empty | Util.comment | entry)*
let lns = (Util.empty | Util.comment | entry)*
let lns = ( empty | comment | cmd_moddir | cmd_kv "rootdev" Rx.fspath | cmd_kv "rootfs" Rx.word | cmd_kv "exclude" Rx.fspath | cmd_kv "include" Rx.fspath | cmd_kv "forceload" Rx.fspath | cmd_set )*
let lns = IniFile.lns record comment
The sudoers lens, any amount of
let lns = ( empty | comment | includedir | alias | defaults | spec )*
let lns = entry+
The sysctl lens
let lns = (Util.empty | comment | Simplevars.entry)*
generic entries then programs or hostnames matching blocs
let lns = entries . ( program | hostname )*
An IniFile.lns
let lns = IniFile.lns record (comment|include)
let lns = (Util.empty | Util.comment | entry)*
The UpdateDB lens
let lns = (Util.empty|Util.comment|list|bool)*
let lns = (Util.empty | Util.comment | entry)*
The xorg.conf lens
let lns = ( empty | comment | section )*
The Xymon_Alerting lens
let lns = ( rule | macrodefinition | include | empty | comment )*
let lns_loose = let l_comment = comment comment_re comment_default in let l_sep = sep sep_re sep_default in let l_entry = indented_entry entry_re l_sep l_comment in let l_title = indented_title_label "section" (record_label_re - ".anon") in let l_record = record l_title l_entry in (record_anon l_entry)? . l_record*
let lns_loose_multiline = let l_comment = comment comment_re comment_default in let l_sep = sep sep_re sep_default in let l_entry = entry_multiline entry_re l_sep l_comment in let l_title = title_label "section" (record_label_re - ".anon") in let l_record = record l_title l_entry in (record_anon l_entry)? . l_record*
Generic INI File lens with no empty lines
let lns_noempty (record:lens) (comment:lens) = comment* . record*
local has specific syntax
let local = [ Util.indent . key "local" . space . [ key "stratum" . space . store integer ] . eol ]
let log_flag_list = [ space . key log_flags ]
let log_levels = let category = Erlang.tuple Erlang.bare Erlang.bare in Erlang.list "log_levels" category
log has a specific options list
let log_list = [ Util.indent . key "log" . log_flag_list+ . eol ]
a loghost is an @ sign followed by the hostname and a possible port
let loghost = [label "protocol" . store protocol] . [ label "hostname" . store loghost_r ] . (colon . [ label "port" . store /[0-9]+/ ] )?
A logical construction for condition and condition_list
let logic_construct_condition (kw:string) (lns:lens) = [ label kw . lns ] . [ Sep.space . key kw . Sep.space . lns ]*
A generic definition for condition_field
let logic_construct_field (kw:string) (sep:string) (lns:lens) = [ label kw . lns ] . [ Build.xchgs sep kw . lns ]*
a log program begins with a pipe
let logprogram = pipe . [ label "program" . store /[^ \t\n][^\n]+[^ \t\n]/ ]
A minimalistic logrotate block
let logrotate_block = let entry = [ key Rx.word ] in let filename = [ label "file" . store /\/[^,#= \n\t{}]+/ ] in let filename_sep = del /[ \t\n]+/ " " in let filenames = Build.opt_list filename filename_sep in [ label "rule" . filenames . Build.block entry ]
let lookup = let lookup_entry = Build.flag("bind"|"file"|"yp") in Build.key_value_line_comment "lookup" Sep.space (Build.opt_list lookup_entry Sep.space) comment_eol
Add spaces to the left or right of char
let lrspace (char:string) = del (/[ \t\n]*/ . char . /[ \t\n]*/ ) char
ls [directory]
let ls = Build.key_value_line "ls" space (store fspath)
Add spaces to the left of char
let lspace (char:string) = del (/[ \t\n]*/ . char) char
contains subblocks of Virtual server group(s) and Virtual server(s)
let lvs_conf = virtual_server | virtual_server_group