[PATCH 2/2] do not include categories in method body

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

[PATCH 2/2] do not include categories in method body

Tim Felgentreff
---
 packages/stinst/parser/SqueakExporter.st |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Hi,
this and th previous patch fix the two remaining problems I had with Squeak
format converting, namely wrong newlines and inclusion of the Gnu Smalltalk style
category in the method body.
Hope just posting them like this is ok.

Regards,
Tim


diff --git a/packages/stinst/parser/SqueakExporter.st b/packages/stinst/parser/SqueakExporter.st
index 98a62b3..ab7557f 100644
--- a/packages/stinst/parser/SqueakExporter.st
+++ b/packages/stinst/parser/SqueakExporter.st
@@ -50,8 +50,9 @@ OldSyntaxExporter subclass: SqueakSyntaxExporter [
     fileOutChunk: aString [
         outStream
             nl;
-            nextPutAll: ((aString copyReplaceAll: '!' with: '!!')
-    replaceAll: Character lf with: Character cr);
+            nextPutAll: (((aString copyReplaceAll: '!' with: '!!')
+    copyReplacingRegex: '<category: .*>' with: '')
+        replaceAll: Character lf with: Character cr);
             nextPut: $!
     ]
 

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/2] do not include categories in method body

Paolo Bonzini-2
On 09/11/2009 09:03 AM, Tim Felgentreff wrote:
> ---
>   packages/stinst/parser/SqueakExporter.st |    5 +++--
>   1 files changed, 3 insertions(+), 2 deletions(-)
>
> Hi,
> this and th previous patch fix the two remaining problems I had with Squeak
> format converting, namely wrong newlines and inclusion of the Gnu Smalltalk style
> category in the method body.
> Hope just posting them like this is ok.

Yes, it's fine.  I committed it to OldSyntaxExporter instead.

Can you check whether something like this is enough?

--- a/packages/stinst/parser/SqueakExporter.st
+++ b/packages/stinst/parser/SqueakExporter.st
@@ -44,9 +44,12 @@ OldSyntaxExporter subclass: SqueakSyntaxExporter [
      ]

      fileOutChunk: aString [
+        | s |
+        s := aString copyReplaceAll: '!' with: '!!'.
+        s := s replaceAll: Character nl with: Character cr.
          outStream
              nl;
-            nextPutAll: (aString copyReplaceAll: '!' with: '!!');
+            nextPutAll: s;
              nextPut: $!
      ]

?

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk