2007-06-10 Stephen Compall * examples/Publish.st: Add Basic>>#skipWhiteExceptNewlines:, and use it in Basic>>#reformatComment:, thereby preserving multiple newlines as they appear in comments. * kernel/AbstNamespc.st: Reduce default size. * kernel/RootNamespc.st: Same. --- orig/examples/Publish.st +++ mod/examples/Publish.st @@ -295,6 +295,19 @@ ^pos ! +skipWhiteExceptNewlines: stream + "Skip up to next non-separator or newline. Answer whether stream + is not at end afterwards." + [| char | + stream atEnd ifTrue: [^false]. + char := stream next. + char isSeparator and: + [(##({Character nl. Character cr} asString) + includes: char) not]] whileTrue. + stream skip: -1. + ^true +! + skipWhite: start on: string "Answer the position of the first white character in string, starting the scan at position start" @@ -390,7 +403,7 @@ [ input atEnd ] whileFalse: [ comment nextPutAll: (input upTo: Character nl). comment nl. - self skipWhite: input + self skipWhiteExceptNewlines: input ]. ^comment contents ! --- orig/kernel/AbstNamespc.st +++ mod/kernel/AbstNamespc.st @@ -74,7 +74,7 @@ ^parent at: spaceName asGlobalKey - put: ((super new: 32) + put: ((super new: 24) setSuperspace: parent; name: spaceName asSymbol; yourself) --- orig/kernel/RootNamespc.st +++ mod/kernel/RootNamespc.st @@ -51,7 +51,7 @@ a key that references it." ^Smalltalk at: spaceName asGlobalKey - put: ((super new: 31) setSuperspace: nil) + put: ((super new: 24) setSuperspace: nil) ! !