[augeas-devel] Runtime ambiguity

Francis Giraldeau francis.giraldeau at usherbrooke.ca
Tue Jul 13 13:44:04 UTC 2010


Hi, 

I'm trying to do a bracket recursive lens, and facing runtime ambiguity
error. 

Attached is a module that shows the strange behavior. The lend lns_bad
causes this error: 

jmt_ambig.aug:16.0-.41:exception thrown in test
jmt_ambig.aug:16.5-.37:exception: Ambiguous parse: 2 links in state (29,
0) in E_11
    Lens: jmt_ambig.aug:3.22-.29:
    Error encountered at 1:11 (11 characters into string)
                    <test{test{}|=|}test{}>                    

The parse itself is right, and in the jmt_parse.dot, we see 2 links from
(29,0) in E11, that complete both nonterminal "F" to (23,0) in E5. They
are duplicates. I don't know why, and since they complete the same
symbol, I don't think it's an ambiguity at all, isn't? 

I can take a closer look, but I wanted to validate this before. 

Thanks, 

Francis
-------------- next part --------------
module Jmt_ambig = 

let dels (s:string) = del s s 
let blk (body:lens) = [ key "test" 
                      . dels "{" 
                      . body*
                      . dels "}" ]

let rec lns_ok_staging = blk lns_ok_staging 
let lns_ok = lns_ok_staging*
test lns_ok get "test{test{}}test{}" = ?

let rec lns_bad = (blk lns_bad)*
test lns_bad get "test{test{}}test{}" = ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jmt_parse.png
Type: image/png
Size: 567216 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20100713/f5d0edda/attachment.png>


More information about the augeas-devel mailing list