Skip to content

Commit e5e68c9

Browse files
authored
Merge pull request #104 from StevenCostiou/Pharo13
Small improvements and fixes
2 parents 41a8307 + 120935b commit e5e68c9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/Sindarin-Tests/SindarinDebuggerTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ SindarinDebuggerTest >> testNode [
12581258
self assert: node selector equals: #asInteger
12591259
]
12601260

1261-
{ #category : 'tests' }
1261+
{ #category : 'tests - pc' }
12621262
SindarinDebuggerTest >> testPc [
12631263
| dbg |
12641264
dbg := SindarinDebugger

src/Sindarin/SindarinDebugger.class.st

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,17 @@ SindarinDebugger >> assignmentVariableName [
4242
^ self node variable name
4343
]
4444

45-
{ #category : 'astAndAstMapping' }
46-
SindarinDebugger >> bestNodeFor: anInterval [
47-
48-
^ self node methodNode bestNodeFor: anInterval
49-
]
50-
5145
{ #category : 'ast manipulation' }
5246
SindarinDebugger >> canStillExecute: aProgramNode [
5347
"returns true if the last pc mapped to aProgramNode is greater than `self pc` in the right context "
5448

55-
| lastPcForNode rightContext |
49+
| lastPcForNode rightContext outerContext |
5650
rightContext := self context.
51+
outerContext := rightContext outerContext ifNil: [ rightContext ].
5752

5853
[
59-
rightContext == rightContext outerMostContext or: [
60-
rightContext method ast allChildren identityIncludes: aProgramNode ] ]
54+
rightContext == outerContext or: [
55+
rightContext method ast allChildren identityIncludes: aProgramNode ] ]
6156
whileFalse: [ rightContext := rightContext sender ].
6257

6358
lastPcForNode := (rightContext method ast lastPcForNode: aProgramNode)
@@ -609,6 +604,12 @@ SindarinDebugger >> stepUntil: aBlock [
609604
aBlock whileFalse: [ self step ]
610605
]
611606

607+
{ #category : 'astAndAstMapping' }
608+
SindarinDebugger >> targetNodeFor: anInterval [
609+
610+
^ self node methodNode bestNodeFor: anInterval
611+
]
612+
612613
{ #category : 'API - changes' }
613614
SindarinDebugger >> tryMoveToNodeInHomeContext: aNode [
614615
"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"

src/Sindarin/TSindarin.trait.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ TSindarin >> outerMostContextOf: aContext [
195195
oldContext := nil.
196196
[currentContext ~= oldContext] whileTrue: [
197197
oldContext := currentContext.
198-
currentContext := currentContext outerMostContext ].
198+
currentContext := currentContext outerContext ifNil:[currentContext]].
199199
^ currentContext
200200
]
201201

0 commit comments

Comments
 (0)