Fixed failed tests in CustomRefactoryBuilder
RBParser >> parseMethod: returns cached parse trees which can produce misbehaviour when the parse tree is modified
--- a/CustomParseTreeRewriter.st Mon Feb 02 22:49:19 2015 +0100
+++ b/CustomParseTreeRewriter.st Thu Feb 05 22:23:57 2015 +0100
@@ -33,7 +33,7 @@
answer := false.
oldSource isNil ifTrue: [
oldSource := aParseTree source
- ].
+ ].
oldSource isNil ifTrue: [
self error: 'We need the oldSource string to be set'.
@@ -51,7 +51,7 @@
"/Now, validates that rewritten parse tree is the same as
"/the one we get from the rewritten source:
aParseTree isMethod ifTrue: [
- treeFromRewrittenSource := RBParser parseMethod: newSource onError:[:error :position|nil].
+ treeFromRewrittenSource := RBParser parseRewriteMethod: newSource onError:[:error :position|nil].
] ifFalse: [
treeFromRewrittenSource := RBParser parseExpression: newSource onError:[:error :position|nil].
].
@@ -67,7 +67,7 @@
^answer
"Created: / 09-12-2014 / 21:16:33 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
- "Modified: / 10-12-2014 / 22:37:08 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 05-02-2015 / 22:07:20 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
newSource
--- a/CustomRefactoryBuilder.st Mon Feb 02 22:49:19 2015 +0100
+++ b/CustomRefactoryBuilder.st Thu Feb 05 22:23:57 2015 +0100
@@ -220,27 +220,27 @@
Assume thats expression and if parsing fails then try method parsing."
^ self parser parseExpression: aSourceCode onError: [ :string :pos |
- self parser parseMethod: aSourceCode onError: [ :string :pos |
+ self parser parseRewriteMethod: aSourceCode onError: [ :string :pos |
self error: 'Could not parse ', string, ' at pos ', pos asString
]
]
"Created: / 25-08-2014 / 22:34:49 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
- "Modified (comment): / 10-12-2014 / 22:06:18 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 05-02-2015 / 21:55:08 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
parseMethod: aSourceCode
"Helper for retrieving parse tree from source code string.
Assume thats method and if parsing fails then try expression parsing."
- ^ self parser parseMethod: aSourceCode onError: [ :string :pos |
+ ^ self parser parseRewriteMethod: aSourceCode onError: [ :string :pos |
self parser parseExpression: aSourceCode onError: [ :string :pos |
self error: 'Could not parse ', string, ' at pos ', pos asString
]
]
"Created: / 25-08-2014 / 22:35:32 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
- "Modified (comment): / 10-12-2014 / 22:06:55 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 05-02-2015 / 21:55:23 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
!CustomRefactoryBuilder methodsFor:'refactory - changes'!
@@ -308,7 +308,7 @@
].
"Created: / 24-08-2014 / 10:24:52 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
- "Modified (comment): / 10-12-2014 / 21:54:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 05-02-2015 / 21:57:49 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
initializeChange: aChangeClass
--- a/patches/patches.rc Mon Feb 02 22:49:19 2015 +0100
+++ b/patches/patches.rc Thu Feb 05 22:23:57 2015 +0100
@@ -4,7 +4,7 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,2,32767,32767
- PRODUCTVERSION 6,2,5,1516
+ PRODUCTVERSION 6,2,5,1525
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
VALUE "InternalName", "jn:refactoring_custom/patches\0"
VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
VALUE "ProductName", "LibraryName\0"
- VALUE "ProductVersion", "6.2.5.1516\0"
- VALUE "ProductDate", "Mon, 02 Feb 2015 21:48:19 GMT\0"
+ VALUE "ProductVersion", "6.2.5.1525\0"
+ VALUE "ProductDate", "Thu, 05 Feb 2015 21:20:11 GMT\0"
END
END
--- a/refactoring_custom.rc Mon Feb 02 22:49:19 2015 +0100
+++ b/refactoring_custom.rc Thu Feb 05 22:23:57 2015 +0100
@@ -4,7 +4,7 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,2,32767,32767
- PRODUCTVERSION 6,2,5,1516
+ PRODUCTVERSION 6,2,5,1525
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
VALUE "InternalName", "jn:refactoring_custom\0"
VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
VALUE "ProductName", "ProductName\0"
- VALUE "ProductVersion", "6.2.5.1516\0"
- VALUE "ProductDate", "Mon, 02 Feb 2015 21:48:16 GMT\0"
+ VALUE "ProductVersion", "6.2.5.1525\0"
+ VALUE "ProductDate", "Thu, 05 Feb 2015 21:20:10 GMT\0"
END
END