7 let lbrack = del /[ \t]*\([ \t\n]*/ "("
8 let rbrack = del /[ \t\n]*\)/ ")"
10 let empty_line = [ del /[ \t]*\n/ "\n" ]
13 [ label "#comment" . del /#[ \t]*/ "# " . store /[^ \t]+[^\n]*/ . del /\n/ "\n" ]
15 let standalone_comment = [ label "#scomment" . del /#/ "#" . store /.*/ . del /\n/ "\n" ]
16 (* Minor bug: The initial whitespace is stored, not deleted. *)
18 let ws_and_comment = ws . no_ws_comment
20 (* Either a word or a quoted string *)
21 let str_store = store /[A-Za-z0-9_.\/-]+|\"([^\"\\\\]|(\\\\.))*\"|'([^'\\\\]|(\\\\.))*'/
23 let str = [ label "string" . str_store ]
25 let var_name = key Rx.word
28 let array = [ label "array" . lbrack . Build.opt_list thing ws . ws_and_comment? . rbrack ] in
29 let str = [ label "item" . str_store ] in
32 let sexpr = [ lbrack . var_name . ws . no_ws_comment? . thing . ws_and_comment? . rbrack ]
34 let lns = ( empty_line | standalone_comment | sexpr ) *
36 let filter = incl "xend-config.sxp"
37 let xfm = transform lns filter