Skip to content

Commit 18b9e5b

Browse files
committed
Cleanup: do not use #notNil, use #isNotNil instead
Fix pharo-spec#95
1 parent d0304a2 commit 18b9e5b

26 files changed

+210
-189
lines changed

src/Sindarin-Tests/SindarinDebugSessionTest.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SindarinDebugSessionTest >> testSindarinSessionInstantiation [
4242
sindarinSession := SindarinDebugSession
4343
newWithName: sessionName
4444
forProcess: process.
45-
self assert: sindarinSession debugSession notNil.
45+
self assert: sindarinSession debugSession isNotNil.
4646
self assert: sindarinSession debugSession name equals: sessionName.
4747
self
4848
assert: sindarinSession debugSession process

src/Sindarin-Tests/SindarinDebuggerTest.class.st

+3-4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ SindarinDebuggerTest >> methodWithNotEvaluatedBlockWhoseCreationIsFirstBytecodeI
136136
^ a * 42
137137
]
138138

139-
140139
{ #category : 'helpers' }
141140
SindarinDebuggerTest >> methodWithOneAssignment [
142141

@@ -1399,7 +1398,7 @@ SindarinDebuggerTest >> testSkipCanSkipReturnIfItIsNotTheLastReturn [
13991398
self assert: scdbg node value value equals: 2
14001399
]
14011400

1402-
{ #category : #tests }
1401+
{ #category : 'tests' }
14031402
SindarinDebuggerTest >> testSkipCannotSkipReturnIfItIsTheLastReturn [
14041403

14051404
| scdbg nodeWithImplicitReturn |
@@ -2041,8 +2040,8 @@ SindarinDebuggerTest >> testTemporaryNamed [
20412040
SindarinDebuggerTest >> testTerminate [
20422041
| dbg |
20432042
dbg := SindarinDebugger debug: [ self helperMethod13 ].
2044-
self assert: dbg debugSession interruptedContext notNil.
2045-
self assert: dbg debugSession interruptedProcess notNil.
2043+
self assert: dbg debugSession interruptedContext isNotNil.
2044+
self assert: dbg debugSession interruptedProcess isNotNil.
20462045
dbg terminate.
20472046
self assert: dbg debugSession interruptedContext isNil.
20482047
self assert: dbg debugSession interruptedProcess isNil.

src/Sindarin/Context.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #Context }
1+
Extension { #name : 'Context' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
Context >> stepToSendOrReturnOrJump [
55

66
"Simulate the execution of bytecodes until either sending a message or

src/Sindarin/DebugSession.extension.st

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Extension { #name : #DebugSession }
1+
Extension { #name : 'DebugSession' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
DebugSession >> asSindarinDebugSession [
55
^ SindarinDebugSession new debugSession: self
66
]
77

8-
{ #category : #'*Sindarin' }
8+
{ #category : '*Sindarin' }
99
DebugSession >> stepToFirstInterestingBytecodeWithJumpIn: aProcess [
1010
"After a restart of a method activation step to the first
1111
bytecode instruction that is of interest for the debugger.
@@ -24,7 +24,7 @@ DebugSession >> stepToFirstInterestingBytecodeWithJumpIn: aProcess [
2424
^ aProcess stepToSendOrReturnOrJump
2525
]
2626

27-
{ #category : #'*Sindarin' }
27+
{ #category : '*Sindarin' }
2828
DebugSession >> suspendedContext: aContext [
2929

3030
interruptedContext := aContext
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Class {
2-
#name : #DebuggedExecutionException,
3-
#superclass : #Error,
4-
#category : #'Sindarin-Exceptions'
2+
#name : 'DebuggedExecutionException',
3+
#superclass : 'Error',
4+
#category : 'Sindarin-Exceptions',
5+
#package : 'Sindarin',
6+
#tag : 'Exceptions'
57
}
68

7-
{ #category : #testing }
9+
{ #category : 'testing' }
810
DebuggedExecutionException >> isExceptionSignalledForDebuggedExecution [
911
^ true
1012
]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Class {
2-
#name : #DebuggedExecutionIsFinished,
3-
#superclass : #DebuggedExecutionException,
4-
#category : #'Sindarin-Exceptions'
2+
#name : 'DebuggedExecutionIsFinished',
3+
#superclass : 'DebuggedExecutionException',
4+
#category : 'Sindarin-Exceptions',
5+
#package : 'Sindarin',
6+
#tag : 'Exceptions'
57
}

src/Sindarin/InstructionStream.extension.st

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
Extension { #name : #InstructionStream }
1+
Extension { #name : 'InstructionStream' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
InstructionStream >> willJump [
55
"Answer whether the next bytecode will jump."
66

77
^ self willJumpIfFalse or:[ self willJumpIfTrue or: [ self willJumpTo ] ]
88
]
99

10-
{ #category : #'*Sindarin' }
10+
{ #category : '*Sindarin' }
1111
InstructionStream >> willJumpIfTrue [
1212
"Answer whether the next bytecode is a jump-if-false."
1313

1414
^ self method encoderClass isBranchIfTrueAt: pc in: self method
1515
]
1616

17-
{ #category : #'*Sindarin' }
17+
{ #category : '*Sindarin' }
1818
InstructionStream >> willJumpTo [
1919
"Answer whether the next bytecode is a jump-if-false."
2020

2121
^ self method encoderClass isJumpAt: pc in: self method
2222
]
2323

24-
{ #category : #'*Sindarin' }
24+
{ #category : '*Sindarin' }
2525
InstructionStream >> willSendOrReturnOrStoreOrCreateBlock [
2626

2727
"Answer whether the next bytecode will be interesting for the debugger to stop."
@@ -30,7 +30,7 @@ InstructionStream >> willSendOrReturnOrStoreOrCreateBlock [
3030
self willReturn or: [ self willStore or: [ self willCreateBlock ] ] ]
3131
]
3232

33-
{ #category : #'*Sindarin' }
33+
{ #category : '*Sindarin' }
3434
InstructionStream >> willStoreButNotPop [
3535
"Answer whether the next bytecode is a store that are not store-pop"
3636

src/Sindarin/NodeNotInASTError.class.st

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
I am signaled when we try to move the execution to a node that is not in the home context's method ast.
33
"
44
Class {
5-
#name : #NodeNotInASTError,
6-
#superclass : #Error,
7-
#category : #'Sindarin-Exceptions'
5+
#name : 'NodeNotInASTError',
6+
#superclass : 'Error',
7+
#category : 'Sindarin-Exceptions',
8+
#package : 'Sindarin',
9+
#tag : 'Exceptions'
810
}

src/Sindarin/NotValidPcError.class.st

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
I am signaled when I try to modify the execution of a context to get to an invalid PC (lower than the method initalPC or greater than the method endPC)
33
"
44
Class {
5-
#name : #NotValidPcError,
6-
#superclass : #Error,
7-
#category : #'Sindarin-Exceptions'
5+
#name : 'NotValidPcError',
6+
#superclass : 'Error',
7+
#category : 'Sindarin-Exceptions',
8+
#package : 'Sindarin',
9+
#tag : 'Exceptions'
810
}

src/Sindarin/OCBytecodeToASTCache.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #OCBytecodeToASTCache }
1+
Extension { #name : 'OCBytecodeToASTCache' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
OCBytecodeToASTCache >> firstRecursiveBcOffsetForStatementNode: aStatementNode [
55

66
^ self methodOrBlockNode bcToASTCache bcToASTMap keys sorted detect: [

src/Sindarin/Object.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #Object }
1+
Extension { #name : 'Object' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
Object >> isExceptionSignalledForDebuggedExecution [
55
^ false
66
]

src/Sindarin/Process.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #Process }
1+
Extension { #name : 'Process' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
Process >> stepToSendOrReturnOrJump [
55

66
^Processor activeProcess

src/Sindarin/RBAssignmentNode.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBAssignmentNode }
1+
Extension { #name : 'RBAssignmentNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBAssignmentNode >> skipWithDebugger: aSindarinDebugger [
55

66
aSindarinDebugger skipAssignmentNodeCompletely

src/Sindarin/RBBlockDefinitionSearchingVisitor.class.st

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
11
Class {
2-
#name : #RBBlockDefinitionSearchingVisitor,
3-
#superclass : #RBProgramNodeVisitor,
2+
#name : 'RBBlockDefinitionSearchingVisitor',
3+
#superclass : 'RBProgramNodeVisitor',
44
#instVars : [
55
'blockToSearch',
66
'isBlockFound'
77
],
8-
#category : #'Sindarin-Base'
8+
#category : 'Sindarin-Base',
9+
#package : 'Sindarin',
10+
#tag : 'Base'
911
}
1012

11-
{ #category : #'instance creation' }
13+
{ #category : 'instance creation' }
1214
RBBlockDefinitionSearchingVisitor class >> newToSearch: aBlockNode [
1315

1416
^ self new
1517
blockToSearch: aBlockNode;
1618
yourself
1719
]
1820

19-
{ #category : #accessing }
21+
{ #category : 'accessing' }
2022
RBBlockDefinitionSearchingVisitor >> blockToSearch: aBlockNode [
2123

2224
blockToSearch := aBlockNode.
2325
isBlockFound := false
2426
]
2527

26-
{ #category : #initialization }
28+
{ #category : 'initialization' }
2729
RBBlockDefinitionSearchingVisitor >> initialize [
2830

2931
isBlockFound := false
3032
]
3133

32-
{ #category : #accessing }
34+
{ #category : 'accessing' }
3335
RBBlockDefinitionSearchingVisitor >> isBlockFound [
3436

3537
^ isBlockFound
3638
]
3739

38-
{ #category : #visiting }
40+
{ #category : 'visiting' }
3941
RBBlockDefinitionSearchingVisitor >> visitNode: aNode [
4042

4143
super visitNode: aNode.

src/Sindarin/RBBlockNode.extension.st

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBBlockNode }
1+
Extension { #name : 'RBBlockNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBBlockNode >> executedNodesAfter: aNode [
55

66
"Gives all nodes that are executed after aNode. Assuming that aNode is a recursive child, then all nodes executed after it are all nodes after it in allChildrenPostOrder"
@@ -13,13 +13,13 @@ RBBlockNode >> executedNodesAfter: aNode [
1313
^ nodesAfter
1414
]
1515

16-
{ #category : #'*Sindarin' }
16+
{ #category : '*Sindarin' }
1717
RBBlockNode >> firstPCOfStatement: aStatementNode [
1818

1919
^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
2020
]
2121

22-
{ #category : #'*Sindarin' }
22+
{ #category : '*Sindarin' }
2323
RBBlockNode >> nextExecutedNodeAfter: aNode [
2424

2525
"Find first node that is after aNode that has an associated pc in method node all children (post-order)"
@@ -31,7 +31,7 @@ RBBlockNode >> nextExecutedNodeAfter: aNode [
3131
^ nodesAfter at: indexOfNextNode
3232
]
3333

34-
{ #category : #'*Sindarin' }
34+
{ #category : '*Sindarin' }
3535
RBBlockNode >> parentOfIdenticalSubtree: subtree [
3636

3737
^ self allChildren reversed
@@ -40,7 +40,7 @@ RBBlockNode >> parentOfIdenticalSubtree: subtree [
4040
ifNone: [ nil ]
4141
]
4242

43-
{ #category : #'*Sindarin' }
43+
{ #category : '*Sindarin' }
4444
RBBlockNode >> skipWithDebugger: aSindarinDebugger [
4545

4646
aSindarinDebugger skipBlockNode

src/Sindarin/RBMessageNode.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBMessageNode }
1+
Extension { #name : 'RBMessageNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBMessageNode >> skipWithDebugger: aSindarinDebugger [
55

66
aSindarinDebugger skipMessageNode

src/Sindarin/RBMethodNode.extension.st

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBMethodNode }
1+
Extension { #name : 'RBMethodNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBMethodNode >> executedNodesAfter: aNode [
55

66
"Gives all nodes that are executed after aNode. Assuming that aNode is a recursive child, then all nodes executed after it are all nodes after it in allChildrenPostOrder"
@@ -13,13 +13,13 @@ RBMethodNode >> executedNodesAfter: aNode [
1313
^ nodesAfter
1414
]
1515

16-
{ #category : #'*Sindarin' }
16+
{ #category : '*Sindarin' }
1717
RBMethodNode >> firstPCOfStatement: aStatementNode [
1818

1919
^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
2020
]
2121

22-
{ #category : #'*Sindarin' }
22+
{ #category : '*Sindarin' }
2323
RBMethodNode >> nextExecutedNodeAfter: aNode [
2424

2525
"Find first node that is after aNode that has an associated pc in method node all children (post-order)"
@@ -31,7 +31,7 @@ RBMethodNode >> nextExecutedNodeAfter: aNode [
3131
^ nodesAfter at: indexOfNextNode
3232
]
3333

34-
{ #category : #'*Sindarin' }
34+
{ #category : '*Sindarin' }
3535
RBMethodNode >> parentOfIdenticalSubtree: subtree [
3636

3737
^ self allChildren reversed
@@ -40,7 +40,7 @@ RBMethodNode >> parentOfIdenticalSubtree: subtree [
4040
ifNone: [ nil ]
4141
]
4242

43-
{ #category : #'*Sindarin' }
43+
{ #category : '*Sindarin' }
4444
RBMethodNode >> statementNodeContaining: aNode [
4545

4646
| statementNode parentOfStatementNode |

src/Sindarin/RBProgramNode.extension.st

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBProgramNode }
1+
Extension { #name : 'RBProgramNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBProgramNode >> allChildrenPostOrder [
55

66
| children |
@@ -11,7 +11,7 @@ RBProgramNode >> allChildrenPostOrder [
1111
^ children
1212
]
1313

14-
{ #category : #'*Sindarin' }
14+
{ #category : '*Sindarin' }
1515
RBProgramNode >> skipWithDebugger: aSindarinDebugger [
1616

1717
aSindarinDebugger step

src/Sindarin/RBReturnNode.extension.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #RBReturnNode }
1+
Extension { #name : 'RBReturnNode' }
22

3-
{ #category : #'*Sindarin' }
3+
{ #category : '*Sindarin' }
44
RBReturnNode >> skipWithDebugger: aSindarinDebugger [
55

66
aSindarinDebugger skipReturnNode

0 commit comments

Comments
 (0)