2 (* Original Author: Simon Vocella <voxsim@gmail.com> *)
3 (* Updated by: Steve Shipway <steve@steveshipway.org> *)
4 (* Changes: allow comments within Modules, allow optionless flags, *)
5 (* allow options without linebreaks, allow naked true/false options *)
6 (* Trailing ';' terminator should not be included in option value *)
7 (* Note: requires latest Util.aug for multiline comments to work *)
13 let space_equal = del (/[ \t]*/ . "=" . /[ \t]*/) (" = ")
14 let lbrace = del (/[ \t\n]*\{[ \t]*\n/) " {\n"
15 let rbrace = del (/[ \t]*}[ \t]*;/) " };"
16 let word = /[A-Za-z0-9_.-]+/
17 let wsnl = del (/[ \t\n]+/) ("\n")
18 let endflag = del ( /[ \t]*;/ ) ( ";" )
21 let value_squote = /'[^\n']*'/
22 in let value_dquote = /"[^\n"]*"/
23 in let value_tf = /(true|false)/
24 in value_squote | value_dquote | value_tf
26 let moduleOption = [ wsnl . key word . space_equal . (store value_re) ]
27 let moduleSuffix = ( moduleOption | Util.eol . Util.comment_c_style | Util.comment_multiline )
28 let flag = [ Util.del_ws_spc . label "flag" . (store word) . moduleSuffix* . endflag ]
29 let loginModuleClass = [( Util.del_opt_ws "" . label "loginModuleClass" . (store word) . flag ) ]
31 let content = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModuleClass)*
32 let loginModule = [Util.del_opt_ws "" . label "login" . (store word . lbrace) . (content . rbrace)]
34 let lns = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModule)*
35 let filter = incl "/opt/shibboleth-idp/conf/login.config"
36 let xfm = transform lns filter