# HG changeset patch # User Jan Vrany # Date 1429633840 -3600 # Node ID 1a7d51c92b9add648b1ce570ec98aa2c90306b22 # Parent 54b3bc9e3987c14202bb6658f1f7b1b3e9d3dc52 Fixes for Smalltalk/X: * do not use Squeakism CharacterSet, use plain old String instead for portability reasons. diff -r 54b3bc9e3987 -r 1a7d51c92b9a parsers/java/PPJavaTokenParser.st --- a/parsers/java/PPJavaTokenParser.st Tue Apr 21 17:20:11 2015 +0100 +++ b/parsers/java/PPJavaTokenParser.st Tue Apr 21 17:30:40 2015 +0100 @@ -12,29 +12,31 @@ !PPJavaTokenParser methodsFor:'parsing'! parseComments: anArray on: aStream - - | start comments | - comments := anArray. - [ - | peekTwice | - [ aStream atEnd not and: [ aStream peek isSeparator ] ] - whileTrue: [ aStream next ]. - peekTwice := aStream peekTwice. - ((peekTwice first = $/) and: - [ (peekTwice second = $*) or: [peekTwice second = $/]])] whileTrue: [ -" - Transcript show: ('position ', aStream position asString, ' char ', aStream next asString); cr. -" - aStream next. - start := aStream position. - (aStream next = $*) - ifTrue: [ aStream upToAll: '*/' ] - ifFalse: [ - | position | - position := aStream position. - aStream upToAnyOf: CharacterSet crlf]. - comments := comments copyWith: (start to: aStream position) ]. - ^ comments + + | start comments | + comments := anArray. + [ + | peekTwice | + [ aStream atEnd not and: [ aStream peek isSeparator ] ] + whileTrue: [ aStream next ]. + peekTwice := aStream peekTwice. + ((peekTwice first = $/) and: + [ (peekTwice second = $*) or: [peekTwice second = $/]])] whileTrue: [ +" + Transcript show: ('position ', aStream position asString, ' char ', aStream next asString); cr. +" + aStream next. + start := aStream position. + (aStream next = $*) + ifTrue: [ aStream upToAll: '*/' ] + ifFalse: [ + | position | + position := aStream position. + aStream upToAnyOf: (String with: (Character codePoint: 13) with: (Character codePoint: 10))]. + comments := comments copyWith: (start to: aStream position) ]. + ^ comments + + "Modified: / 21-04-2015 / 17:23:21 / Jan Vrany " ! parseOn: aPPContext