Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z

E |
| echo, BootConf
| email Chrony Keepalived
| email_addr Chrony Rx
| empty Access AFS_cellalias Aliases Approx AptConf Aptsources Automaster Automounter BootConf Cachefilesd cgrules Chrony Cron Crypttab Dovecot FAI_DiskConfig Grub GtkBookmarks IniFile Keepalived Ldif Mke2fs Modprobe Netmasks Nslcd Nsswitch Ntpd Resolv Solaris_System Subversion Sudoers Syslog Test_Tmpfiles Test_Up2date Test_Xml Tmpfiles Toml Trapperkeeper Util Xorg Xymon_Alerting
| empty_any, Util
| empty_c_style, Util
| empty_c_style_re, Util
| empty_dos, Util
| empty_element, Test_Xml.Xml
| empty_entry ActiveMQ_Conf OpenShift_Config
| empty_generic IniFile Util
| empty_generic_dos, Util
| empty_generic_re, Util
| empty_noindent, IniFile
| empty1, Test_Xml
| empty2, Test_Xml
| empty3, Test_Xml
| empty4, Test_Xml
| encrypt, FAI_DiskConfig
| entries AptPreferences Cachefilesd Nslcd Syslog
| Entries AptPreferences Mailscanner NagiosConfig
| ENTRIES AFS_cellalias Anacron AptConf Automaster Automounter Channels Cron Crypttab Dovecot Gshadow Kdump MasterPasswd Netmasks Passwd Schroot Shadow Ssh Systemd Up2date
| ENTRIES AND OPTIONS, Xorg
| entries_re, Xorg
| entry Global Access ActiveMQ_Conf AFS_cellalias Anacron Apt_Update_Manager AptConf Automounter Avahi Channels Cron Cron_User CSV Dovecot GtkBookmarks Host_Conf Hosts_Access IniFile Inputrc Known_Hosts MasterPasswd Mke2fs Modprobe MongoDBServer NagiosConfig Netmasks Networks Oz Passwd Postgresql Protocols Qpid Reprepro_Uploaders Resolv Rsyslog Schroot Shadow Simplevars SmbUsers Subversion Sysconfig_Route Syslog Systemd Test_Reprepro_Uploaders.Reprepro_Uploaders Toml Trapperkeeper Up2date VWware_Config Yaml
| Entry Avahi ClamAV Oz Syslog
| ENTRY Global IniFile Pgbouncer PylonsPaste Subversion Trapperkeeper
| entry includes comments, IniFile
| ENTRY LINE, Access
| ENTRY TYPES Host_Conf Hosts_Access Kdump Modprobe Sysconfig_Route Trapperkeeper
| entry_ace, Test_IniFile
| entry_acf, Test_IniFile
| entry_ade, Test_IniFile
| entry_adf, Test_IniFile
| entry_bce, Test_IniFile
| entry_bcf, Test_IniFile
| entry_bde, Test_IniFile
| entry_bdf, Test_IniFile
| entry_command, Systemd
| entry_command_flags, Systemd
| entry_command_kw, Systemd
| entry_env, Systemd
| entry_env_kw, Systemd
| entry_fn, Systemd
| entry_gen, Postgresql
| entry_generic IniFile Xorg
| entry_generic_nocomment, IniFile
| entry_host, Automounter
| entry_int, Xorg
| entry_key Automounter Cachefilesd
| entry_list, IniFile
| entry_list_nocomment, IniFile
| entry_location, Automounter
| entry_locations, Automounter
| entry_multi_kw, Systemd
| entry_multiline, IniFile
| entry_multiline_generic, IniFile
| entry_multiline_nocomment, IniFile
| entry_multimount, Automounter
| entry_multimount_sep, Automounter
| entry_multimounts, Automounter
| entry_options, Automounter
| entry_or_comment, Channels
| entry_path, Automounter
| entry_prefix, Cron
| entry_re Global IniFile NetworkManager
| entry_rgb, Xorg
| entry_single, Systemd
| entry_single_kw, Systemd
| entry_std, Subversion
| entry_sto, Mke2fs
| entry_str, Xorg
| entry_value Cachefilesd Systemd
| entry_xy, Xorg
| env, Test_Systemd
| env_key, Systemd
| eol Global AFS_cellalias Aliases Approx AptConf Aptsources Automaster Automounter BootConf Cachefilesd cgrules Channels Chrony Cron Crypttab CSV Dovecot FAI_DiskConfig Grub IniFile Keepalived Ldif Nslcd Ntpd Services Sudoers Syslog Systemd Toml Util Xorg Xymon_Alerting
| eol_comment, Systemd
| eq Dovecot Grub
| equal Channels Fuse Sep Xymon_Alerting
| Erlang
| error, Grub
| example
| Examples Access Aliases Anacron Approx Apt_Update_Manager Authorized_Keys Automaster Automounter Cachefilesd Channels Collectd CPanel CSV Cups Dovecot Erlang FAI_DiskConfig Fonts Fuse GtkBookmarks IniFile Inputrc Keepalived keepalived.aug ldso.aug LVM MongoDBServer NetworkManager Nginx Nslcd OpenShift_Config OpenShift_Http OpenShift_Quickstarts Postfix_Passwordmap Postfix_Transport Postfix_Virtual Postgresql Protocols Puppet_Auth Puppetfile Qpid Quote Rabbitmq Reprepro_Uploaders Rsyslog Semanage Simplelines Simplevars SmbUsers Splunk Subversion Sysconfig_Route Sysctl Tmpfiles Toml Trapperkeeper Up2date UpdateDB Vfstab VWware_Config Xymon_Alerting
| except Access Hosts_Access
| exclamation_mark, Test_Tmpfiles
| exclamation_mark_tree, Test_Tmpfiles
| Exclusions, Util
| exec, Test_Systemd
| expire, MasterPasswd
| Exports
| EXTMOD SUBSECTION, Xorg

