[augeas-devel] [Augeas] #135: Lens combinators needs update

Augeas trac at fedorahosted.org
Thu Aug 12 16:03:25 UTC 2010


#135: Lens combinators needs update
------------------------+---------------------------------------------------
 Reporter:  fgiraldeau  |       Owner:  lutter
     Type:  defect      |      Status:  new   
 Priority:  trivial     |   Milestone:  next  
Component:  Augeas      |     Version:  0.7.0 
 Keywords:  doc         |  
------------------------+---------------------------------------------------
 The documentation of union combinator on page
 http://augeas.net/docs/lenses.html says this:

 {{{
 This means that for the union del /[a-z]+/ | store /[a-zA-Z]+/, the store
 will never be used for strings matching /[a-z]+/, they will always be
 processed by the del lens.
 }}}

 I made a small lens to test this:

 {{{
 module Union =

 let l = [ label "test" . (del /[a-z]+/ "a" | store /[a-zA-Z]+/) ]

 test l get "abc" = ?
 test l get "aBC" = ?
 }}}

 And it appears that the following error is raised:

 {{{
 $ ./augparse ../union.aug
 Syntax error in lens definition
 ../union.aug:3.0-.65:Failed to compile l
 ../union.aug:3.25-.62:exception: overlapping lenses in union.get
     Example matched by both: 'a'
     First lens: ../union.aug:3.25-.42:
     Second lens: ../union.aug:3.45-.62:
 }}}

 Which is a fair error. The documentation should be updated to explain that
 union of overlaping regexp is not allowed.

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/135>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list