The Trunk: System-ul.394.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-ul.394.mcz

commits-2
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.394.mcz

==================== Summary ====================

Name: System-ul.394
Author: ul
Time: 16 November 2010, 6:14:45.768 am
UUID: a5bf1c79-3009-6b48-8c91-7454b6b9d9a2
Ancestors: System-ul.393

- restored word-based diffing in ClassDiffBuilder, because it gives unusable results when the definitions/comments are too different. As an enhancement to the original word-based method $' and $" are treated as separators. Separators are not appended to the end of the words, but treated as separate strings.

=============== Diff against System-ul.393 ===============

Item was changed:
  ----- Method: ClassDiffBuilder>>print:withAttributes:on: (in category 'private') -----
+ print: aString withAttributes: attributes on: stream
- print: aCharacter withAttributes: attributes on: stream
 
  stream
  currentAttributes: attributes;
+ nextPutAll: aString!
- nextPut: aCharacter!

Item was changed:
  ----- Method: ClassDiffBuilder>>split: (in category 'private') -----
  split: aString
+ "I return an array with aString splitted by whitespace ' and ""."
- "Diff by characters."
 
+ ^Array streamContents: [ :stream |
+ | input separators |
+ input := aString readStream.
+ separators := CharacterSet separators
+ add: $'; "for variables"
+ add: $"; "for comments in mc"
+ yourself.
+ [ input atEnd ] whileFalse: [
+ | word separator |
+ word := input
+ upToAnyOf: separators
+ do: [ :matchingSeparator |
+ separator := matchingSeparator ].
+ stream nextPut: word.
+ separator ifNotNil: [
+ stream nextPut: separator asString ] ] ]!
- ^aString as: Array!