Updated smalltalk parser to PetitSmalltalk-JanKurs.75
Name: PetitSmalltalk-JanKurs.75
Author: JanKurs
Time: 13-10-2014, 05:00:14 AM
UUID: 6254f8f7-aa47-4ddd-a373-167bccb0d4e5
"{ Package: 'stx:goodies/petitparser/islands' }"
PPDelegateParser subclass:#PPNonEmptyParser
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'PetitIslands-Parsers'
!
PPNonEmptyParser comment:'I return failure, if the delegate parser did not consumed any input.'
!
!PPNonEmptyParser methodsFor:'parsing'!
parseOn: aPPContext
| position result |
position := aPPContext position.
result := parser parseOn: aPPContext.
(((position == aPPContext position) and: [ aPPContext atEnd not ]) and: [ result isPetitFailure not ]) ifTrue: [
^ PPFailure message: 'Epsilon parse not allowed' context: aPPContext at: position
].
^ result
! !