Method.st
changeset 3297 309058293d49
parent 3289 9e52625965cc
child 3341 c5773eb96bd2
--- a/Method.st	Sat Feb 21 17:40:21 1998 +0100
+++ b/Method.st	Mon Feb 23 11:14:38 1998 +0100
@@ -367,7 +367,7 @@
      from the methods source (excluding any double-quotes). 
      Returns nil if there is no comment (or source is not available)."
 
-    |src comments parser|
+    |src comment comments parser|
 
     src := self source.
     src isNil ifTrue:[^ nil].
@@ -376,11 +376,17 @@
     parser ignoreErrors; ignoreWarnings; saveComments:true.
     parser parseMethodSpec.
     comments := parser comments.
-    comments size == 0 ifTrue:[^ nil].
-    (comments first string withoutSpaces endsWith:'}') ifTrue:[
-        ^ comments at:2 ifAbsent:nil
+    comments size ~~ 0 ifTrue:[
+        comment := comments first string.
+        (comment withoutSpaces endsWith:'}') ifTrue:[
+            "if first comment is a pragma, take next comment"
+            comment := comments at:2 ifAbsent:nil.
+            comment notNil ifTrue:[
+                comment := comment string.
+            ].
+        ].
     ].
-    ^ comments first.
+    ^ comment.
 
     "
      (Method compiledMethodAt:#comment) comment  
@@ -388,6 +394,7 @@
     "
 
     "Modified: / 17.2.1998 / 14:50:00 / cg"
+    "Modified: / 23.2.1998 / 10:26:08 / stefan"
 !
 
 decompiledSource
@@ -2609,6 +2616,6 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.153 1998-02-17 17:47:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.154 1998-02-23 10:14:38 stefan Exp $'
 ! !
 Method initialize!