Status: Accepted
Owner: [hidden email] Labels: Type-Cleanup New issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495 Don't know why it uses font widths to determine comments line breaks. It should not reformat my comments like that ¬¬. printSingleComment: aString on: aStream indent: indent "Print the comment string, assuming it has been indented indent tabs. Break the string at word breaks, given the widths in the default font, at 450 points." | readStream word position lineBreak font wordWidth tabWidth spaceWidth lastChar | readStream := aString readStream. font := TextStyle default defaultFont. tabWidth := DefaultTab. spaceWidth := font widthOf: Character space. position := indent * tabWidth. lineBreak := 450. [readStream atEnd] whileFalse: [word := self nextWordFrom: readStream setCharacter: [:lc | lastChar := lc]. wordWidth := word inject: 0 into: [:width :char | width + (font widthOf: char)]. position := position + wordWidth. position > lineBreak ifTrue: [aStream skip: -1; crtab: indent. position := indent * tabWidth + wordWidth + spaceWidth. lastChar = Character cr ifTrue: [[readStream peekFor: Character tab] whileTrue]. word isEmpty ifFalse: [aStream nextPutAll: word; space]] ifFalse: [aStream nextPutAll: word. readStream atEnd ifFalse: [position := position + spaceWidth. aStream space]. lastChar = Character cr ifTrue: [aStream skip: -1; crtab: indent. position := indent * tabWidth. [readStream peekFor: Character tab] whileTrue]]] _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #2 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495 This method also has a dependency on TextConstants... I've tried replacing this method by a simple printSingleComment: aString on: aStream indent: indent aStream nextPutAll: aString Without bad side effects so far... What do you think? _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: FixReviewNeeded Comment #3 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495 Even Tests look good. I've run them all. Name: SLICE-Issue-5495-Compiler-depending-on-TextStyle-GuillermoPolito.1 Author: GuillermoPolito Time: 1 July 2012, 7:45:40.948 pm UUID: 1e558a7f-d724-4fa7-83d1-afb724d31834 Ancestors: Dependencies: Compiler-GuillermoPolito.333 removed dependency against tests. Opal, come quickly!!!11oneoneone!! _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: MonkeyIsChecking Comment #4 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495#c4 The Monkey is currently checking this issue. Please don't change it! _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: ValidatedByTheMonkey Comment #5 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495#c5 This Issue has been checked by Ulysse the Monkey 5282 tests passed in 00:00:23s: =============================== CollectionsTests-Arrayed (547) CollectionsTests-Atomic (12) CollectionsTests-Sequenceable (907) CollectionsTests-SplitJoin (27) CollectionsTests-Stack (16) CollectionsTests-Streams (37) CollectionsTests-Strings (592) CollectionsTests-Support (12) CollectionsTests-Unordered (1951) CollectionsTests-Weak (739) CompilerTests (358) SUnit-Core-Extensions (3) SUnit-Core-Utilities (3) SUnit-Tests-Core (78) ---------------------------------------------------------- Loaded Source: SLICE-Issue-5495-Compiler-depending-on-TextStyle-GuillermoPolito.1 from http://ss3.gemstone.com/ss/PharoInbox Tested using Pharo-2.0-20175-a on CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, https://git.gitorious.org/cogvm/blessed.git Commit: 744bfe905c78a1a5d408680a8780367ea77e0549 Date: Fri Jun 1 15:17:41 2012 +0200 By: Esteban Lorenzano <[hidden email]> _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: MonkeyIsChecking Comment #6 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495#c6 The Monkey is currently checking this issue. Please don't change it! _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: ValidatedByTheMonkey Labels: CheckedIn20176 Comment #7 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495#c7 This Issue has been checked by Ulysse the Monkey 5282 tests passed in 00:00:22s: =============================== CollectionsTests-Arrayed (547) CollectionsTests-Atomic (12) CollectionsTests-Sequenceable (907) CollectionsTests-SplitJoin (27) CollectionsTests-Stack (16) CollectionsTests-Streams (37) CollectionsTests-Strings (592) CollectionsTests-Support (12) CollectionsTests-Unordered (1951) CollectionsTests-Weak (739) CompilerTests (358) SUnit-Core-Extensions (3) SUnit-Core-Utilities (3) SUnit-Tests-Core (78) ---------------------------------------------------------- Loaded Source: SLICE-Issue-5495-Compiler-depending-on-TextStyle-GuillermoPolito.1 from http://ss3.gemstone.com/ss/PharoInbox Tested using Pharo-2.0-20176-a on CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, https://git.gitorious.org/cogvm/blessed.git Commit: 744bfe905c78a1a5d408680a8780367ea77e0549 Date: Fri Jun 1 15:17:41 2012 +0200 By: Esteban Lorenzano <[hidden email]> _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Comment #8 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495 The problem with this is that I guess it will break the pretty printer... (not indenting) But on the other hand, we should replace it anyway. So I will add it. _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Updates:
Status: Integrated Comment #9 on issue 5495 by [hidden email]: Compiler depending on TextStyle http://code.google.com/p/pharo/issues/detail?id=5495 in 2.0 177 _______________________________________________ Pharo-bugtracker mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker |
Free forum by Nabble | Edit this page |