extensions.st
changeset 379 451b5ae38b72
parent 376 a2656b27cace
child 383 e9919f8e47de
equal deleted inserted replaced
378:53d66ecfeb1b 379:451b5ae38b72
    98 "/                ifTrue: [ super asPetitStream ]
    98 "/                ifTrue: [ super asPetitStream ]
    99 
    99 
   100     "Modified: / 18-12-2010 / 17:38:01 / Jan Kurs <kurs.jan@post.cz>"
   100     "Modified: / 18-12-2010 / 17:38:01 / Jan Kurs <kurs.jan@post.cz>"
   101 ! !
   101 ! !
   102 
   102 
       
   103 !PositionableStream methodsFor:'*petitparser-core'!
       
   104 
       
   105 peekTwice
       
   106 	"Answer what would be returned if the message next were sent to the 
       
   107 	receiver. If the receiver is at the end, answer nil."
       
   108 
       
   109 	| array |
       
   110 	self atEnd 
       
   111 		ifTrue: [^Array with: nil with: nil].
       
   112 	array := Array with: (self next) with: (self peek).
       
   113 	position := position - 1.
       
   114 	^array
       
   115 ! !
       
   116 
   103 !SequenceableCollection methodsFor:'*petitparser-core-converting'!
   117 !SequenceableCollection methodsFor:'*petitparser-core-converting'!
   104 
   118 
   105 asParser
   119 asParser
   106 	^ PPSequenceParser withAll: (self collect: [ :each | each asParser ])
   120 	^ PPSequenceParser withAll: (self collect: [ :each | each asParser ])
   107 ! !
   121 ! !