Hi,

The inspector shows the PPFailure, and the Debug View presentation of PPFailure 
shows you the paths the parser tried.

star produces a PPPossessiveRepeatingParser, and selecting it shows that it 
matched all three characters: they are selected in the bottom pane which shows 
the input string.

Cheers,
Doru


> On Jan 21, 2017, at 11:26 AM, stepharong <stephar...@free.fr> wrote:
> 
> Hi doru
> 
> where do we see it?
> 
> 
> Stef
> 
> On Fri, 20 Jan 2017 16:57:51 +0100, Tudor Girba <tu...@tudorgirba.com> wrote:
> 
> Hi,
> 
> When you have questions like these, you can also use the built-in debugging 
> facilities. For example, in your case, you can see that the #any parser 
> consumed everything like this:
> 
> <Mail Attachment.png>
> 
> Cheers,
> Doru
> 
> 
>> On Jan 20, 2017, at 4:38 PM, Norbert Hartl <norb...@hartl.name> wrote:
>> 
>> 
>>> Am 20.01.2017 um 15:24 schrieb Peter Uhnak <i.uh...@gmail.com>:
>>> 
>>> Is PetitParser eager by default?
>>> 
>>> I've used PetitParser countless times so I am really baffled why this 
>>> doesn't work
>>> 
>>> str := 'a0b'.
>>> #any asParser star, #digit asParser, #any asParser star parse: str.
>>> 
>>> -> PPFailure (input expected at: 3)
>>> 
>> 
>> PetitParser is not greedy per default. But back tracking only works if a 
>> parser fails. Using , creates a sequence of combined parsers. If one fails 
>> the whole sequence fails. As a star parser always succeeds it would be huge 
>> luck if your rule would succeed. The probability that the parser consumes 
>> exactly one character is not high. Maybe negating the first sequence part is 
>> what you want
>> 
>> Norbert
>> 
>> 
> 
> --
> www.tudorgirba.com
> www.feenk.com
> 
> "What we can governs what we wish."
> 
> 
> 
> 
> 
> 
> 
> -- 
> Using Opera's mail client: http://www.opera.com/mail/

--
www.tudorgirba.com
www.feenk.com

“The smaller and more pervasive the hardware becomes, the more physical the 
software gets."


Reply via email to