Login  Register

Re: PetitParser - skip everything up to X

Posted by Lukas Renggli on Nov 12, 2010; 2:40am
URL: https://forum.world.st/PetitParser-skip-everything-up-to-X-tp3038824p3038984.html

I doubt this is generally useful. Sometimes you might want the skipped
input, sometimes you might want it as a token, sometimes as a trimmed
token, sometimes you need the end as a token, sometimes the end as a
trimmed token, sometimes both or a combination of any of the two.

Lukas

On 11 November 2010 20:36, Sean P. DeNigris <[hidden email]> wrote:

>
> What do you think of adding it to the API?
>
> Something like  http://forum.world.st/file/n3038839/PPParser-skipUntil.st
> PPParser-skipUntil.st :
>
> PPParser>>skipUntil
>
>        ^ self negate plus, self ==> [ :nodes | nodes second ].
>
> parser2 := 'dd' asParser skipUntil.
> parser2 parse: 'kslkxjclkxjcdd'. "Returns 'dd'"
>
>
> --
> View this message in context: http://forum.world.st/PetitParser-skip-everything-up-to-X-tp3038824p3038839.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>



--
Lukas Renggli
www.lukas-renggli.ch

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