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.
"{ Package: 'stx:goodies/petitparser/compiler' }"
PPCNode subclass:#PPCPluggableNode
instanceVariableNames:'block'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Nodes'
!
!PPCPluggableNode methodsFor:'accessing'!
block
^ block
!
block: anObject
block := anObject
! !
!PPCPluggableNode methodsFor:'as yet unclassified'!
acceptsEpsilon
^ true
!
acceptsEpsilonOpenSet: set
^ true
!
asInlined
^ PPCInlinePluggableNode new
name: name;
block: block;
yourself
!
compileWith: compiler effect: effect id: id
| blockId |
blockId := compiler idFor: block prefixed: #block.
compiler startMethod: id.
compiler addConstant: block as: blockId.
compiler add: '^ ', blockId, ' value: context.'.
^ compiler stopMethod.
!
firstCharParser
^ block asParser
!
prefix
^ #plug
! !