diff --git a/src/FamixReplication-Smalltalk/FamixRepSmalltalkCleaner.class.st b/src/FamixReplication-Smalltalk/FamixRepSmalltalkCleaner.class.st index cb30348..c1d7f99 100644 --- a/src/FamixReplication-Smalltalk/FamixRepSmalltalkCleaner.class.st +++ b/src/FamixReplication-Smalltalk/FamixRepSmalltalkCleaner.class.st @@ -6,7 +6,7 @@ I am a cleaner to clean smalltalk method code for replication detection " Class { #name : 'FamixRepSmalltalkCleaner', - #superclass : 'FamixRepSourcesCleaner', + #superclass : 'FamixRepPairedCommentsCleaner', #category : 'FamixReplication-Smalltalk', #package : 'FamixReplication-Smalltalk' } @@ -22,28 +22,6 @@ FamixRepSmalltalkCleaner >> cleanLine: aText [ ^ (super cleanLine: aText) copyWithRegex: '\".*\"' matchesReplacedWith: '' ] -{ #category : 'actions' } -FamixRepSmalltalkCleaner >> cleanMultilineComments: aText [ - "removes all comments possibly spanning several lines without changing the number of lines - (a multi line comment becomes a set of empty lines)" - - | current commentStart commentEnd | - current := 1. - ^ String streamContents: [ :stream | - [ - commentStart := aText indexOf: $" startingAt: current. - commentEnd := aText indexOf: $" startingAt: commentStart + 1. - (commentStart > 0) and: [ commentEnd > 0 ] - ] whileTrue: [ - self copy: aText from: current to: commentStart - 1 into: stream. - current := commentStart + 1. - self copyAsEmptyLines: aText from: current to: commentEnd - 1 into: stream. - current := commentEnd + 1 - ]. - self copy: aText from: current toEndInto: stream -] -] - { #category : 'actions' } FamixRepSmalltalkCleaner >> isComment: aLine [ "we could have defined comment as @@ -52,3 +30,15 @@ FamixRepSmalltalkCleaner >> isComment: aLine [ ^ false ] + +{ #category : 'actions' } +FamixRepSmalltalkCleaner >> multilineCommentCloser [ + + ^ '"' +] + +{ #category : 'actions' } +FamixRepSmalltalkCleaner >> multilineCommentOpener [ + + ^ '"' +]