| A | |
| alpha, Cron | |
| alphanum, Cron | |
| C | |
| comment | |
| comment_default, IniFile | |
| comment_re, IniFile | |
| D | |
| del_opt_ws, Util | |
| del_str, Util | |
| del_ws, Util | |
| del_ws_spc, Util | |
| del_ws_tab, Util | |
| E | |
| empty | |
| entries_re, Xorg | |
| entry_re, IniFile | |
| eol | |
| F | |
| filter | |
| G | |
| generic_entry_re, Xorg | |
| I | |
| indent | |
| int, Xorg | |
| N | |
| num, Cron | |
| Q | |
| quoted_string_val, Xorg | |
| R | |
| record_label_re, IniFile | |
| record_re, IniFile | |
| S | |
| section_re, Xorg | |
| secton_re_obsolete, Xorg | |
| sep, IniFile | |
| sep_col, Sudoers | |
| sep_com, Sudoers | |
| sep_cont, Sudoers | |
| sep_cont_opt, Sudoers | |
| sep_default, IniFile | |
| sep_dquote | |
| sep_eq | |
| sep_re, IniFile | |
| sep_spc | |
| service_attr, Xinetd | |
| stdexcl, Util | |
| sto_integer, Sudoers | |
| sto_to_com, Sudoers | |
| sto_to_com_cmnd, Sudoers | |
| sto_to_com_col, Sudoers | |
| sto_to_com_user, Sudoers | |
| sto_to_comment, IniFile | |
| sto_to_eol, IniFile | |
| sto_to_eq, Sudoers | |
| sto_to_spc, Sudoers | |
| sto_to_spc_no_dquote, Sudoers | |
| T | |
| the valid values for schedules, Cron | |
| to_eol, Xorg |
let alpha = /[A-Za-z]{3}/
let alphanum = num | alpha
let comment = Util.comment
let comment = Util.comment
Default value for comment pattern
let comment_default = ";"
Default regexp for comment pattern
let comment_re = /[;#]/
Delete optional whitespace
let del_opt_ws = del /[ \t]*/
Delete a string and default to it
let del_str ( s:string ) = del s s
Delete mandatory whitespace
let del_ws = del /[ \t]+/
Delete mandatory whitespace, default to single space
let del_ws_spc = del_ws " "
Delete mandatory whitespace, default to single tab
let del_ws_tab = del_ws "\t"
let empty = Util.empty
let empty = Util.empty
This is a list of all patterns which have specific handlers, and should therefore not be matched by the generic handler
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 )/
Default regexp for entry keyword
let entry_re = ( /[A-Za-z][A-Za-z0-9\._-]+/ )
let eol = Util.eol
End of line, inherited from Util.eol
let eol = Util.eol
let eol = del /[ \t]*( # )?[ \t]*\n/ "\n"
let eol = del /[ \t]*\n/ "\n"
Delete end of line, including optional trailing whitespace
let eol = del /[ \t]*\n/ "\n"
let eol = Util.eol
let generic_entry_re = /[^# \t\n\/]+/ - entries_re
let indent = Util.indent
let indent = del /[ \t]*/ ""
Delete indentation, including leading whitespace
let indent = del /[ \t]*/ ""
let indent = Util.indent
let int = /[0-9]+/
let num = /[0-9\*][0-9\/,-\*]*/
let quoted_string_val = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
Default regexp for title_label keyword pattern
let record_label_re = /[^]\n]+/
Default regexp for title keyword pattern
let record_re = ( /[^]\n\/]+/ - /#comment/ )
Known values for Section names
let section_re = /( Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor )/
Generic separator
let sep ( pat:regexp ) (default:string) = Util.del_opt_ws "" . del pat default
let sep_col = sep_cont_opt . Util.del_str ":" . sep_cont_opt
let sep_com = sep_cont_opt . Util.del_str "," . sep_cont_opt
let sep_cont = del /( [ \t]+|[ \t]*\\\\\n[ \t]* )/ " "
let sep_cont_opt = del /( [ \t]*|[ \t]*\\\\\n[ \t]* )/ " "
The default separator value
let sep_default = "="
let sep_dquote = Util.del_str "\""
let sep_dquote = Util.del_str "\""
let sep_eq = Util.del_str "="
let sep_eq = sep_cont_opt . Util.del_str "=" . sep_cont_opt
The default regexp for a separator
let sep_re = /[=:]/
let sep_spc = Util.del_ws_spc
let sep_spc = del /[ \t]+/ " "
let sep_spc = Util.del_ws_spc
It is much faster to combine, for example, all the attr_one attributes into one regexp and pass that to a lens instead of using lens union (attr_one “a” | attr_one “b”|..)
let service_attr = attr_one ( "socket_type" | "protocol" | "wait" | "user" | "group" |"server" | "instances" | "rpc_version" | "rpc_number" | "id" | "port" | "nice" | "banner" | "bind" | "interface" | "per_source" | "groups" | "banner_success" | "banner_fail" | "disable" | "max_load" | "rlimit_as" | "rlimit_cpu" | "rlimit_data" | "rlimit_rss" | "rlimit_stack" | "v6only" | "deny_time" | "umask" | "mdns" | "libwrap" )
Exclusion for files that are commonly not wanted/needed
let stdexcl = ( excl "*~" ) . (excl "*.rpmnew") . (excl "*.rpmsave") . (excl "*.augsave") . (excl "*.augnew")
let sto_integer = store /[0-9]+/
There could be a \ in the middle of a command
let sto_to_com = store /( [^,=:#() \t\n\\\\][^,=:#()\n]*[^,=:#() \t\n\\\\] )|[^,=:#() \t\n\\\\]/
sto_to_com_cmnd does not begin or end with a space
let sto_to_com_cmnd = store /( [^,=:#() \t\n\\\\][^,=:#()\n]*[^,=:#() \t\n\\\\] )|[^,=:#() \t\n\\\\]/
let sto_to_com_col = store /[^",=#() \t\n\\\\]+/ (* " relax emacs *)
let sto_to_com_user = store ( /[^,=:#() \t\n]+/ - /(User|Runas|Host|Cmnd)_Alias|Defaults.*/ )
Store until comment
let sto_to_comment = Util.del_opt_ws "" . store /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/
Store until end of line
let sto_to_eol = Util.del_opt_ws "" . store /( [^ \t\n].*[^ \t\n]|[^ \t\n] )/
let sto_to_eq = store /[^,=:#() \t\n\\\\]+/
let sto_to_spc = store /[^", \t\n\\\\]+|"[^", \t\n\\\\]+"/
let sto_to_spc_no_dquote = store /[^", \t\n\\\\]+/ (* " relax emacs *)
Match everything from here to eol, cropping whitespace at both ends
let to_eol = /[^ \t\n]( .*[^ \t\n] )?/