Skip to content

Commit

Permalink
#methodComments is a strang method... it returns all comments at the …
Browse files Browse the repository at this point in the history
…level of the method, but including comments on arguments.

There are no clients.  It is not clear why this is needed as an API method.
  • Loading branch information
MarcusDenker committed Jul 10, 2020
1 parent a2ba9b1 commit 4cc1c32
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 23 deletions.
8 changes: 0 additions & 8 deletions src/AST-Core/RBMethodNode.class.st
Expand Up @@ -472,14 +472,6 @@ RBMethodNode >> methodClass: aClass [
self compilationContext class: aClass
]

{ #category : #accessing }
RBMethodNode >> methodComments [
| methodComments |
methodComments := OrderedCollection withAll: self comments.
arguments do: [:each | methodComments addAll: each comments].
^methodComments asSortedCollection: [:a :b | a start < b start]
]

{ #category : #accessing }
RBMethodNode >> methodNode [
^self
Expand Down
5 changes: 0 additions & 5 deletions src/AST-Core/RBProgramNode.class.st
Expand Up @@ -655,11 +655,6 @@ RBProgramNode >> matchList: matchNodes index: matchIndex against: programNodes i
inContext: aDictionary
]

{ #category : #accessing }
RBProgramNode >> methodComments [
^self comments
]

{ #category : #accessing }
RBProgramNode >> methodNode [
^parent ifNotNil: [parent methodNode]
Expand Down
10 changes: 0 additions & 10 deletions src/AST-Core/RBSequenceNode.class.st
Expand Up @@ -358,16 +358,6 @@ RBSequenceNode >> match: aNode inContext: aDictionary [
inContext: aDictionary]
]

{ #category : #accessing }
RBSequenceNode >> methodComments [
| methodComments |
methodComments := OrderedCollection withAll: self comments.
temporaries do: [:each | methodComments addAll: each comments].
(parent notNil and: [parent isBlock])
ifTrue: [parent arguments do: [:each | methodComments addAll: each comments]].
^methodComments asSortedCollection: [:a :b | a start < b start]
]

{ #category : #'accessing-token' }
RBSequenceNode >> periods [
^ periods
Expand Down
9 changes: 9 additions & 0 deletions src/Deprecated90/RBMethodNode.extension.st
@@ -1,5 +1,14 @@
Extension { #name : #RBMethodNode }

{ #category : #'*Deprecated90' }
RBMethodNode >> methodComments [
| methodComments |
self deprecated: 'no users, will be removed in Pharo10'.
methodComments := OrderedCollection withAll: self comments.
arguments do: [:each | methodComments addAll: each comments].
^methodComments asSortedCollection: [:a :b | a start < b start]
]

{ #category : #'*Deprecated90' }
RBMethodNode >> primitiveSources [
self deprecated: 'please use the #pragmas directly'.
Expand Down
9 changes: 9 additions & 0 deletions src/Deprecated90/RBProgramNode.extension.st
@@ -0,0 +1,9 @@
Extension { #name : #RBProgramNode }

{ #category : #'*Deprecated90' }
RBProgramNode >> methodComments [
self
deprecated: 'Please use #comments instead'
transformWith: '`@receiver methodComments' -> '`@receiver comments'.
^self comments
]
12 changes: 12 additions & 0 deletions src/Deprecated90/RBSequenceNode.extension.st
@@ -0,0 +1,12 @@
Extension { #name : #RBSequenceNode }

{ #category : #'*Deprecated90' }
RBSequenceNode >> methodComments [
| methodComments |
self deprecated: 'no users, will be removed in Pharo10'.
methodComments := OrderedCollection withAll: self comments.
temporaries do: [:each | methodComments addAll: each comments].
(parent notNil and: [parent isBlock])
ifTrue: [parent arguments do: [:each | methodComments addAll: each comments]].
^methodComments asSortedCollection: [:a :b | a start < b start]
]

0 comments on commit 4cc1c32

Please sign in to comment.