PPFlattenParser.st
author sr
Thu, 05 Jul 2018 09:23:34 +0200
changeset 628 379fc127ba99
parent 165 7df471ff9ea5
child 377 6112a403a52d
permissions -rw-r--r--
order

"{ Package: 'stx:goodies/petitparser' }"

PPDelegateParser subclass:#PPFlattenParser
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Parsers'
!


!PPFlattenParser methodsFor:'hooks'!

create: aCollection start: aStartInteger stop: aStopInteger
	^ aCollection copyFrom: aStartInteger to: aStopInteger
! !

!PPFlattenParser methodsFor:'parsing'!

parseOn: aStream
	| start element |
	start := aStream position.
	element := parser parseOn: aStream.
	element isPetitFailure ifTrue: [ ^ element ].
	^ self on: aStream collection start: start + 1 stop: aStream position value: element
! !

!PPFlattenParser methodsFor:'private'!

on: aCollection start: aStartInteger stop: aStopInteger value: anObject
	^ aCollection copyFrom: aStartInteger to: aStopInteger
! !

!PPFlattenParser class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $'
!

version_SVN
    ^ '$Id: PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $'
! !