forked from pharo-project/pharo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StInspectorContextNamedTempNode.class.st
77 lines (66 loc) · 1.74 KB
/
StInspectorContextNamedTempNode.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"
I am a variable node for representing a temporary variable stored in a Context object that has a name attached.
This includes local variables and method parameters.
"
Class {
#name : #StInspectorContextNamedTempNode,
#superclass : #StInspectorNode,
#instVars : [
'tempName',
'tempIndex',
'tag'
],
#category : #'NewTools-Inspector-Model'
}
{ #category : #'instance creation' }
StInspectorContextNamedTempNode class >> hostObject: aContext tempName: aString tempIndex: anInteger [
^ (self hostObject: aContext)
tempName: aString;
tempIndex: anInteger;
variableTag: ((aContext method argumentNames includes: aString)
ifTrue: [ 'parameter' ]
ifFalse: [ 'temp' ])
yourself
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> errorMessage [
^ 'error obtaining field value'
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> key [
^ self tempName
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> label [
^ self key
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> rawValue [
^ [ self hostObject tempNamed: tempName ]
on: SubscriptOutOfBounds
do: [ :err | 'cannot read ' , tempName ]
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> tempIndex [
^ tempIndex
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> tempIndex: anObject [
tempIndex := anObject
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> tempName [
^ tempName
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> tempName: aString [
tempName := aString
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> variableTag [
^ tag ifNil: [ 'temp' ]
]
{ #category : #accessing }
StInspectorContextNamedTempNode >> variableTag: aTag [
tag := aTag
]