Skip to content

Commit

Permalink
renames: readInContext: and write:inContext:
Browse files Browse the repository at this point in the history
  • Loading branch information
dionisiydk committed Jun 20, 2020
1 parent adf8e7c commit e88950d
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions src/Debugging-Core/Context.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Context >> callPrimitive: primNumber [
Context >> lookupSymbol: aSymbol [
| var |
var := self lookupVar: aSymbol.
^ var readFromContext: self
^ var readInContext: self
]

{ #category : #'*Debugging-Core' }
Expand Down Expand Up @@ -366,7 +366,7 @@ Context >> tempNamed: aName [

| var |
var := self lookupTempVar: aName.
^var readFromContext: self
^var readInContext: self
]

{ #category : #'*Debugging-Core' }
Expand All @@ -375,7 +375,7 @@ Context >> tempNamed: aName put: anObject [

| var |
var := self lookupTempVar: aName.
^var write: anObject toContext: self
^var write: anObject inContext: self
]

{ #category : #'*Debugging-Core' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CoVariableValueMessageHeuristic >> valueOfVariable: aName inContext: completionC
If we find in the doItContext has a variable with the given name, use it, otherwise ignore it."
(completionContext doItContext ifNotNil: [ :context |
(context lookupVar: aName)
ifNotNil: [:var | var readFromContext: context ] ])
ifNotNil: [:var | var readInContext: context ] ])
ifNotNil: [ :value | ^ aBlock value: value ].

"In the playground, the binding values comes in the bindings of the requestor.
Expand Down
4 changes: 2 additions & 2 deletions src/Kernel/LiteralVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ LiteralVariable >> read [
]

{ #category : #debugging }
LiteralVariable >> readFromContext: aContext [
LiteralVariable >> readInContext: aContext [
^self value
]

Expand Down Expand Up @@ -263,7 +263,7 @@ LiteralVariable >> write: anObject [
]

{ #category : #debugging }
LiteralVariable >> write: aValue toContext: aContext [
LiteralVariable >> write: aValue inContext: aContext [
self isWritable ifFalse: [
^self error: 'Variable ' , name, ' is read only'].

Expand Down
12 changes: 6 additions & 6 deletions src/Kernel/Slot.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Slot >> read: anObject [
]

{ #category : #debugging }
Slot >> readFromContext: aContext [
Slot >> readInContext: aContext [
^self read: aContext receiver
]

Expand Down Expand Up @@ -346,12 +346,12 @@ Slot >> wantsInitialization [
^false
]

{ #category : #debugging }
Slot >> write: aValue inContext: aContext [
self write: aValue to: aContext receiver
]

{ #category : #'meta-object-protocol' }
Slot >> write: aValue to: anObject [
^self subclassResponsibility
]

{ #category : #debugging }
Slot >> write: aValue toContext: aContext [
self write: aValue to: aContext receiver
]
4 changes: 2 additions & 2 deletions src/Kernel/Variable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Variable >> propertyAt: propName put: propValue [
]

{ #category : #debugging }
Variable >> readFromContext: aContext [
Variable >> readInContext: aContext [
self subclassResponsibility
]

Expand Down Expand Up @@ -276,6 +276,6 @@ Variable >> variable [
]

{ #category : #debugging }
Variable >> write: aValue toContext: aContext [
Variable >> write: aValue inContext: aContext [
self subclassResponsibility
]
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/OCSelfVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ OCSelfVariable >> isSelfOrSuper [
]

{ #category : #debugging }
OCSelfVariable >> readFromContext: aContext [
OCSelfVariable >> readInContext: aContext [
^aContext receiver
]
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/OCSpecialVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OCSpecialVariable >> isWritable [
]

{ #category : #debugging }
OCSpecialVariable >> write: aValue toContext: aContext [
OCSpecialVariable >> write: aValue inContext: aContext [

self error: name, ' is reserved word and cant be modified'
]
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/OCSuperVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ OCSuperVariable >> isSuper [
]

{ #category : #debugging }
OCSuperVariable >> readFromContext: aContext [
OCSuperVariable >> readInContext: aContext [
^aContext receiver
]
18 changes: 9 additions & 9 deletions src/OpalCompiler-Core/OCTempVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@ OCTempVariable >> markWrite [
super markWrite.
]

{ #category : #debugging }
OCTempVariable >> readFromContext: aContext [

| contextScope |
contextScope := aContext astScope.
^self readFromContext: aContext scope: contextScope
]

{ #category : #debugging }
OCTempVariable >> readFromContext: aContext scope: contextScope [
| definitionContext |
Expand All @@ -164,7 +156,15 @@ OCTempVariable >> readFromLocalContext: aContext [
]

{ #category : #debugging }
OCTempVariable >> write: aValue toContext: aContext [
OCTempVariable >> readInContext: aContext [

| contextScope |
contextScope := aContext astScope.
^self readFromContext: aContext scope: contextScope
]

{ #category : #debugging }
OCTempVariable >> write: aValue inContext: aContext [

| contextScope |
contextScope := aContext astScope.
Expand Down
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/OCThisContextVariable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ OCThisContextVariable >> isThisContext [
]

{ #category : #debugging }
OCThisContextVariable >> readFromContext: aContext [
OCThisContextVariable >> readInContext: aContext [
^aContext
]
4 changes: 2 additions & 2 deletions src/Slot-Tests/ClassVariableTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ClassVariableTest >> testReadingFromContext [
classVariable := self class classVariableNamed: #TestVariable.

self
assert: (classVariable readFromContext: thisContext)
assert: (classVariable readInContext: thisContext)
equals: #testValue
]

Expand All @@ -93,7 +93,7 @@ ClassVariableTest >> testWritingToContext [

| classVariable |
classVariable := self class classVariableNamed: #TestVariable.
classVariable write: #testValue toContext: thisContext.
classVariable write: #testValue inContext: thisContext.

self assert: TestVariable equals: #testValue
]
4 changes: 2 additions & 2 deletions src/Slot-Tests/SlotTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SlotTest >> testReadFromContext [
ivarForTesting := #testValue.
slot := self class slotNamed: #ivarForTesting.

self assert: (slot readFromContext: thisContext) equals: #testValue
self assert: (slot readInContext: thisContext) equals: #testValue
]

{ #category : #'tests - properties' }
Expand Down Expand Up @@ -116,7 +116,7 @@ SlotTest >> testWriteToContext [

| slot |
slot := self class slotNamed: #ivarForTesting.
slot write: #testValue toContext: thisContext.
slot write: #testValue inContext: thisContext.

self assert: ivarForTesting equals: #testValue
]
Expand Down

0 comments on commit e88950d

Please sign in to comment.