[PATCH] gst-doc adjustments for new syntax

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

[PATCH] gst-doc adjustments for new syntax

Paolo Bonzini
Mostly regarding guessing comments like "Answer 'true'."

Paolo

* local directory is at [hidden email]--2004b/smalltalk--devo--2.2--patch-580
* comparing to [hidden email]--2004b/smalltalk--devo--2.2--patch-580
M  ./packages/stinst/doc/Publish.st
M  ./scripts/GenDoc.st

* modified files

--- orig/packages/stinst/doc/Publish.st
+++ mod/packages/stinst/doc/Publish.st
@@ -411,7 +411,7 @@ extractComment: source
 
     ^isCommented
  ifTrue: [ self reformatComment: comment ]
- ifFalse: [ self guessComment: source ]
+ ifFalse: [ self guessComment: comment contents ]
 !
 
 guessComment: source
@@ -427,26 +427,31 @@ guessComment: source
  ifTrue: [ ^'This method''s functionality should be implemented by subclasses of ',
     self currentClass asClass printString ].
 
-    n := self skipWhite: 1 on: source.
-    n > source size ifTrue: [ ^'Answer the receiver.' ].
-
-    m := self skipToWhite: n on: source.
-    start := source copyFrom: n to: m - 1.
+    n := 1.
+    [
+        n := self skipWhite: n on: source.
+ (n > source size or: [ ']"' includes: (source at: n) ])
+            ifTrue: [ ^'Answer the receiver.' ].
 
-    m <= source size ifTrue: [
+        m := self skipToWhite: n on: source.
+        start := source copyFrom: n to: m - 1.
  n := self skipWhite: m on: source.
- n <= source size ifTrue: [
-    (source at: n) = $" ifFalse: [
- (source at: n) = $! ifFalse: [ ^'Not commented.' ]
-    ]
- ]
-    ].
-    start = '^self'
- ifTrue: [ ^'Answer the receiver.' ].
 
-    ^(start at: 1) = $^
- ifTrue: [ 'Answer `', (start copyFrom: 2 to: start size), '''.' ]
- ifFalse: [ 'Not commented' ]
+        (start notEmpty and: [ (start at: 1) = $^
+ and: [ n > source size
+  or: [ ']"' includes: (source at: n) ]]]) ifTrue: [
+    start = '^self'
+ ifTrue: [ ^'Answer the receiver.' ].
+    ^'Answer `', (start copyFrom: 2 to: start size), '''.' ].
+
+ n <= source size ifTrue: [
+    (source at: n) = $<
+ ifTrue: [ n := source indexOf: $> startingAt: n ]
+        ifFalse: [
+    (']"' includes: (source at: n))
+ ifFalse: [ ^'Not commented.' ] ].
+    n := n + 1 ].
+    ] repeat
 ! !
 
 
@@ -1255,7 +1260,7 @@ emitSelectorAndMethod: association
         emitMethodSelector: association key;
  emitCrossReferences: comment;
  nextPutAll: '@item ';
- nextPutAllText: (selAndBody at: 1);
+ nextPutAllText: ((selAndBody at: 1) copyWithout: Character nl);
  nl;
  nextPutAllText: comment;
  nl; nl


--- orig/scripts/GenDoc.st
+++ mod/scripts/GenDoc.st
@@ -81,7 +81,7 @@ Options:
         file := FileStream open: each mode: FileStream read.
         loader
             parseSmalltalkStream: file
-            with: STInST.STFileInParser ].
+            with: STInST.GSTFileInParser ].
 
     loader currentNamespace: Smalltalk ].
 
@@ -89,7 +89,7 @@ Options:
     file := FileStream open: arg mode: FileStream read.
     loader
         parseSmalltalkStream: file
-        with: STInST.STFileInParser ].
+        with: STInST.GSTFileInParser ].
 
         opt isNil ifTrue: [ classPatterns add: arg ] ]
 




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