changed: #installAutoloadedClassesFromStream:
authorStefan Vogel <sv@exept.de>
Wed, 22 Feb 2012 14:28:10 +0100
changeset 14020 3cbf9505591c
parent 14019 9b08cdb0db50
child 14021 11d015697e44
changed: #installAutoloadedClassesFromStream: ignore comments starting with '#' in abbrev.stc files
Smalltalk.st
--- a/Smalltalk.st	Wed Feb 22 13:55:54 2012 +0100
+++ b/Smalltalk.st	Wed Feb 22 14:28:10 2012 +0100
@@ -4841,76 +4841,77 @@
     |s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w|
 
     anAbbrevFileStream isFileStream ifTrue:[
-	abbrevFileName := anAbbrevFileStream pathName.
-	info := 'declared from: ', abbrevFileName.
+        abbrevFileName := anAbbrevFileStream pathName.
+        info := 'declared from: ', abbrevFileName.
     ].
 
     KnownPackages isNil ifTrue:[
-	KnownPackages := Set new.
+        KnownPackages := Set new.
     ].
 
     "/ yes, create any required nameSpace, without asking user.
     Class createNameSpaceQuerySignal answer:true do:[
 
-	[anAbbrevFileStream atEnd] whileFalse:[
-	    l := anAbbrevFileStream nextLine withoutSeparators.
-	    l notEmpty ifTrue:[
-		"/ must do it manually, caring for quoted strings.
+        [anAbbrevFileStream atEnd] whileFalse:[
+            l := anAbbrevFileStream nextLine withoutSeparators.
+            "Skip empty lines and comments"
+            (l notEmpty and:[l first ~= $#]) ifTrue:[
+                "/ must do it manually, caring for quoted strings.
 "/                words := line asCollectionOfWords.
 
-		words := OrderedCollection new.
-		s2 := l readStream.
-		[s2 atEnd] whileFalse:[
-		    s2 skipSeparators.
-		    s2 peek == $' ifTrue:[
-			s2 next.
-			w := s2 upTo:$'.
-			s2 skipSeparators.
-		    ] ifFalse:[
-			w := s2 upToSeparator
-		    ].
-		    words add:w
-		].
-		words size < 3 ifTrue:[
-		    'Smalltalk [warning]: bad abbrev entry' errorPrint.
-		    anAbbrevFileStream isFileStream ifTrue:[
-			' (in ''' errorPrint.
-			anAbbrevFileStream pathName errorPrint.
-			''')' errorPrint
-		    ].
-		    ': ' errorPrint. l errorPrintCR
-		] ifFalse:[
-		    clsName := (words at:1) asSymbol.
-		    abbrev := (words at:2).
-		    package := (words at:3) asSymbol.
-		    cat := words at:4 ifAbsent:nil.
-		    numClassInstVars := words at:5 ifAbsent:'0'.
-		    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
+                words := OrderedCollection new.
+                s2 := l readStream.
+                [s2 atEnd] whileFalse:[
+                    s2 skipSeparators.
+                    s2 peek == $' ifTrue:[
+                        s2 next.
+                        w := s2 upTo:$'.
+                        s2 skipSeparators.
+                    ] ifFalse:[
+                        w := s2 upToSeparator
+                    ].
+                    words add:w
+                ].
+                words size < 3 ifTrue:[
+                    'Smalltalk [warning]: bad abbrev entry' errorPrint.
+                    anAbbrevFileStream isFileStream ifTrue:[
+                        ' (in ''' errorPrint.
+                        anAbbrevFileStream pathName errorPrint.
+                        ''')' errorPrint
+                    ].
+                    ': ' errorPrint. l errorPrintCR
+                ] ifFalse:[
+                    clsName := (words at:1) asSymbol.
+                    abbrev := (words at:2).
+                    package := (words at:3) asSymbol.
+                    cat := words at:4 ifAbsent:nil.
+                    numClassInstVars := words at:5 ifAbsent:'0'.
+                    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
 
 "/                KnownPackages add:package.
 
-		    (cat size == 0) ifTrue:[
-			cat := 'autoloaded'
-		    ].
-
-		    "/ on the fly, update the abbreviations
-		    self setFilename:abbrev forClass:clsName package:package.
-
-		    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
-
-		    cls := self
-			installAutoloadedClassNamed:clsName
-			category:cat
-			package:package
-			revision:nil
-			numClassInstVars:numClassInstVars.
+                    (cat size == 0) ifTrue:[
+                        cat := 'autoloaded'
+                    ].
+
+                    "/ on the fly, update the abbreviations
+                    self setFilename:abbrev forClass:clsName package:package.
+
+                    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
+
+                    cls := self
+                        installAutoloadedClassNamed:clsName
+                        category:cat
+                        package:package
+                        revision:nil
+                        numClassInstVars:numClassInstVars.
 
 "/                    info notNil ifTrue:[
 "/                        cls setComment:info.
 "/                    ].
-		]
-	    ]
-	]
+                ]
+            ]
+        ]
     ]
 !
 
@@ -7739,11 +7740,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.989 2012-02-14 14:25:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.990 2012-02-22 13:28:10 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.989 2012-02-14 14:25:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.990 2012-02-22 13:28:10 stefan Exp $'
 !
 
 version_SVN