WikiRender (Squeak port)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

WikiRender (Squeak port)

Nicolas Petton
Hi,

There are some methods used by WikiRender which do not exist in Squeak,
so I wrote them (I took them from VisualWorks).

WikiRender seems to work fine now.

Cheers,

Nicolas
--
Nicolas Petton
http://nico.bioskop.fr
             ___
           ooooooo
          OOOOOOOOO
         |Smalltalk|
          OOOOOOOOO
           ooooooo
            \   /
             [|]
--------------------------------
Ma cl? GPG est disponible ici :
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE788C34D

-------------- section suivante --------------
'From Squeak3.10beta of 22 July 2007 [latest update: #7158] on 5 November 2007 at 3:40:29 pm'!
!PositionableStream methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:26'!
insensitivePeekForAll: aCollection
        | orig |
        self atEnd ifTrue: [^false].
        orig := self position.
        ((self next: aCollection size) sameAs: aCollection)
                ifTrue: [^true].
        self position: orig.
        ^false! !
!PositionableStream methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:32'!
peekForAll: aCollection
        | orig |
        self atEnd ifTrue: [^false].
        orig := self position.
        (self next: aCollection size) = aCollection ifTrue: [^true].
        self position: orig.
        ^false! !
!PositionableStream methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:13'!
skipThrough: anObject
        "Skip forward to the occurrence of anObject.
         Leaves positioned after anObject.
        If the object is not found the stream is positioned at the end and nil is returned."
        [self atEnd ifTrue: [^nil].
        self next = anObject ifTrue: [^self]] repeat! !
!PositionableStream methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:30'!
through: anObject
        "Answer a subcollection from the current position to the occurrence (if any, inclusive)
        of anObject. If not there, answer everything."
        | newStream element |
        newStream := (collection species new: 64) writeStream.
        [self atEnd]
                whileFalse:
                        [element := self next.
                        newStream nextPut: element.
                        element = anObject ifTrue: [^newStream contents]].
        ^newStream contents! !
!PositionableStream methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:19'!
upTo: anObject escaper: anotherObject
        "from WikiWorks"
        | newStream |
        newStream := (collection species new: 64) writeStream.
        [self atEnd] whileFalse:
                        [| element |
                        (element := self next) = anotherObject
                                ifTrue:
                                        [newStream nextPut: ((self peekFor: anObject)
                                                                ifTrue: [anObject]
                                                                ifFalse: [anotherObject])]
                                ifFalse:
                                        [element = anObject ifTrue: [^newStream contents].
                                        newStream nextPut: element]].
        ^newStream contents! !
-------------- section suivante --------------
'From Squeak3.10beta of 22 July 2007 [latest update: #7158] on 5 November 2007 at 3:40:42 pm'!
!String methodsFor: '*AidaPatches' stamp: 'np 11/5/2007 15:08'!
containsSubstring: aString
        ^(self
                indexOfSubCollection: aString
                startingAt: 1) > 0! !
-------------- section suivante --------------
Une pi?ce jointe non texte a ?t? nettoy?e...
Nom: non disponible
Type: application/pgp-signature
Taille: 189 octets
Desc: Ceci est une partie de message
        =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url: http://lists.aidaweb.si/pipermail/aida/attachments/20071105/bb975cf6/attachment.sig