[augeas-devel] (no subject)
David Lutterkort
lutter at redhat.com
Mon Apr 19 19:40:43 UTC 2010
On Fri, 2010-04-16 at 23:30 -0400, Francis Giraldeau wrote:
> I would like to use the builtin function lens_atype mydel to get the
> abstract representation of a lens, but can't get it to work. Here is
> what I tried.
>
> module Test01 =
> let mydel = del /[a]+/ "a"
> let a = lens_format_atype mydel
> let _ = print_endline a
>
> But I'm getting nothing on the stdout.
I assume you are using the augparse from git (since the one from 0.7.0
doesn't have the print_* primitives)
The reason you're not seeing anything is because the del lens has an
empty atype - its whole purpose is to swallow input strings and not
produce any trees. Try the above with a lens like '[ key /[a-z]+/ .
store /[0-9]+/ ]'
> Also, I can't figure out how to
> use lens_atype, because no print function takes a REGEXP as argument.
There's actually print_regexp[1], i.e.
let l = [ key /[a-z]+/ ]
let _ = print_regexp (lens_atype l); print_endline ""
will do that. The output isn't as pretty as from lens_format_atype
though.
David
[1] http://augeas.net/docs/builtins.html
More information about the augeas-devel
mailing list