> let echo = Build.key_value_line "echo" space (store word)

echo [args]

> let email = [ Util.indent . key "mailonchange" . space . [ label "emailaddress" . store email_addr ] . space . [ label "threshold" . store number ] . eol ]

mailonchange has specific syntax

> let email = [ indent . label "email" . sto_email_addr . comment_or_eol ]

A simple email address entry

> let email_addr = Rx.email_addr

> let email_addr = /[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+/

To be refined

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

An Util.empty

> let empty = Util.empty_any

A C-style empty line

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

Map empty lines.

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty_generic Rx.opt_space

Comment are not allowed, even empty comments

> let empty = empty_generic Rx.opt_space comment_re

Empty line

> let empty = Util.empty

Map empty lines

> let empty = [ del /#?[ \t]*\n/ "\n" ]

Map empty lines, including empty comments

> let empty = IniFile.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty

> let empty = Util.empty_generic_dos /[ \t]*[#;]?[ \t]*/

> let empty = [ del /[ \t]*\*?[ \t]*\n/ "\n" ]

Map empty lines, including empty asterisk comments

> let empty = IniFile.empty_noindent

An empty line or a non-indented empty comment

> let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ]

Map empty lines

> let empty = Util.empty

> let empty = "\n\n\n"

Empty example

> let empty = "keyword= " test Up2date.lns get empty = { "1" = "keyword" }

> let empty = Util.empty

Empty lines

> let empty = Util.empty_dos

An empty line

> let empty = Util.empty

> let empty = empty_generic empty_generic_re

Map empty lines, including empty comments

> let empty = Util.empty

> let empty = Util.empty

> let empty_any = empty_generic (empty_generic_re | empty_c_style_re)

Either empty or empty_c_style

> let empty_c_style = empty_generic empty_c_style_re

Map empty lines, including C-style empty comment

> let empty_c_style_re = /[ \t]*((\/\/)|(\/\*[ \t]*\*\/))?[ \t]*/

> let empty_dos = empty_generic_dos /[ \t]*#?[ \t]*/

> test Xml.empty_element get empty1 = { "a" = "#empty" }

> let empty_entry = Build.key_value_line Rx.word Sep.equal Quote.dquote_opt_nil

> let empty_entry = Build.key_value_line Rx.word Sep.equal blank_val

> let empty_generic (indent:regexp) (comment_re:regexp) = Util.empty_generic_dos (indent . comment_re? . Rx.opt_space)

Empty line, including empty comments

> let empty_generic (r:regexp) = [ del r "" . del_str "\n" ]

A generic definition of empty Map empty lines, including empty comments

> let empty_generic_dos (r:regexp) = [ del r "" . del /\r?\n/ "\n" ]

A generic definition of empty with dos newlines Map empty lines, including empty comments

> let empty_generic_re = /[ \t]*#?[ \t]*/

> let empty_noindent = empty_generic "" comment_re

Empty line, without indentation

> let empty1 = "<a/>"

> let empty2 = "<a foo=\"bar\"/>"

> let empty3 = "<a foo=\"bar\"></a>\n"

> let empty4 = "<a foo=\"bar\" far=\"baz\"/>"

> let encrypt = tag "encrypt"

encrypt tag

> let entries = Build.key_value_line ("Explanation"|"Package"|"Pin-Priority") colon (store Rx.space_in) | pin | Util.comment

> let entries = map_entry | base_entry | scope_entry | filter_entry | simple_entry "threads" | simple_entry "uid" | simple_entry "gid" | simple_entry_opt_list_value "uri" spc | simple_entry "ldap_version" | simple_entry "binddn" | simple_entry "bindpw" | simple_entry "rootpwmoddn" | simple_entry "rootpwmodpw" | simple_entry "sasl_mech" | simple_entry "sasl_realm" | simple_entry "sasl_authcid" | simple_entry "sasl_authzid" | simple_entry "sasl_secprops" | simple_entry "sasl_canonicalize" | simple_entry "krb5_ccname" | simple_entry "deref" | simple_entry "referrals" | simple_entry "bind_timelimit" | simple_entry "timelimit" | simple_entry "idle_timelimit" | simple_entry "reconnect_sleeptime" | simple_entry "reconnect_retrytime" | simple_entry "ssl" | simple_entry "tls_reqcert" | simple_entry "tls_cacertdir" | simple_entry "tls_cacertfile" | simple_entry "tls_randfile" | simple_entry "tls_ciphers" | simple_entry "tls_cert" | simple_entry "tls_key" | simple_entry "pagesize" | simple_entry_opt_list_value "nss_initgroups_ignoreusers" comma | simple_entry "nss_min_uid" | simple_entry "nss_nested_groups" | simple_entry "nss_getgrent_skipmembers" | simple_entry "nss_disable_enumeration" | simple_entry "validnames" | simple_entry "ignorecase" | simple_entry "pam_authz_search" | simple_entry_quoted_value "pam_password_prohibit_message" | simple_entry "reconnect_invalidate" | simple_entry "cache" | simple_entry "log" | simple_entry "pam_authc_ppolicy"

All the combined entries.

> let entries = (empty | comment | entry )*

entries are either comments/empty lines or entries

> let entries_re = /([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)/

This is a list of all patterns which have specific handlers, and should therefore not be matched by the generic handler

> let entry = IniFile.indented_entry entry_re sep comment

> let entry = [ access . colon . user_list . (except user_list)? . colon . origin_list . (except origin_list)? . Util.eol ]

A valid entry line Definition:

> let entry = Build.key_value_line Rx.word Sep.space_equal Quote.any_opt

> let entry = [ label "target" . store target . space . [ label "linkname" . store linkname . eol ] ]

> let entry = [ label "entry" . Util.indent . ( period | period_name ) . Sep.space . delay . Sep.space . job_identifier . Sep.space . store Rx.space_in . Util.eol ]

An anacrontab entry

> let entry = IniFile.entry Rx.word sep comment

> let rec entry_noeol = let value = Util.del_str "\"" . store /[^"\n]+/ . del /";?/ "\";" in let opt_eol = del /[ \t\n]*/ "\n" in let long_eol = del /[ \t]*\n+/ "\n" in let list_elem = [ opt_eol . label "@elem" . value ] in let eol_comment = del /([ \t\n]*\n)?/ "" . comment in [ key name_re . Sep.space . value ] | [ key name_re . del /[ \t\n]*\{/ " {" . ( (opt_eol . entry_noeol) | list_elem | eol_comment )* . del /[ \t\n]*\};?/ "\n};" ] | [ key name_re . Util.del_str "::" . entry_noeol ]

An apt.conf entry, recursive

> let entry = [ seq "entry" . entry_mkey . Util.del_ws_tab . entry_options? . ( entry_locations | entry_multimounts ) . Util.eol ]

A single map entry from start to finish, including multi-mounts

> let entry = IniFile.indented_entry IniFile.entry_re sep comment

> let entry = [ label "entry" . store no_semicolon . (semicol . field_no_colon "provider")? . colon . field_int "frequency" . colon . field_word "parameter" . colon . field_word "signal_source" . colon . field_int "symbol_rate" . colon . vpid . colon . apid . colon . tpid . colon . caid . colon . field_int "sid" . colon . field_int "nid" . colon . field_int "tid" . colon . field_int "rid" . eol ]

> let entry = [ label "entry" . indent . prefix? . ( time | schedule ) . sep_spc . user . sep_spc . store Rx.space_in . eol ]

A crontab entry

> let entry = [ label "entry" . Cron.indent . Cron.prefix? . ( Cron.time | Cron.schedule ) . Cron.sep_spc . store Rx.space_in . Cron.eol ]

A crontab entry for a user’s crontab

> let entry (sep_str:string) = let field = [ seq "field" . store (/[^"#\r\n]/ - sep_str)* ] | [ seq "field" . store /("[^"#]*")+/ ] in let sep = Util.del_str sep_str in [ seq "entry" . counter "field" . Build.opt_list field sep . eol ]

An entry of fields, quoted or not

> let entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]

Map simple “key = value” entries including “key =” entries with empty value.

> let entry = [ label "bookmark" . store Rx.no_spaces . (Sep.space . [ label "label" . store Rx.space_in ])? . Util.eol ]

> let entry = bool ("multi"|"nospoof"|"spoofalert"|"reorder") | bool_warn "spoof" | list "order" "order" | trim

> let entry = [ seq "line" . daemon_list . (except daemon_list)? . colon . client_list . (except client_list)? . ( (colon . option)+ | (colon . shell_command)? ) . Util.eol ]

> let entry (kw:regexp) (sep:lens) (comment:lens) = entry_generic (key kw) sep comment_re comment

Generic INI File entry

> let entry = let mapping = [ label "mapping" . store /[A-Za-z0-9_."\*\/+\,\\-]+/ ] in [ label "entry" . Util.del_str "\"" . store /[^" \t\n]+/ . Util.del_str "\":" . Sep.space . mapping . Util.eol ]

An inputrc mapping entry

> let entry = let alias = [ label "alias" . store Rx.neg1 ] in let key = [ label "key" . store Rx.neg1 ] in [ Util.indent . seq "entry" . marker? . store Rx.neg1 . (Sep.comma . Build.opt_list alias Sep.comma)? . Sep.space . type . Sep.space . key . Util.comment_or_eol ]

A known_hosts entry

> let entry = [ key username . colon . password . uid . gid . class . change_date . expire_date . name . home . shell . eol ]

struct passwd

> let entry (kw:regexp) (lns:lens) = Build.key_value_line kw sep lns

A generic entry for lens lns

> let entry = alias | options | kv_line_command /install|remove/ | blacklist | config | softdep

> let entry = Build.key_value_line Rx.word Sep.space_equal (store Rx.space_in)

> let entry = param | macro

Define the accepted entries, such as param for regular configuration files, and macro for resources.cfg .

> let entry = [ seq "network" . indent . [ label "network" . store Rx.ipv4 ] . sep . [ label "netmask" . store Rx.ipv4 ] . comment_or_eol ]

Network / netmask line

> let entry = let alias = [ seq "alias" . store Rx.word ] in [ seq "network" . counter "alias" . [ label "name" . store Rx.word ] . [ Sep.space . label "number" . store ipv4 ] . [ Sep.space . label "aliases" . Build.opt_list alias Sep.space ]? . (Util.eol|Util.comment) ]

> let entry = IniFile.indented_entry IniFile.entry_re sep comment

> let entry = [ key username . colon . password . uid . gid . name . home . shell . eol ]

struct passwd

> let entry = entry_gen number | entry_gen word_opt_quot | entry_gen word_quot (* anything else *)

> let entry = let protocol = [ label "protocol" . store protoname ] in let number = [ label "number" . store Rx.integer ] in let alias = [ label "alias" . store protoname ] in [ seq "protocol" . protocol . Sep.space . number . (Sep.space . Build.opt_list alias Sep.space)? . Util.comment_or_eol ]

> let entry = Build.key_value_line Rx.word Sep.equal (store Rx.space_in)

> let entry = allow | group

An entry is either an allow statement or a group definition.

> let entry = nameserver | domain | search | sortlist | options | lookup | family

> let entry = [ label "entry" . Syslog.selectors . Syslog.sep_tab . [ label "action" . action ] . Util.eol ]

An entry contains selectors and an action

> let entry = IniFile.entry (IniFile.entry_re - "description") sep comment | description

An IniFile.entry, or description

> let entry = [ key word . colon . [ label "password" . sto_to_col? . colon ] . common . eol ]

> let entry = let some_value = Sep.space_equal . store to_comment_re

> let entry = let username = [ label "username" . store Rx.no_spaces ] in let usernames = Build.opt_list username Sep.space in Build.key_value_line Rx.word Sep.space_equal usernames

> let entry = let comma_list_re = "password-stores" in let space_list_re = "global-ignores" | "preserved-conflict-file-exts" in let std_re = /[^ \t\r\n\/=#]+/ - (comma_list_re | space_list_re) in entry_std | IniFile.entry_list_nocomment comma_list_re sep Rx.word Sep.comma | IniFile.entry_list_nocomment space_list_re sep Rx.no_spaces (del /(\r?\n)?[ \t]+/ " ")

> let entry = [ store subnet . del /[ \t]*via[ \t]*/ " via " . key router . Util.del_str "\n" ]

One route

> let entry = [ label "entry" . selectors . sep_tab . [ label "action" . action ] . eol ]

an entry contains selectors and an action

> let entry = entry_single | entry_multi | entry_command | entry_env | comment

An IniFile.entry

> test Reprepro_Uploaders.entry get "allow * by anybody\n" = { "allow" = "*" { "by" = "anybody" } }

A star condition gets mapped as direct value of the “allow” node.

> test Toml.entry get "name = { }\n" = { "entry" = "name" { "inline_table" { } } }

Empty inline table

> let rec entry = hash (entry|simple|array)

> let entry = [ seq "entry" . store key_re . Sep.equal . ( multi_entry | single_entry )? . Util.eol ]

> let entry = Build.key_value_line Rx.word Sep.space_equal Quote.double_opt

> let entry = [ key Rx.word . colon . (space . anchor)? . eol . (indent . comment)* . ((inherit . (repo+)?) | repo+) ]

subversion doesn’t support indented entries

> let entry_ace = IniFile.entry IniFile.entry_re sep_ace comment_ace

> let entry_acf = IniFile.entry IniFile.entry_re sep_acf comment_acf

> let entry_ade = IniFile.entry IniFile.entry_re sep_ade comment_ade

> let entry_adf = IniFile.entry IniFile.entry_re sep_adf comment_adf

> let entry_bce = IniFile.entry IniFile.entry_re sep_bce comment_bce

> let entry_bcf = IniFile.entry IniFile.entry_re sep_bcf comment_bcf

> let entry_bde = IniFile.entry IniFile.entry_re sep_bde comment_bde

> let entry_bdf = IniFile.entry IniFile.entry_re sep_bdf comment_bdf

Entry that takes a space separated set of values (the default)

> let entry_command_flags = let exit = [ label "ignoreexit" . Util.del_str "-" ] in let arg0 = [ label "arg0" . Util.del_str "@" ] in exit? . arg0?

Exec* flags “@” and “-”.

> let entry_command_kw = /Exec[A-Za-z][A-Za-z0-9._-]+/

> let entry_env = let envkv (env_val:lens) = key env_key . Util.del_str "=" . env_val

Entry that takes a space separated set of ENV=value key/value pairs

> let entry_env_kw = "Environment"

> let entry_fn (kw:regexp) (val:lens) = [ key kw . sep . val . (eol_comment|eol) ]

Prototype for our various key=value lines, with optional comment

> let entry_gen (lns:lens) = Util.indent . Build.key_value_line_comment Rx.word sep lns Util.comment_eol

Builder to construct entries

> let entry_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) = entry_generic_nocomment kw sep comment_re comment | comment

A very generic INI File entry It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps.

> let entry_generic = [ indent . key generic_entry_re . sep_spc . store to_eol . eol ]

An entry without a specific handler.

> let entry_generic_nocomment (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) = let bare_re_noquot = (/[^" \t\r\n]/ - comment_re) in let bare_re = (/[^\r\n]/ - comment_re)+ in let no_quot = /[^"\r\n]*/ in let bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?)) in let quoted = Quote.do_dquote (store (no_quot . comment_re+ . no_quot)) in [ kw . sep . (Sep.opt_space . bare)? . (comment|eol) ] | [ kw . sep . Sep.opt_space . quoted . (comment|eol) ]

A very generic INI File entry, not including comments It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps.

> let entry_host = [ label "host" . store hostname . ( Util.del_str "(" . [ label "weight" . store weight ] . Util.del_str ")" )? ]

Host component with optional weight of an entry location

> let entry_int (canon:string) (re:regexp) = [ indent . del re canon . label canon . sep_spc . store int . eol ]

This matches an entry which takes a single integer for an argument
Key for a map entry

> let entry_key = Rx.word

The key for an entry in the config file

> let entry_list (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) (comment:lens) = let list = counter "elem" . Build.opt_list [ seq "elem" . store sto ] list_sep in Build.key_value_line_comment kw sep (Sep.opt_space . list) comment

Generic INI File list entry

> let entry_list_nocomment (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) = let list = counter "elem" . Build.opt_list [ seq "elem" . store sto ] list_sep in Build.key_value_line kw sep (Sep.opt_space . list)

Generic INI File list entry without an end-of-line comment

> let entry_location = ( entry_host . ( Sep.comma . entry_host )* )? . Sep.colon . entry_path

A single location with one or more hosts, and one path

> let entry_locations = [ label "location" . counter "location" . [ seq "location" . entry_location ] . ( [ Util.del_ws_spc . seq "location" . entry_location ] )* ]

Multiple locations (each with one or more hosts), separated by spaces

> let entry_multi_kw = let forbidden = entry_single_kw | entry_command_kw | entry_env_kw in /[A-Za-z][A-Za-z0-9._-]+/ - forbidden

> let entry_multiline (kw:regexp) (sep:lens) (comment:lens) = entry_multiline_generic (key kw) sep comment_re comment (comment|eol)

Generic multiline INI File entry

> let entry_multiline_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) (eol:lens) = let newline = /\r?\n[ \t]+/ in let bare = let word_re_noquot = (/[^" \t\r\n]/ - comment_re)+ in let word_re = (/[^\r\n]/ - comment_re)+ in let base_re = (word_re_noquot . (word_re* . word_re_noquot)?) in let sto_re = base_re . (newline . base_re)* | (newline . base_re)+ in Quote.do_dquote_opt_nil (store sto_re) in let quoted = let no_quot = /[^"\r\n]*/ in let base_re = (no_quot . comment_re+ . no_quot) in let sto_re = base_re . (newline . base_re)* | (newline . base_re)+ in Quote.do_dquote (store sto_re) in [ kw . sep . (Sep.opt_space . bare)? . eol ] | [ kw . sep . Sep.opt_space . quoted . eol ] | comment

A very generic multiline INI File entry It allows to set the key lens (to set indentation or subnodes linked to the key) as well as the comment separator regexp, used to tune the store regexps.

> let entry_multiline_nocomment (kw:regexp) (sep:lens) (comment:lens) = entry_multiline_generic (key kw) sep comment_re comment eol

Generic multiline INI File entry without an end-of-line comment

> let entry_multimount = entry_mkey . Util.del_ws_tab . entry_options? . entry_locations

Parses one of many mountpoints given for a multimount line

> let entry_multimount_sep = del /[ \t]+(\\\\[ \t]*\n[ \t]+)?/ " "

Separator for multimount entries, permits line spanning with “\”

> let entry_multimounts = [ label "mount" . counter "mount" . [ seq "mount" . entry_multimount ] . ( [ entry_multimount_sep . seq "mount" . entry_multimount ] )* ]

Parses multiple mountpoints given on an entry line

> let entry_options = Util.del_str "-" . comma_sep_list "opt" . Util.del_ws_tab

> let entry_or_comment = entry | comment

> let entry_path = [ label "path" . store path ]

Path component of an entry location

> let entry_prefix = /-/

> let entry_re = /path|allow|deny/

Regexp for possible entry keyword (path, allow, deny)

> let entry_re = ( /[A-Za-z][A-Za-z0-9._-]*/ )

Default regexp for entry keyword

> let entry_re = /[A-Za-z][A-Za-z0-9:._\(\) \t-]+/

> let entry_rgb (canon:string) (re:regexp) = [ indent . del re canon . label canon . [ label "red" . sep_spc . store int ] . [ label "green" . sep_spc . store int ] . [ label "blue" . sep_spc . store int ] . eol ]

This matches an entry which takes 3 integers as arguments representing red, green and blue components

> let entry_single = entry_fn entry_single_kw [ label "value" . sto_value_single ]?

Entry that takes a single value containing spaces

> let entry_single_kw = "Description"

> let entry_std = IniFile.entry_multiline_generic (key std_re) sep "#" comment IniFile.eol

A standard entry Similar to a IniFile.entry_multiline_nocomment entry, but allows ‘;’

> let entry_sto (kw:regexp) (val:regexp) = entry kw (store val)

Store a regexp as entry value

> let entry_str (canon:string) (re:regexp) = [ indent . del re canon . label canon . sep_spc . quoted_non_empty_string_val . eol ]

This matches an entry which takes a single quoted string

> let entry_value = /[A-Za-z0-9_.-:%]+/

The value for an entry may contain all sorts of things

> let entry_value = [ label "value" . sto_value ]

Store a value that doesn’t contain spaces

> let entry_xy (canon:string) (re:regexp) = [ indent . del re canon . label canon . [ label "x" . sep_spc . store int ] . [ label "y" . sep_spc . store int ] . eol ]

This matches an entry which takes 2 integers as arguments representing X and Y coordinates

> let env = "[Service] Environment=LANG=C Environment=LANG=C FOO=BAR Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= Environment=LANG=C\ FOO=BAR Environment=\"LANG=foo bar\" FOO=BAR Environment=OPTIONS=\"-LS0-6d\" Environment=OPTIONS='-LS0-6d' "

> let env_key = /[A-Za-z0-9_]+(\[[0-9]+\])?/

> let eol = IniFile.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

An Util.eol

> let eol = Util.eol

And Util.eol end of line

> let eol = Util.del_str "\n"

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.del_str "\n"

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.doseol

End of line, inherited from Util.eol

> let eol = Util.eol

> let eol = Util.del_str "\n"

Only eol, don’t include whitespace

> let eol = Util.eol

> let eol = Util.eol

> let eol = del /[ \t]*(#)?[ \t]*\n/ "\n"

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.eol

> let eol = Util.doseol

An end of line

> let eol = del /[ \t]*\n/ "\n"

Delete end of line, including optional trailing whitespace

> let eol = Util.eol

> let eol = Util.eol

An IniFile.comment entry for standalone comment lines (; or #)

> let eq = del /[ \t]*=/ " ="

> let eq = dels "="

> let equal = Sep.equal

> let equal = del /[ \t]*=[ \t]*/ " = "

> let equal = Util.del_str "="

> let equal = Sep.equal

Parses Erlang configuration files

> let error (kw:regexp) = let not_kw = /[a-zA-Z]+/ - kw in [ label "#error" . Util.del_opt_ws "\t" . store (not_kw . /([^a-zA-Z\n].*[^ \t\n])?/) . eol ]

Parse a line that looks almost like a valid setting, but isn’t, into an ‘#error’ node.

> let example = "# This is a TOML document. Boom. title = \"TOML Example\" [owner] name = \"Tom Preston-Werner\" organization = \"GitHub\" bio = \"GitHub Cofounder & CEO\nLikes tater tots and beer.\" dob = 1979-05-27T07:32:00Z # First class dates? Why not? [database] server = \"192.168.1.1\" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # You can indent as you please. Tabs or spaces. TOML don't care. [servers.alpha] ip = \"10.0.0.1\" dc = \"eqdc10\" [servers.beta] ip = \"10.0.0.2\" dc = \"eqdc10\" country = \"中国\" # This should be parsed as UTF-8 [clients] data = [ [\"gamma\", \"delta\"], [1, 2] ] # just an update to make sure parsers support it # Line breaks are OK when inside arrays hosts = [ \"alpha\", \"omega\" ] # Products [[products]] name = \"Hammer\" sku = 738594937 [[products]] name = \"Nail\" sku = 284758393 color = \"gray\" " test Toml.lns get example = { "#comment" = "This is a TOML document. Boom." } { } { "entry" = "title" { "string" = "TOML Example" } } { } { "table" = "owner" { "entry" = "name" { "string" = "Tom Preston-Werner" } } { "entry" = "organization" { "string" = "GitHub" } } { "entry" = "bio" { "string" = "GitHub Cofounder & CEO Likes tater tots and beer." } } { "entry" = "dob" { "datetime" = "1979-05-27T07:32:00Z" } { "#comment" = "First class dates? Why not?" } } { } } { "table" = "database" { "entry" = "server" { "string" = "192.168.1.1" } } { "entry" = "ports" { "array" { } { "integer" = "8001" } { } { "integer" = "8001" } { } { "integer" = "8002" } { } } } { "entry" = "connection_max" { "integer" = "5000" } } { "entry" = "enabled" { "bool" = "true" } } { } } { "table" = "servers" { } { "#comment" = "You can indent as you please. Tabs or spaces. TOML don't care." } } { "table" = "servers.alpha" { "entry" = "ip" { "string" = "10.0.0.1" } } { "entry" = "dc" { "string" = "eqdc10" } } { } } { "table" = "servers.beta" { "entry" = "ip" { "string" = "10.0.0.2" } } { "entry" = "dc" { "string" = "eqdc10" } } { "entry" = "country" { "string" = "中国" } { "#comment" = "This should be parsed as UTF-8" } } { } } { "table" = "clients" { "entry" = "data" { "array" { } { "array" { "string" = "gamma" } { } { "string" = "delta" } } { } { "array" { "integer" = "1" } { } { "integer" = "2" } } { } } { "#comment" = "just an update to make sure parsers support it" } } { } { "#comment" = "Line breaks are OK when inside arrays" } { "entry" = "hosts" { "array" { } { "string" = "alpha" } { } { "string" = "omega" } { } } } { } { "#comment" = "Products" } { } } { "@table" = "products" { "entry" = "name" { "string" = "Hammer" } } { "entry" = "sku" { "integer" = "738594937" } } { } } { "@table" = "products" { "entry" = "name" { "string" = "Nail" } } { "entry" = "sku" { "integer" = "284758393" } } { "entry" = "color" { "string" = "gray" } } }

The example from https://github.com/mojombo/toml
The Test_Access file contains various examples and tests.
The Test_Aliases file contains various examples and tests.
The Test_Anacron file contains various examples and tests.
The Test_Approx file contains various examples and tests.
The Test_Apt_Update_Manager file contains various examples and tests.
The Test_Authorized_Keys file contains various examples and tests.
The Test_Automaster file contains various examples and tests.
The Test_Automounter file contains various examples and tests.
The Test_Cachefilesd file contains various examples and tests.
The Test_Channels file contains various examples and tests.
The Test_Collectd file contains various examples and tests.
The Test_CPanel file contains various examples and tests.
The Test_CSV file contains various examples and tests.
The Test_Cups file contains various examples and tests.
The Test_Dovecot file contains various examples and tests.
The Test_Erlang file contains various examples and tests.
The Test_FAI_DiskConfig file contains various examples and tests.
The Test_Fonts file contains various examples and tests.
The Test_Fuse file contains various examples and tests.
The Test_GtkBookmarks file contains various examples and tests.
The Test_IniFile file contains various examples and tests.
The Test_Inputrc file contains various examples and tests.
The Test_Keepalived file contains various examples and tests.
The Test_LVM file contains various examples and tests.
The Test_MongoDBServer file contains various examples and tests.
The Test_NetworkManager file contains various examples and tests.
The Test_Nginx file contains various examples and tests.
The Test_Nslcd file contains various examples and tests.
The Test_OpenShift_Config file contains various examples and tests.
The Test_OpenShift_Http file contains various examples and tests.
The Test_OpenShift_Quickstarts file contains various examples and tests.
The Test_Postfix_Passwordmap file contains various examples and tests.
The Test_Postfix_Transport file contains various examples and tests.
The Test_Postfix_Virtual file contains various examples and tests.
The Test_Postgresql file contains various examples and tests.
The Test_Protocols file contains various examples and tests.
The Test_Puppet_Auth file contains various examples and tests.
The Test_Puppetfile file contains various examples and tests.
The Test_Qpid file contains various examples and tests.
The Test_Quote file contains various examples and tests.
The Test_Rabbitmq file contains various examples and tests.
The Test_Reprepro_Uploaders file contains various examples and tests.
The Test_Rsyslog file contains various examples and tests.
The Test_Semanage file contains various examples and tests.
The Test_Simplelines file contains various examples and tests.
The Test_Simplevars file contains various examples and tests.
The Test_SmbUsers file contains various examples and tests.
The Test_Splunk file contains various examples and tests.
The Test_Subversion file contains various examples and tests.
The Test_Sysconfig_Route file contains various examples and tests.
The Test_Sysctl file contains various examples and tests.
The Test_Tmpfiles file contains various examples and tests.
The Test_Toml file contains various examples and tests.
The Test_Trapperkeeper file contains various examples and tests.
The Test_Up2date file contains various examples and tests.
The Test_UpdateDB file contains various examples and tests.
The Test_Vfstab file contains various examples and tests.
The Test_VMware_Config file contains various examples and tests.
The Test_Xymon_Alerting file contains various examples and tests.

> let except (lns:lens) = [ label "except" . Sep.space . del /[Ee][Xx][Cc][Ee][Pp][Tt]/ "EXCEPT" . Sep.space . lns ]

The except operator makes it possible to write very compact rules.

> let except (lns:lens) = [ label "except" . Sep.space . del /except/i "EXCEPT" . Sep.space . lns ]

The except operator makes it possible to write very compact rules.

> let exclamation_mark = "D! /tmp/foo - - - - -\n"

Example with an exclamation mark in the type

> let exclamation_mark_tree = { "1" { "type" = "D!" } { "path" = "/tmp/foo" } { "mode" = "-" } { "uid" = "-" } { "gid" = "-" } { "age" = "-" } { "argument" = "-" } }

Tree for exclamation_mark

> let exec = "[Service] ExecStart=/bin/ls ExecReload=/bin/kill -USR1 $MAINPID ExecStart=/sbin/rpcbind -w ExecStartPost=/bin/systemctl disable firstboot-graphical.service firstboot-text.service ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS ExecStop=/usr/sbin/aiccu stop ExecStopPost=-/bin/systemctl poweroff ExecStopPost=@/bin/systemctl poweroff ExecStopPost=-@/bin/systemctl poweroff ExecStopPost=/bin/systemctl\ poweroff "

> let expire_date = [ label "expire_date" . store integer? . colon ]

pw_expire
Parses /etc/exports
Close