Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-12 Thread Tudor Girba
Hi, As Jan pointed out, you should use “not” instead of “negate and”. Cheers, Doru > On Aug 10, 2017, at 5:22 AM, Sean P. DeNigris wrote: > > Peter Kenny wrote >> You may need to post-process the parse to get what you >> want. > > Good point. I omitted several ` ==> #second` in several place

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-09 Thread Sean P. DeNigris
Peter Kenny wrote > You may need to post-process the parse to get what you > want. Good point. I omitted several ` ==> #second` in several places for readability on the list, but we should mention that for posterity. Also, duh `gen negate and` should be `gen not`! - Cheers, Sean -- View thi

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-09 Thread PBKResearch
plementaries. HTH Peter -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Sean P. DeNigris Sent: 09 August 2017 03:41 To: pharo-users@lists.pharo.org Subject: Re: [Pharo-users] PetitParser: Parse X as long as it's not Y Peter Kenny wrote &g

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-08 Thread Sean P. DeNigris
Peter Kenny wrote > This seems to be what the PPAndParser is designed for. Thanks for the pointer, Peter! I finally figured it out based on your example. To get more concrete, I'm trying to parse a name, where the end of the input might be an optional middle name, followed by an optional generati

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread PBKResearch
usion. Peter -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of PBKResearch Sent: 06 August 2017 13:28 To: 'Any question about pharo is welcome' Subject: Re: [Pharo-users] PetitParser: Parse X as long as it's not Y Sean This seems

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread PBKResearch
Sean P. DeNigris Sent: 05 August 2017 21:26 To: pharo-users@lists.pharo.org Subject: [Pharo-users] PetitParser: Parse X as long as it's not Y How do I tell Petit Parser to parse a string of certain allowable characters as long as the final result isn't a particular string? E.g. consume

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread Jan Kurš
Hi, not sure if I understand your requirement, but you can try: Y not, chars star Is this what you need? Cheers Jan On Sun, Aug 6, 2017, 04:47 Sean P. DeNigris wrote: > vonbecmann wrote > > did you try with negate? > > That is the standard trick with PP, but the problem here is that I'm tryin

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-05 Thread Sean P. DeNigris
vonbecmann wrote > did you try with negate? That is the standard trick with PP, but the problem here is that I'm trying to say, not just "anything which is not Y", but "any string of these characters as long is it doesn't also match Y" - Cheers, Sean -- View this message in context: http:/

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-05 Thread Bernardo Ezequiel Contreras
did you try with negate? comment ^ ($" asParser , $" asParser negate star , $" asParser) flatten On Sat, Aug 5, 2017 at 5:26 PM, Sean P. DeNigris wrote: > How do I tell Petit Parser to parse a string of certain allowable > characters > as long as the final result isn't a particular string? E.

[Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-05 Thread Sean P. DeNigris
How do I tell Petit Parser to parse a string of certain allowable characters as long as the final result isn't a particular string? E.g. consume an identifier as long as it's not 'Baz' or 'Bar' Thanks - Cheers, Sean -- View this message in context: http://forum.world.st/PetitParser-Parse-X