Hi All, I have written a lense to parse the sphinx search configuration file sphinx.conf
I am able to successfully parse and work with the file but augparse keeps giving
me errors am trying to write the tests but cannot move forward due to the
augparse
errors.
I have tried debugging but have not been able to resolve the "ambiguous
concatenation"
issue. I would appreciate some help.
The lense is attached below.
module Sphinx =
autoload xfm
(************************************************************************
* Group: USEFUL PRIMITIVES
*************************************************************************)
let eol = Util.eol
let sep = Sep.space
let empty = Util.empty
let indent = Util.indent
let comment = Util.comment
let eq = del /[ \t]*=/ " ="
let any = Rx.no_spaces - Rx.cl
let value = any . (Rx.space . any)*
let cont_value = (any|Rx.cl) . (Rx.space . any . (Rx.cl)?)*
let block_names = /searchd|indexer/
let blocks_with_opts = /source|index/
let keys = Rx.word
let quote = Quote.do_dquote_opt
(************************************************************************
* Group: Entry
*************************************************************************)
let entry = [ indent . key keys . eq . (Sep.opt_space . store value)? . eol ]
let cont_entry = [ indent . key keys . eq . (Sep.space . store cont_value) .
eol ]
let sphinx_block (ent:lens) (comment:lens) =
let indent = del Rx.opt_space "\t"
in del Build.block_ldelim_newlines_re Build.block_ldelim_newlines_default
. ((ent | comment) . (Util.empty | ent | comment)*)?
. del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default
let blockn = [ indent . key blocks_with_opts . sep . quote (store Rx.space_in)
. sphinx_block (entry|cont_entry) comment . eol ]
let block = [ indent . key block_names . sphinx_block (entry|cont_entry)
comment . eol ]
(************************************************************************
* Group: filter and lens
*************************************************************************)
let lns = (comment|empty|block|blockn)*
let filter = incl "/etc/sphinx/*.conf"
let xfm = transform lns filter
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
