Is there a way nice way to do a lookup in PP ?
for example, I want to ensure that I have a 'a' then a 'b'. But I don't wan't to consume 'b'
'a' asParser , 'b' asParser lookup
currently I implemented it with a double not :-)
'a' asParser , 'b' asParser not not
not very nice
nicolas
I'm pretty sure this works:
$a asParser , $b and
and "Answer a new parser (logical and-predicate) that succeeds whenever the receiver does, but never consumes input."
(strings work, too, but if you just have 1 character...)
-Chris On Wed, Oct 31, 2012 at 5:51 AM, Nicolas Anquetil Nicolas.Anquetil@inria.fr wrote:
Is there a way nice way to do a lookup in PP ?
for example, I want to ensure that I have a 'a' then a 'b'. But I don't wan't to consume 'b'
'a' asParser , 'b' asParser lookup
currently I implemented it with a double not :-)
'a' asParser , 'b' asParser not not
not very nice
nicolas _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Exactly.
Look at: PPParserTest>>testAnd
Cheers, Doru
On 31 Oct 2012, at 23:57, Chris Cunningham cunningham.cb@gmail.com wrote:
I'm pretty sure this works:
$a asParser , $b and
and "Answer a new parser (logical and-predicate) that succeeds
whenever the receiver does, but never consumes input."
(strings work, too, but if you just have 1 character...)
-Chris On Wed, Oct 31, 2012 at 5:51 AM, Nicolas Anquetil Nicolas.Anquetil@inria.fr wrote:
Is there a way nice way to do a lookup in PP ?
for example, I want to ensure that I have a 'a' then a 'b'. But I don't wan't to consume 'b'
'a' asParser , 'b' asParser lookup
currently I implemented it with a double not :-)
'a' asParser , 'b' asParser not not
not very nice
nicolas _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"We can create beautiful models in a vacuum. But, to get them effective we have to deal with the inconvenience of reality."
great thank you
nicolas
On 31/10/12 23:57, Chris Cunningham wrote:
I'm pretty sure this works:
$a asParser , $b and
and "Answer a new parser (logical and-predicate) that succeeds
whenever the receiver does, but never consumes input."
(strings work, too, but if you just have 1 character...)
-Chris On Wed, Oct 31, 2012 at 5:51 AM, Nicolas Anquetil Nicolas.Anquetil@inria.fr wrote:
Is there a way nice way to do a lookup in PP ?
for example, I want to ensure that I have a 'a' then a 'b'. But I don't wan't to consume 'b'
'a' asParser , 'b' asParser lookup
currently I implemented it with a double not :-)
'a' asParser , 'b' asParser not not
not very nice
nicolas _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev