parsers/smalltalk/PPSmalltalkToken.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 03 Nov 2014 12:46:42 +0000
changeset 410 779556be95f8
parent 386 a409905f7f2d
child 417 3c0a91182e65
permissions -rw-r--r--
Portability fixes in PPPredicateTest>>charactersDo: / parsedCharacterSet: * It is my understanding that charactersDo: should iterate over all signle byte characters. If so, the method suffer from off-by-one error, it should generate characters with code points 0..255. 256 is actually a two-byte character. Method changed accordingly. * Use Character>>asString instead of `String>>with:` which is safer w.r.t. multi-byte characters. Under Smalltalk/X, String may contain only signle byte characters.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
385
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
PPToken subclass:#PPSmalltalkToken
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
	instanceVariableNames:'comments'
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'PetitSmalltalk-Core'
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
!
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!PPSmalltalkToken methodsFor:'accessing'!
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
comments
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
	^ comments
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
!
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
comments: anArray
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	comments := anArray
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
! !
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
!PPSmalltalkToken methodsFor:'compatiblity'!
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
length
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
	^ self size
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
! !
44a36ed4e484 Commited a Smalltalk parser (MC package PetitSmalltalk)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25