[augeas-devel] Example matched by two lenses: <nothing>

Mol, Xavier (SCC) xavier.mol at kit.edu
Thu Oct 22 15:10:41 UTC 2015


Hello Augeas experts,

attached you can find a custom developed lens definition for Augeas together with a test for it. The problem with this lens is, that augparse complains about overlapping lenses, but doesn't show me a possible match for them. I cannot understand this error, even more so that all the real-world examples I came up with so far are successfully parsed without any issues.


[root at some_host ~]# augparse /usr/share/augeas/lenses/dist/gridmapfile.aug
Syntax error in lens definition
/usr/share/augeas/lenses/dist/gridmapfile.aug:16.2-23.71:Failed to compile mapping
/usr/share/augeas/lenses/dist/gridmapfile.aug:19.26-.38:exception: overlapping lenses in tree union.put
    Example matched by both:
    First lens: /usr/share/augeas/lenses/dist/gridmapfile.aug:17.15-.29:
    Second lens: /usr/share/augeas/lenses/dist/gridmapfile.aug:18.17-.49:


Can someone please explain to me why Augeas reports a syntax error? Since Augeas didn't use any quotation marks for its example, the possible match doesn't consist of white spaces exclusively. An empty line is not supposed to be matched by the lenses defined in line 17 or 18 either. In fact, the ctype regular expression of line 19, where the exception originated, looks like this:

/([^\t\n "]+|"[^\n"]*")/

So this matches anything but white space and quotation marks, or anything, possibly nothing, enclosed by quotations marks (excluding quotation marks and line breaks). I cannot think of any overlap here.

Thank you for your attention! Best regards,
Xavier.

PS: Yes, I know about the Quote module, that offers lenses for matching strings that are optionally enclosed in quotation marks. But the problem with those is, that it seems very difficult to build trees with them.


****
Karlsruher Institute of Technology (KIT)
Steinbuch Centre for Computing (SCC)

B. Sc. Xavier Mol
GridKa Storage Administrator and Support Manager

Hermann-von-Helmholtz-Platz 1
Geb. 449
76344 Eggenstein-Leopoldshafen
Phone: +49 721 608 23041
Email: xavier.mol at kit.edu
www.kit.edu
KIT - University of the State of Baden-Württemberg and National Large-scale Research Center of the Helmholtz Association
"Since 2010, the KIT has been certified as a family-friendly university."
****

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gridmapfile.aug
Type: application/octet-stream
Size: 878 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151022/66cbc23c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_gridmapfile.aug
Type: application/octet-stream
Size: 611 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151022/66cbc23c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6401 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151022/66cbc23c/attachment.p7s>


More information about the augeas-devel mailing list