Fixed PEGFsaTransition>>disjunction: - xor: does not take blocks
as xor is not subject to lazy evaluation. While in Pharo it worked, it does not work
well under Smalltalk/X which does not send value to the passed argument.
(partially because xor: is inlined by the stc/JIT compiler)
"{ Package: 'stx:goodies/petitparser' }"
"{ NameSpace: Smalltalk }"
PPDelegateParser subclass:#PPConditionalParser
instanceVariableNames:'block'
classVariableNames:''
poolDictionaries:''
category:'PetitParser-Parsers'
!
!PPConditionalParser class methodsFor:'as yet unclassified'!
on: aPPParser block: block
^ (PPConditionalParser on: aPPParser)
block: block;
yourself
! !
!PPConditionalParser methodsFor:'accessing'!
block: aBlock
block := aBlock
! !
!PPConditionalParser methodsFor:'parsing'!
parseOn: aPPContext
^ (block value: aPPContext)
ifTrue: [ parser parseOn: aPPContext ]
ifFalse: [ PPFailure message: block asString, ' was not evaluated to true.' context: aPPContext ]
! !