4
|
1 |
"{ Package: 'stx:goodies/petitparser' }"
|
0
|
2 |
|
|
3 |
PPDelegateParser subclass:#PPNotParser
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitParser-Parsers'
|
|
8 |
!
|
|
9 |
|
|
10 |
PPNotParser comment:'The not-predicate, a parser that succeeds whenever its delegate does not, but consumes no input [Parr 1994, 1995].'
|
|
11 |
!
|
|
12 |
|
|
13 |
|
|
14 |
!PPNotParser methodsFor:'parsing'!
|
|
15 |
|
|
16 |
parseOn: aStream
|
|
17 |
| element position |
|
|
18 |
position := aStream position.
|
|
19 |
element := parser parseOn: aStream.
|
|
20 |
aStream position: position.
|
|
21 |
^ element isPetitFailure
|
|
22 |
ifFalse: [ PPFailure message: '' at: aStream position ]
|
|
23 |
! !
|
|
24 |
|
|
25 |
!PPNotParser class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
version_SVN
|
4
|
28 |
^ '$Id: PPNotParser.st,v 1.2 2012-01-13 11:22:50 cg Exp $'
|
0
|
29 |
! !
|