[augeas-devel] About abstract type

Francis Giraldeau Francis.Giraldeau at USherbrooke.ca
Tue Apr 20 17:04:15 UTC 2010


Hi,

I'm trying to get more debug info about lenses, and something is not
clear. Let be the following lens, to parse a simple line with numbers
and letters. Letters chunks are keept under their own subtree.

let a = [ key /[0-9]+/ . [ del /[ ]+/ " " . key /[a-z]+/ ]* .
          del "\n" "\n" ]

The string "1 a b c\n2 d e f\n" generates the tree :

  { "1"
    { "a" }
    { "b" }
    { "c" }
  }
  { "2"
    { "d" }
    { "e" }
    { "f" }
  }

But, the abstract type of the lens looks like this :

{ /[0-9]+/ }

which doesn't match children of "number" nodes. Here is what I would
have expected :

{ /0-9+/ { /a-z/+ }* }

Otherwise, we never have access to inner node abstract type, isn't?

Francis




More information about the augeas-devel mailing list