From 2bc6f0adaec444600a5b0b65424bf31042edb6d0 Mon Sep 17 00:00:00 2001 From: Joana Bergsiek Date: Sat, 7 Oct 2023 19:21:19 +0200 Subject: [PATCH] Adds test and deletes comments --- .../instance/removeFromMethod..st | 2 +- .../BPAnnotation.class/methodProperties.json | 2 +- .../instance/addProbe..st | 2 +- .../instance/at..st | 2 +- .../instance/removeProbe..st | 2 +- .../instance/asMorph.st | 4 +--- .../instance/assignedClassName..st | 1 + .../instance/assignedClassName.st | 1 + .../instance/deleteLinkedProbes.st | 1 + .../instance/instrumentationCallFor..st | 1 + .../methodProperties.json | 10 +++++----- .../bpTraceVariable.forProbe.inContext..st | 12 ------------ .../Object.extension/methodProperties.json | 1 - .../testCorrectIntervalForInstanceVariable.st | 2 ++ ...valForExistingVariableAndPerfectSelection.st | 5 +++++ ...orExistingVariableIgnoresSpaceInSelection.st | 5 +++++ ...ervalForExistingVariableButWrongSelection.st | 5 +++++ ...ractsCorrectInstanceVariableProbeInterval.st | 2 ++ ...stHasCorrectInstanceVariableProbeInterval.st | 2 ++ .../BPBrowserTest.class/methodProperties.json | 6 ++++++ .../testExtractVariableAssignmentIntervals.st | 5 +++++ ...tingLeftHandOfDoubleNestedAssignmentProbe.st | 13 +++++++++++++ ...tingLeftHandOfTripleNestedAssignmentProbe.st | 13 +++++++++++++ .../BPCompilerTest.class/methodProperties.json | 3 +++ .../instance/testNestedAnnotatedAssignments.st | 17 +++++++++++++++++ .../methodProperties.json | 1 + .../BPTestExamplesClass.class/instance/foo..st | 3 +++ .../BPTestExamplesClass.class/instance/foo.st | 3 +++ .../BPTestExamplesClass.class/instance/foo2..st | 3 +++ .../BPTestExamplesClass.class/instance/foo2.st | 3 +++ .../instance/methodSettingInstanceVars.st | 17 +++++++++++++++++ .../methodProperties.json | 5 +++++ .../BPTestExamplesClass.class/properties.json | 3 ++- ...eIn.for..st => applyInstanceProbeIn.for..st} | 6 +++--- .../BPStyler.class/instance/formatNonMethod..st | 2 +- .../BPStyler.class/methodProperties.json | 4 ++-- ...determineIntervalOfVariableNameIn.having..st | 3 --- .../CodeHolder.extension/methodProperties.json | 2 +- 38 files changed, 137 insertions(+), 37 deletions(-) delete mode 100644 packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testCorrectIntervalForInstanceVariable.st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection.st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection.st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesNoIntervalForExistingVariableButWrongSelection.st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testExtractsCorrectInstanceVariableProbeInterval.st create mode 100644 packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testHasCorrectInstanceVariableProbeInterval.st create mode 100644 packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testExtractVariableAssignmentIntervals.st create mode 100644 packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfDoubleNestedAssignmentProbe.st create mode 100644 packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfTripleNestedAssignmentProbe.st create mode 100644 packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/instance/testNestedAnnotatedAssignments.st create mode 100644 packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo..st create mode 100644 packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo.st create mode 100644 packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2..st create mode 100644 packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2.st create mode 100644 packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/methodSettingInstanceVars.st rename packages/Babylonian-UI.package/BPStyler.class/instance/{applyInstanceVariableIn.for..st => applyInstanceProbeIn.for..st} (68%) diff --git a/packages/Babylonian-Core.package/BPAnnotation.class/instance/removeFromMethod..st b/packages/Babylonian-Core.package/BPAnnotation.class/instance/removeFromMethod..st index d81d818b..b9d4b532 100644 --- a/packages/Babylonian-Core.package/BPAnnotation.class/instance/removeFromMethod..st +++ b/packages/Babylonian-Core.package/BPAnnotation.class/instance/removeFromMethod..st @@ -1,7 +1,7 @@ initialize-release removeFromMethod: aCompiledMethod - "Intended to delete annotations but not the enclosed expression from outside a browser" + "Intended to delete annotations from outside a browser" aCompiledMethod bpAnnotations detect: [:anAnnotation | anAnnotation id = self id ] ifFound: [:theAnnotationToRemove | | text startOfTag expressionStart replacementStart replacementEnd | diff --git a/packages/Babylonian-Core.package/BPAnnotation.class/methodProperties.json b/packages/Babylonian-Core.package/BPAnnotation.class/methodProperties.json index b97893df..2ae977a7 100644 --- a/packages/Babylonian-Core.package/BPAnnotation.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPAnnotation.class/methodProperties.json @@ -31,7 +31,7 @@ "morphClass" : "jb 3/5/2022 12:54", "otherInformation" : "pre 5/29/2019 10:59", "otherInformation:" : "jb 12/7/2020 18:06", - "removeFromMethod:" : "joabe 10/5/2023 17:28", + "removeFromMethod:" : "joabe 10/6/2023 14:28", "startTag" : "pre 5/10/2021 09:44", "startTagSource" : "jb 12/7/2020 18:06", "startTagSource:" : "pre 5/29/2019 10:59", diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st index 82b0fe5a..442a0b8a 100644 --- a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/addProbe..st @@ -1,4 +1,4 @@ -as yet unclassified +actions addProbe: aProbe nameToProbesDict at: aProbe assignedClassName diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/at..st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/at..st index d81a8005..fa57f84f 100644 --- a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/at..st +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/at..st @@ -1,4 +1,4 @@ -as yet unclassified +accessing at: aClassName ^ nameToProbesDict at: aClassName \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st index 405c92a9..7e8930e8 100644 --- a/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st +++ b/packages/Babylonian-Core.package/BPClassNameToInstanceProbes.class/instance/removeProbe..st @@ -1,4 +1,4 @@ -as yet unclassified +actions removeProbe: aProbe nameToProbesDict at: aProbe assignedClassName diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st index 937e2b7d..6a60304e 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/asMorph.st @@ -2,8 +2,6 @@ morphic asMorph | newMorph | - newMorph := BPInstanceVariableProbeMorph new - annotation: self; - yourself. + newMorph := BPInstanceVariableProbeMorph new annotation: self; yourself. self updateTextAnchorPropertiesOf: newMorph. ^ newMorph \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName..st index 0ba85068..ce428841 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName..st +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName..st @@ -1,3 +1,4 @@ accessing assignedClassName: aString + assignedClassName := aString \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName.st index bb613fb3..72a04577 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName.st +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/assignedClassName.st @@ -1,3 +1,4 @@ accessing assignedClassName + ^ assignedClassName \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/deleteLinkedProbes.st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/deleteLinkedProbes.st index 0fa79817..8ac1def4 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/deleteLinkedProbes.st +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/deleteLinkedProbes.st @@ -3,6 +3,7 @@ deleteLinkedProbes | browser | browser := BPBrowser open. + self linkedProbes do: [:aProbe | browser browseReference: aProbe methodReference. browser removeAnnotations: {aProbe}]. diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st index 95c019d7..b0347ba3 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/instance/instrumentationCallFor..st @@ -1,6 +1,7 @@ serialization instrumentationCallFor: actualEnclosedExpressionSource + "Currently not used as instance probes do not rewrite a class definition in which they exist" ^ '(self bpTraceVariable: [{1}] forProbe: {2} linked: \{{3}\} inContext: thisContext)' format: {actualEnclosedExpressionSource . self id. diff --git a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json index cd4f0cee..5eb06d6a 100644 --- a/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPInstanceVariableProbe.class/methodProperties.json @@ -2,13 +2,13 @@ "class" : { "annotationTag" : "joabe 9/25/2023 17:30" }, "instance" : { - "asMorph" : "joabe 9/21/2023 22:32", - "assignedClassName" : "joabe 9/28/2023 15:45", - "assignedClassName:" : "joabe 9/28/2023 15:46", + "asMorph" : "joabe 10/6/2023 14:43", + "assignedClassName" : "joabe 10/6/2023 14:40", + "assignedClassName:" : "joabe 10/6/2023 14:40", "canBeAnnotatedTo" : "joabe 9/21/2023 21:08", - "deleteLinkedProbes" : "joabe 10/5/2023 17:34", + "deleteLinkedProbes" : "joabe 10/6/2023 14:40", "initialize" : "joabe 10/4/2023 15:33", - "instrumentationCallFor:" : "joabe 10/4/2023 15:37", + "instrumentationCallFor:" : "joabe 10/7/2023 18:25", "isInstanceVariableProbe" : "joabe 9/21/2023 21:18", "linkedProbes" : "joabe 10/4/2023 15:33", "probeTypeTag" : "joabe 9/25/2023 17:30", diff --git a/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st b/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st deleted file mode 100644 index 5b2eb2c1..00000000 --- a/packages/Babylonian-Core.package/Object.extension/instance/bpTraceVariable.forProbe.inContext..st +++ /dev/null @@ -1,12 +0,0 @@ -*Babylonian-Core -bpTraceVariable: aVariableName forProbe: probeId inContext: aContext - - - self halt. - ^ aVariableName value, ' ' - "^ #bpInstrumented withoutLayerDo: [ - BPActiveTracer value - trace: anObject - through: [:r | r] - forProbe: probeId - inContext: aContext]" \ No newline at end of file diff --git a/packages/Babylonian-Core.package/Object.extension/methodProperties.json b/packages/Babylonian-Core.package/Object.extension/methodProperties.json index a6d135d8..2940c610 100644 --- a/packages/Babylonian-Core.package/Object.extension/methodProperties.json +++ b/packages/Babylonian-Core.package/Object.extension/methodProperties.json @@ -13,5 +13,4 @@ "bpTrace:through:forProbe:inContext:" : "jb 11/29/2020 22:12", "bpTraceAssignmentOf:before:forProbe:inContext:" : "pre 7/6/2020 18:34", "bpTraceExecutionResult:" : "jb 12/30/2021 21:20", - "bpTraceVariable:forProbe:inContext:" : "joabe 9/27/2023 13:36", "isLiveSpecimenReference" : "pre 1/10/2023 16:16" } } diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testCorrectIntervalForInstanceVariable.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testCorrectIntervalForInstanceVariable.st new file mode 100644 index 00000000..38ea13ff --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testCorrectIntervalForInstanceVariable.st @@ -0,0 +1,2 @@ +as yet unclassified +testCorrectIntervalForInstanceVariable \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection.st new file mode 100644 index 00000000..a3cafbe8 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection.st @@ -0,0 +1,5 @@ +as yet unclassified +testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection + + browser selectClassNamed: #BPTestExamplesClass. + self assert: (69 to: 71) equals: (browser determineIntervalToAnnotateFor: (BPInstanceVariableProbe new variableName: 'foo') in: (69 to: 71)) \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection.st new file mode 100644 index 00000000..f243a617 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection.st @@ -0,0 +1,5 @@ +as yet unclassified +testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection + + browser selectClassNamed: #BPTestExamplesClass. + self assert: (69 to: 71) equals: (browser determineIntervalToAnnotateFor: (BPInstanceVariableProbe new variableName: 'foo') in: (68 to: 71)) \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesNoIntervalForExistingVariableButWrongSelection.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesNoIntervalForExistingVariableButWrongSelection.st new file mode 100644 index 00000000..3c548959 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testDeterminesNoIntervalForExistingVariableButWrongSelection.st @@ -0,0 +1,5 @@ +as yet unclassified +testDeterminesNoIntervalForExistingVariableButWrongSelection + + browser selectClassNamed: #BPTestExamplesClass. + self assert: nil equals: (browser determineIntervalToAnnotateFor: (BPInstanceVariableProbe new variableName: 'foo') in: (66 to: 71)) \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testExtractsCorrectInstanceVariableProbeInterval.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testExtractsCorrectInstanceVariableProbeInterval.st new file mode 100644 index 00000000..1538476a --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testExtractsCorrectInstanceVariableProbeInterval.st @@ -0,0 +1,2 @@ +as yet unclassified +testExtractsCorrectInstanceVariableProbeInterval \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testHasCorrectInstanceVariableProbeInterval.st b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testHasCorrectInstanceVariableProbeInterval.st new file mode 100644 index 00000000..d797ab65 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/instance/testHasCorrectInstanceVariableProbeInterval.st @@ -0,0 +1,2 @@ +as yet unclassified +testHasCorrectInstanceVariableProbeInterval \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPBrowserTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPBrowserTest.class/methodProperties.json index 28f6e295..4e50b92e 100644 --- a/packages/Babylonian-Tests.package/BPBrowserTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPBrowserTest.class/methodProperties.json @@ -6,5 +6,11 @@ "setUp" : "jb 12/7/2020 19:05", "tearDown" : "lu 1/23/2022 21:25", "testClosesSidePane" : "joabe 5/9/2023 17:06", + "testCorrectIntervalForInstanceVariable" : "joabe 10/7/2023 18:44", "testDeleteMethod" : "jb 12/6/2021 22:32", + "testDeterminesCorrectIntervalForExistingVariableAndPerfectSelection" : "joabe 10/7/2023 19:03", + "testDeterminesCorrectIntervalForExistingVariableIgnoresSpaceInSelection" : "joabe 10/7/2023 19:03", + "testDeterminesNoIntervalForExistingVariableButWrongSelection" : "joabe 10/7/2023 19:04", + "testExtractsCorrectInstanceVariableProbeInterval" : "joabe 10/7/2023 18:41", + "testHasCorrectInstanceVariableProbeInterval" : "joabe 10/7/2023 18:43", "testOpensSidePane" : "joabe 5/9/2023 17:07" } } diff --git a/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testExtractVariableAssignmentIntervals.st b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testExtractVariableAssignmentIntervals.st new file mode 100644 index 00000000..b217747f --- /dev/null +++ b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testExtractVariableAssignmentIntervals.st @@ -0,0 +1,5 @@ +tests +testExtractVariableAssignmentIntervals + + self assert: {76@83 . 139@146} + equals: ((BPTestExamplesClass >> #methodSettingInstanceVars) bpExtractVariableAssignmentRangesNamed: 'foo') \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfDoubleNestedAssignmentProbe.st b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfDoubleNestedAssignmentProbe.st new file mode 100644 index 00000000..a5e9c7b0 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfDoubleNestedAssignmentProbe.st @@ -0,0 +1,13 @@ +tests +testRewritingLeftHandOfDoubleNestedAssignmentProbe + + self + assertCompilerRewrites: +'method + | variable | + """"variable := 2 raisedTo: 3"""".' + to: +'method + + | variable | +(self bpTraceAssignmentOf: [(self bpTraceAssignmentOf: [variable := 2 raisedTo: 3] before: {''variable'' . variable} forProbe: 1 inContext: thisContext)] before: {} forProbe: 2 inContext: thisContext).' \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfTripleNestedAssignmentProbe.st b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfTripleNestedAssignmentProbe.st new file mode 100644 index 00000000..cd46ba10 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPCompilerTest.class/instance/testRewritingLeftHandOfTripleNestedAssignmentProbe.st @@ -0,0 +1,13 @@ +tests +testRewritingLeftHandOfTripleNestedAssignmentProbe + + self + assertCompilerRewrites: +'method + | variable | + """"""variable := 2 raisedTo: 3"""""".' + to: +'method + + | variable | +(self bpTraceAssignmentOf: [(self bpTraceAssignmentOf: [(self bpTraceAssignmentOf: [variable := 2 raisedTo: 3] before: {''variable'' . variable} forProbe: 1 inContext: thisContext)] before: {} forProbe: 2 inContext: thisContext)] before: {} forProbe: 3 inContext: thisContext).' \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPCompilerTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPCompilerTest.class/methodProperties.json index 672aa4a7..91cc6c87 100644 --- a/packages/Babylonian-Tests.package/BPCompilerTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPCompilerTest.class/methodProperties.json @@ -7,6 +7,7 @@ "setUp" : "jb 12/7/2020 19:06", "testCompileSilentlyAddsAnnotationsProperly" : "pre 7/22/2022 22:02", "testCompilerRecognizesMethodsThatRequireRecompilation" : "jb 12/7/2020 19:06", + "testExtractVariableAssignmentIntervals" : "joabe 10/7/2023 18:32", "testFromFormattedSourceCodeToAnnotatedSourceCode" : "pre 2/22/2021 18:03", "testRewritingBinaryMessageChainProbe" : "pre 2/22/2021 17:16", "testRewritingDoesNotAddTwoLayerPragmas" : "pre 7/23/2022 15:51", @@ -21,6 +22,8 @@ "testRewritingKeywordMessageUnaryReceiverProbe" : "jb 12/7/2020 19:06", "testRewritingLeftHandOfAssignmentProbe" : "pre 7/23/2022 15:51", "testRewritingLeftHandOfAssignmentProbeMultipleVariables" : "pre 7/23/2022 15:53", + "testRewritingLeftHandOfDoubleNestedAssignmentProbe" : "joabe 10/6/2023 14:27", + "testRewritingLeftHandOfTripleNestedAssignmentProbe" : "joabe 10/6/2023 14:27", "testRewritingNestedBlockAndMethodSlider" : "pre 7/23/2022 15:52", "testRewritingNestedBlockSlider" : "pre 7/23/2022 15:53", "testRewritingNestedReplacements" : "jb 12/7/2020 19:07", diff --git a/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/instance/testNestedAnnotatedAssignments.st b/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/instance/testNestedAnnotatedAssignments.st new file mode 100644 index 00000000..62adce24 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/instance/testNestedAnnotatedAssignments.st @@ -0,0 +1,17 @@ +tests +testNestedAnnotatedAssignments + + startRule := #Statement. + + self + shouldParse: '""""variable := 2""""'; + shouldParse: 'variable := """"2""""'. + + self + shouldParse: '""""variable := 2""""' + to: #(Statement + (AnnotatedStatement + (expressionAnnotationStart '""') + (Statement + (AnnotatedStatement '""variable := 2""')) + (expressionAnnotationEnd '""'))). \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/methodProperties.json index d9cc360a..656689ff 100644 --- a/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPSmalltalkGrammarTest.class/methodProperties.json @@ -21,6 +21,7 @@ "testGrammarParsesVariableNameCorrectly" : "jb 12/7/2020 19:09", "testMessageSendPartsCanBeAnnotated" : "pre 8/6/2021 18:37", "testMessageSendsCanBeAnnotated" : "jb 12/7/2020 19:09", + "testNestedAnnotatedAssignments" : "joabe 10/6/2023 14:22", "testNormalExpressionsStillWork" : "pre 5/10/2019 11:27", "testOtherCommentsAreStillComments" : "jb 12/7/2020 19:09", "testRegressionAnnotationBlock01" : "pre 9/1/2022 20:39", diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo..st b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo..st new file mode 100644 index 00000000..2ac6c3f4 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo..st @@ -0,0 +1,3 @@ +accessing +foo: anObject + foo := anObject \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo.st b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo.st new file mode 100644 index 00000000..116f7e5b --- /dev/null +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo.st @@ -0,0 +1,3 @@ +accessing +foo + ^ foo \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2..st b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2..st new file mode 100644 index 00000000..fdd7f57b --- /dev/null +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2..st @@ -0,0 +1,3 @@ +accessing +foo2: anObject + foo2 := anObject \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2.st b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2.st new file mode 100644 index 00000000..a69690b1 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/foo2.st @@ -0,0 +1,3 @@ +accessing +foo2 + ^ foo2 \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/methodSettingInstanceVars.st b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/methodSettingInstanceVars.st new file mode 100644 index 00000000..791ffb97 --- /dev/null +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/instance/methodSettingInstanceVars.st @@ -0,0 +1,17 @@ +example methods +methodSettingInstanceVars + + 'hello world'. + self foo; + foo2. + foo2 := 1. + foo := 2. + self foo2: 3. + self foo: 4. + [ |var| + var := 5. + foo := 6. + [ |foo foo2| + foo := 7. + foo2 := 8.]] + \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/methodProperties.json b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/methodProperties.json index eaac63da..89364519 100644 --- a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/methodProperties.json @@ -10,7 +10,12 @@ "+" : "pre 7/1/2019 14:23", "addAndLog:" : "pre 5/3/2021 10:36", "binarySearchIn:theElement:" : "pre 8/21/2023 11:38", + "foo" : "joabe 10/7/2023 18:19", + "foo2" : "joabe 10/7/2023 18:19", + "foo2:" : "joabe 10/7/2023 18:19", + "foo:" : "joabe 10/7/2023 18:19", "methodOnlyWithExample" : "pre 11/18/2019 12:07", + "methodSettingInstanceVars" : "joabe 10/7/2023 18:21", "methodWithExampleCallingOnlyProbedMethod" : "jb 7/2/2021 00:56", "methodWithLiveSpecimen:" : "pre 9/30/2020 09:41", "methodWithMultipleAssertions" : "pre 7/15/2022 11:11", diff --git a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/properties.json b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/properties.json index a659c8c5..dbdb1e6f 100644 --- a/packages/Babylonian-Tests.package/BPTestExamplesClass.class/properties.json +++ b/packages/Babylonian-Tests.package/BPTestExamplesClass.class/properties.json @@ -6,7 +6,8 @@ ], "commentStamp" : "", "instvars" : [ - ], + "foo2", + "foo" ], "name" : "BPTestExamplesClass", "pools" : [ ], diff --git a/packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceVariableIn.for..st b/packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceProbeIn.for..st similarity index 68% rename from packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceVariableIn.for..st rename to packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceProbeIn.for..st index 28d09f99..798a844a 100644 --- a/packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceVariableIn.for..st +++ b/packages/Babylonian-UI.package/BPStyler.class/instance/applyInstanceProbeIn.for..st @@ -1,11 +1,11 @@ private -applyInstanceVariableIn: aPreformmattedText for: anInstanceProbe +applyInstanceProbeIn: aPreformattedText for: anInstanceProbe | interval | - interval := (aPreformmattedText string + interval := (aPreformattedText string allRangesOfRegexMatches: '(''| )', anInstanceProbe variableName, '(''| )') first. - aPreformmattedText + aPreformattedText addAttribute: (BPTextDecoration new anchoredMorph: (self annotationMorphFor: anInstanceProbe); yourself) diff --git a/packages/Babylonian-UI.package/BPStyler.class/instance/formatNonMethod..st b/packages/Babylonian-UI.package/BPStyler.class/instance/formatNonMethod..st index 9dbbc255..5872cb36 100644 --- a/packages/Babylonian-UI.package/BPStyler.class/instance/formatNonMethod..st +++ b/packages/Babylonian-UI.package/BPStyler.class/instance/formatNonMethod..st @@ -12,6 +12,6 @@ formatNonMethod: aText BPClassNameToInstanceProbes value nameToProbesDict at: className ifPresent: [:probesSet | probesSet do: [:anInstanceProbe | self - applyInstanceVariableIn: formattedText + applyInstanceProbeIn: formattedText for: anInstanceProbe]]. ^ formattedText \ No newline at end of file diff --git a/packages/Babylonian-UI.package/BPStyler.class/methodProperties.json b/packages/Babylonian-UI.package/BPStyler.class/methodProperties.json index adc2318a..c682ebec 100644 --- a/packages/Babylonian-UI.package/BPStyler.class/methodProperties.json +++ b/packages/Babylonian-UI.package/BPStyler.class/methodProperties.json @@ -10,10 +10,10 @@ "annotationCanBePutInSidebar:" : "pre 12/16/2020 19:02", "annotationMorphFor:" : "pre 1/6/2021 17:40", "applyAnnotationsFrom:to:" : "pre 7/20/2022 16:03", - "applyInstanceVariableIn:for:" : "joabe 9/28/2023 15:19", + "applyInstanceProbeIn:for:" : "joabe 10/7/2023 19:09", "expressionSourceFor:from:at:" : "pre 7/20/2022 16:58", "extractIntervals" : "jb 12/3/2020 22:57", - "formatNonMethod:" : "joabe 9/28/2023 15:39", + "formatNonMethod:" : "joabe 10/7/2023 19:09", "hasExamplesMorph:" : "pre 7/20/2022 09:31", "ifNoSelectedMethod:" : "pre 3/19/2020 11:07", "insertExamplesMorphInto:" : "pre 7/20/2022 10:45", diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st index 9cdd27bc..46f64855 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st +++ b/packages/Babylonian-UI.package/CodeHolder.extension/instance/determineIntervalOfVariableNameIn.having..st @@ -10,9 +10,6 @@ determineIntervalOfVariableNameIn: anInterval having: aTopologicalCollectionOfAn ((self contents atAll: lowestKeywordMessageSegment children first interval) ~= 'instanceVariableNames:') ifTrue: [^ nil]. selectedText := (self contents atAll: anInterval) withBlanksTrimmed. - self flag: #todo. "wenn es sowas wie aha und aha2 gibt, dann wird das falsch sein, wenn ich aha markiere - und aha2 als erstes kommt" - "restliches todo: test schreiben" ^ self selectedClassOrMetaClass instVarNames detect: [:aVariable | aVariable = selectedText] diff --git a/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json b/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json index f8fc798a..9304aa05 100644 --- a/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json +++ b/packages/Babylonian-UI.package/CodeHolder.extension/methodProperties.json @@ -20,7 +20,7 @@ "codePaneMenuBPTracingItems:" : "pre 9/2/2022 15:06", "compiledMethod" : "ct 3/30/2022 16:48", "determineIntervalOfReceiver:" : "pre 9/2/2022 14:29", - "determineIntervalOfVariableNameIn:having:" : "joabe 10/2/2023 13:21", + "determineIntervalOfVariableNameIn:having:" : "joabe 10/7/2023 19:17", "determineIntervalToAnnotateFor:in:" : "joabe 9/26/2023 13:52", "determineMessageSendNodeIn:" : "joabe 10/2/2023 13:26", "determineSelectorOfMessageSend:" : "pre 9/2/2022 14:49",