From ffdeac19450cc8987c04d67bb2877ab1969f6ca0 Mon Sep 17 00:00:00 2001 From: jordanmontt Date: Sat, 3 Dec 2022 14:56:54 +0100 Subject: [PATCH] Renamed isForMethod to isRuleForMethod --- .../ApplyRuleOnAllClassesCommand.class.st | 2 +- src/RewriteRulesRewriter/RTRBApplier.class.st | 2 +- src/RewriteRulesRewriter/RTRenrakuApplier.class.st | 2 +- src/RewriteRulesRewriter/RTRuleHolder.class.st | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/RewriteRuleTools/ApplyRuleOnAllClassesCommand.class.st b/src/RewriteRuleTools/ApplyRuleOnAllClassesCommand.class.st index 6673f3a..42f7b4b 100644 --- a/src/RewriteRuleTools/ApplyRuleOnAllClassesCommand.class.st +++ b/src/RewriteRuleTools/ApplyRuleOnAllClassesCommand.class.st @@ -37,7 +37,7 @@ ApplyRuleOnAllClassesCommand >> execute [ ifFalse: [ ^ self ]. ruleHolder := RTAbstractApplier createRuleHolder: self context lhs -> self context rhs - isforMethod: self context isForMethod. + isforMethod: self context isRuleForMethod. changes := RTAbstractApplier defaultEngineApplier calculateAllChangesForRules: ruleHolder asOrderedCollection. diff --git a/src/RewriteRulesRewriter/RTRBApplier.class.st b/src/RewriteRulesRewriter/RTRBApplier.class.st index 5ccfde1..07431b0 100644 --- a/src/RewriteRulesRewriter/RTRBApplier.class.st +++ b/src/RewriteRulesRewriter/RTRBApplier.class.st @@ -48,7 +48,7 @@ RTRBApplier class >> rewriter: ruleHolderCollection [ | rewriter | rewriter := RBParseTreeRewriter new. ruleHolderCollection do: [ :ruleHolder | - ruleHolder isForMethod + ruleHolder isRuleForMethod ifTrue: [ rewriter replaceMethod: ruleHolder lhs with: ruleHolder rhs ] ifFalse: [ rewriter replace: ruleHolder lhs with: ruleHolder rhs ] ]. ^ rewriter diff --git a/src/RewriteRulesRewriter/RTRenrakuApplier.class.st b/src/RewriteRulesRewriter/RTRenrakuApplier.class.st index 7e87a00..5113330 100644 --- a/src/RewriteRulesRewriter/RTRenrakuApplier.class.st +++ b/src/RewriteRulesRewriter/RTRenrakuApplier.class.st @@ -45,7 +45,7 @@ Take a look on ReCriticEngine for some automation ideas. Also take a look at Com critiques := OrderedCollection new. rewriteNode := ReNodeRewriteRule new. ruleHolderCollection do: [ :aRuleHolder | - aRuleHolder isForMethod + aRuleHolder isRuleForMethod ifTrue: [ rewriteNode addMatchingMethod: aRuleHolder lhs rewriteTo: aRuleHolder rhs ] ifFalse: [ rewriteNode addMatchingExpression: aRuleHolder lhs rewriteTo: aRuleHolder rhs ] ]. methodsAsSet do: [ :method | diff --git a/src/RewriteRulesRewriter/RTRuleHolder.class.st b/src/RewriteRulesRewriter/RTRuleHolder.class.st index 2072a6d..ffcc341 100644 --- a/src/RewriteRulesRewriter/RTRuleHolder.class.st +++ b/src/RewriteRulesRewriter/RTRuleHolder.class.st @@ -52,7 +52,7 @@ RTRuleHolder class >> lhs: lhs rhs: rhs isForMethod: isForMethod [ ^ self new lhs: lhs; rhs: rhs; - isForMethod: isForMethod; + isRuleForMethod: isForMethod; yourself ] @@ -62,7 +62,7 @@ RTRuleHolder class >> lhs: lhs rhs: rhs isForMethod: isForMethod inputCode: inpu ^ self new lhs: lhs; rhs: rhs; - isForMethod: isForMethod; + isRuleForMethod: isForMethod; inputCode: inputCode; outputCode: outputCode; yourself @@ -103,13 +103,13 @@ RTRuleHolder >> isDemoRule: anObject [ ] { #category : #accessing } -RTRuleHolder >> isForMethod [ +RTRuleHolder >> isRuleForMethod [ ^ isForMethod ] { #category : #accessing } -RTRuleHolder >> isForMethod: anObject [ +RTRuleHolder >> isRuleForMethod: anObject [ isForMethod := anObject ]