Fixes for Smalltalk/X:
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 21 Apr 2015 17:30:40 +0100
changeset 439 1a7d51c92b9a
parent 437 54b3bc9e3987
child 440 d35dbde9b971
Fixes for Smalltalk/X: * do not use Squeakism CharacterSet, use plain old String instead for portability reasons.
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 <jan.vrany@fit.cvut.cz>"
 !
 
 parseOn: aPPContext