Re: question about petitparser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: question about petitparser

Lukas Renggli
Best is to send PetitParser questions to the Moose or Pharo list.

To make your parser fail you have to enforce that it consumes until
the end of the stream with #end:

    identifier := (#letter asParser , #letter asParser star) flatten end.
    identifier parse: 'ffff:gggg'

Also note that you can replace

    p , p star

with

    p plus

Lukas

On 6 December 2010 10:08, Alain Plantec <[hidden email]> wrote:

> Hi Lukas,
>
> identifier := (#letter asParser , #letter asParser star) flatten.
> identifier parse: 'ffff:gggg'
>
> returns 'ffff'.
> shouldn't it raise an error  because of the $: ?
>
> Maybe you prefer me to ask this kind of question somewhere else.
> just let me know
>
> Cheers
> Alain
>
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev