[Spirit] still stuck on expectation points
Hello, Here's a summary of my problem: My original fully functioning grammar was this: start %= (constitkind >> id >> ':' >> id >> probs) % ","; // WORKS where - constitkind exposes unsigned, - id exposes string, - probs exposes a list of doubles, - start exposes a list of constituent structures (Is that jargon acceptable?) It recognizes strings such as a:b, foo:bar [ 0.00 ], extraposed x:y [ 0.00, 0.50, 0.99, 1.0 ], optional z:a [ 0.00, 0.50, 0.99, 1.0 ] I wanted to replace the grammar with this (note the expectation points which replace sequence operators): start %= (constitkind > id > ':' > id >> probs) % ","; // FAILS That won't compile. All I can glean from the error report is that I've induced a type mismatch. What's wrong? I got as far as this by thrashing: start %= (constitkind >> (id > ':') >> id >> probs) % ","; // WORKS Why do the parentheses in (id > ':') permit compilation? Thanks very much for any help you can give me.
participants (1)
-
philip tucker