equal
deleted
inserted
replaced
|
1 "{ Package: 'stx:goodies/petitparser' }" |
|
2 |
|
3 "{ NameSpace: Smalltalk }" |
|
4 |
|
5 PPDelegateParser subclass:#PPConditionalParser |
|
6 instanceVariableNames:'block' |
|
7 classVariableNames:'' |
|
8 poolDictionaries:'' |
|
9 category:'PetitParser-Parsers' |
|
10 ! |
|
11 |
|
12 !PPConditionalParser class methodsFor:'as yet unclassified'! |
|
13 |
|
14 on: aPPParser block: block |
|
15 ^ (PPConditionalParser on: aPPParser) |
|
16 block: block; |
|
17 yourself |
|
18 ! ! |
|
19 |
|
20 !PPConditionalParser methodsFor:'accessing'! |
|
21 |
|
22 block: aBlock |
|
23 block := aBlock |
|
24 ! ! |
|
25 |
|
26 !PPConditionalParser methodsFor:'parsing'! |
|
27 |
|
28 parseOn: aPPContext |
|
29 ^ (block value: aPPContext) |
|
30 ifTrue: [ parser parseOn: aPPContext ] |
|
31 ifFalse: [ PPFailure message: block asString, ' was not evaluated to true.' context: aPPContext ] |
|
32 ! ! |
|
33 |