Skip to content

Commit

Permalink
Add OCAbstractVariable protocol to Slot to replace OCSlotVariable
Browse files Browse the repository at this point in the history
  • Loading branch information
dionisiydk committed Jun 14, 2020
1 parent 1708354 commit 3e5bd28
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions src/Kernel/Slot.class.st
Expand Up @@ -214,11 +214,37 @@ Slot >> isAccessedIn: aCompiledCode [
anySatisfy: [ :node | node binding slot == self ]
]

{ #category : #OCVARIABLE }
Slot >> isArg [
^false
]

{ #category : #OCVARIABLE }
Slot >> isClassVariable [
^ false
]

{ #category : #testing }
Slot >> isGlobal [
^false
]

{ #category : #OCVARIABLE }
Slot >> isGlobalVariable [
^ false
]

{ #category : #OCVARIABLE }
Slot >> isInstance [
^false

]

{ #category : #OCVARIABLE }
Slot >> isLiteralVariable [
^false
]

{ #category : #testing }
Slot >> isLocal [

Expand All @@ -236,11 +262,60 @@ Slot >> isReferenced [
^self usingMethods isNotEmpty
]

{ #category : #OCVARIABLE }
Slot >> isRemote [
^false
]

{ #category : #OCVARIABLE }
Slot >> isSelf [
^false
]

{ #category : #testing }
Slot >> isSelfEvaluating [
^true
]

{ #category : #OCVARIABLE }
Slot >> isSelfOrSuper [

^ false
]

{ #category : #OCVARIABLE }
Slot >> isSpecialVariable [
^false
]

{ #category : #OCVARIABLE }
Slot >> isSuper [
^false
]

{ #category : #OCVARIABLE }
Slot >> isTemp [

^ false
]

{ #category : #OCVARIABLE }
Slot >> isThisContext [
^false
]

{ #category : #OCVARIABLE }
Slot >> isUndeclared [

^ false
]

{ #category : #OCVARIABLE }
Slot >> isUninitialized [

^ false
]

{ #category : #testing }
Slot >> isVirtual [
"virtual slots do not take up space in the object and have size = 0"
Expand All @@ -252,6 +327,11 @@ Slot >> isVisible [
^ true
]

{ #category : #OCVARIABLE }
Slot >> isWritable [
^ true
]

{ #category : #testing }
Slot >> isWrittenIn: aCompiledCode [
^aCompiledCode ast instanceVariableWriteNodes
Expand All @@ -270,6 +350,11 @@ Slot >> needsFullDefinition [
^true
]

{ #category : #OCVARIABLE }
Slot >> originalVar [
^ self
]

{ #category : #accessing }
Slot >> owningClass [
"the class that the slot is installed in"
Expand Down Expand Up @@ -300,6 +385,11 @@ Slot >> scope: aScope [
"ignored, subclasses can override to analyze the scope they are to be installed in"
]

{ #category : #OCVARIABLE }
Slot >> semanticNodeClass [
^RBInstanceVariableNode
]

{ #category : #private }
Slot >> sendsInitializeSlots: aClass [
(aClass isTrait or: [ aClass includesSelector: #initialize ])
Expand Down Expand Up @@ -338,6 +428,12 @@ Slot >> usingMethods [
ifNotNil: [:class | class allMethodsAccessingSlot: self].
]

{ #category : #OCVARIABLE }
Slot >> variable [
"I return the first class variable that I model in the case of globals and ivars"
^self
]

{ #category : #'meta-object-protocol' }
Slot >> wantsInitialization [
"if a slot wants to enable instance initalization, return true here"
Expand Down

0 comments on commit 3e5bd28

Please sign in to comment.