[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] [PATCH 3/7] convert: Convert carriage returns to newlin
From: |
Holger Hans Peter Freyther |
Subject: |
[Help-smalltalk] [PATCH 3/7] convert: Convert carriage returns to newlines in comments |
Date: |
Mon, 19 Aug 2013 14:48:03 +0200 |
Pharo started to use only a carriage return in class comments,
re-add the SyntaxConverter and replace the cr with a nl. This
is not the best place to do (as it impacts all conversions) but
it is not clear where one could at it.
2013-08-10 Holger Hans Peter Freyther <address@hidden>
* scripts/Convert.st: Replace \r with \n in class comments.
---
ChangeLog | 4 ++++
scripts/Convert.st | 20 +++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 95ff619..e01eccc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2013-08-10 Holger Hans Peter Freyther <address@hidden>
+ * scripts/Convert.st: Replace \r with \n in class comments.
+
+2013-08-10 Holger Hans Peter Freyther <address@hidden>
+
* scripts/Convert.st: Use the STTools tools instead of the
current code.
diff --git a/scripts/Convert.st b/scripts/Convert.st
index a7a402e..41f109f 100644
--- a/scripts/Convert.st
+++ b/scripts/Convert.st
@@ -81,17 +81,35 @@ String extend [
]
]
+
+STTools.Loader subclass: SyntaxConverter [
+ <category: 'Converter'>
+
+ doEmitStuff [
+ classesToEmit keysAndValuesDo: [:key :value |
+ | comment |
+ "Fixes for carriage return in Pharo"
+ comment := key comment.
+ comment ifNotNil: [
+ comment := comment replaceAll: Character cr with: Character nl.
+ key comment: comment.
+ ]].
+
+ super doEmitStuff.
+ ]
+]
Eval [
| helpString inFile outFile quiet verbose converter filter parser
args inFormats outFormats rules |
+
args := OrderedCollection new.
parser := STInST.STFileInParser.
quiet := false.
verbose := false.
outFile := nil.
filter := [ :class | true ].
- converter := STTools.Loader new.
+ converter := SyntaxConverter new.
STInST.FileOutExporter defaultExporter: STInST.FormattingExporter.
outFormats := Dictionary from: {
'gst2' -> STInST.OldSyntaxExporter.
--
1.8.3.2
- [Help-smalltalk] [PATCH 1/7] kernel: Add primitives for link, fsync, fdatasync and sync and expose them, Holger Hans Peter Freyther, 2013/08/19
- [Help-smalltalk] [PATCH 2/7] convert: Use the STTools.Loader from the Convert.st, Holger Hans Peter Freyther, 2013/08/19
- [Help-smalltalk] [PATCH 4/7] stinst: Add #methodRecompilationSourceString to LoadedMethod, Holger Hans Peter Freyther, 2013/08/19
- [Help-smalltalk] [PATCH 3/7] convert: Convert carriage returns to newlines in comments,
Holger Hans Peter Freyther <=
- [Help-smalltalk] [PATCH 5/7] stinst: Omit the trailing ! from chunk encoding in Squeak, Holger Hans Peter Freyther, 2013/08/19
- [Help-smalltalk] [PATCH 6/7] visualgst: Add STInST.STClassLoaderObjects.LoadedMethod>>#methodViewIcon, Holger Hans Peter Freyther, 2013/08/19
- [Help-smalltalk] [PATCH 7/7] visualgst: Rename RunTestCommand to DebugTestCommand, Holger Hans Peter Freyther, 2013/08/19