From d0a3da2d2d56819820dc630891c95aca0473bd51 Mon Sep 17 00:00:00 2001 From: Steven Costiou <26929529+StevenCostiou@users.noreply.github.com> Date: Thu, 3 Apr 2025 09:16:26 +0200 Subject: [PATCH 1/3] Replacing misnamed API "bestNodeFor" by "targetNodeFor" in Sindarin debugger API --- src/Sindarin/SindarinDebugger.class.st | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Sindarin/SindarinDebugger.class.st b/src/Sindarin/SindarinDebugger.class.st index a3a5733..ef90d1a 100644 --- a/src/Sindarin/SindarinDebugger.class.st +++ b/src/Sindarin/SindarinDebugger.class.st @@ -42,12 +42,6 @@ SindarinDebugger >> assignmentVariableName [ ^ self node variable name ] -{ #category : 'astAndAstMapping' } -SindarinDebugger >> bestNodeFor: anInterval [ - - ^ self node methodNode bestNodeFor: anInterval -] - { #category : 'ast manipulation' } SindarinDebugger >> canStillExecute: aProgramNode [ "returns true if the last pc mapped to aProgramNode is greater than `self pc` in the right context " @@ -609,6 +603,12 @@ SindarinDebugger >> stepUntil: aBlock [ aBlock whileFalse: [ self step ] ] +{ #category : 'astAndAstMapping' } +SindarinDebugger >> targetNodeFor: anInterval [ + + ^ self node methodNode bestNodeFor: anInterval +] + { #category : 'API - changes' } SindarinDebugger >> tryMoveToNodeInHomeContext: aNode [ "Moves to node aNode if aNode is in the lexical context. Otherwise, the program state goes back to how it was before trying and signals an error as the node is not in AST" From 6e1813d4fa7e1eaa3aa7e2c36680ee56b2e8244f Mon Sep 17 00:00:00 2001 From: Steven Costiou <26929529+StevenCostiou@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:03:36 +0200 Subject: [PATCH 2/3] Reorganizing sindarin tests --- src/Sindarin-Tests/SindarinDebuggerTest.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sindarin-Tests/SindarinDebuggerTest.class.st b/src/Sindarin-Tests/SindarinDebuggerTest.class.st index 6628f7e..0774bd5 100644 --- a/src/Sindarin-Tests/SindarinDebuggerTest.class.st +++ b/src/Sindarin-Tests/SindarinDebuggerTest.class.st @@ -1258,7 +1258,7 @@ SindarinDebuggerTest >> testNode [ self assert: node selector equals: #asInteger ] -{ #category : 'tests' } +{ #category : 'tests - pc' } SindarinDebuggerTest >> testPc [ | dbg | dbg := SindarinDebugger From 120935b325b4e62b6f4dd851e9690b6aece894aa Mon Sep 17 00:00:00 2001 From: Steven Costiou <26929529+StevenCostiou@users.noreply.github.com> Date: Fri, 4 Apr 2025 17:16:43 +0200 Subject: [PATCH 3/3] Using outerContext instead of outerMostContext --- src/Sindarin/SindarinDebugger.class.st | 7 ++++--- src/Sindarin/TSindarin.trait.st | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Sindarin/SindarinDebugger.class.st b/src/Sindarin/SindarinDebugger.class.st index ef90d1a..3e407a2 100644 --- a/src/Sindarin/SindarinDebugger.class.st +++ b/src/Sindarin/SindarinDebugger.class.st @@ -46,12 +46,13 @@ SindarinDebugger >> assignmentVariableName [ SindarinDebugger >> canStillExecute: aProgramNode [ "returns true if the last pc mapped to aProgramNode is greater than `self pc` in the right context " - | lastPcForNode rightContext | + | lastPcForNode rightContext outerContext | rightContext := self context. + outerContext := rightContext outerContext ifNil: [ rightContext ]. [ - rightContext == rightContext outerMostContext or: [ - rightContext method ast allChildren identityIncludes: aProgramNode ] ] + rightContext == outerContext or: [ + rightContext method ast allChildren identityIncludes: aProgramNode ] ] whileFalse: [ rightContext := rightContext sender ]. lastPcForNode := (rightContext method ast lastPcForNode: aProgramNode) diff --git a/src/Sindarin/TSindarin.trait.st b/src/Sindarin/TSindarin.trait.st index 37b3e71..1c2a6db 100644 --- a/src/Sindarin/TSindarin.trait.st +++ b/src/Sindarin/TSindarin.trait.st @@ -195,7 +195,7 @@ TSindarin >> outerMostContextOf: aContext [ oldContext := nil. [currentContext ~= oldContext] whileTrue: [ oldContext := currentContext. - currentContext := currentContext outerMostContext ]. + currentContext := currentContext outerContext ifNil:[currentContext]]. ^ currentContext ]