-
-
Notifications
You must be signed in to change notification settings - Fork 354
/
RBProgramNode.extension.st
84 lines (62 loc) · 1.73 KB
/
RBProgramNode.extension.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
78
79
80
81
82
83
84
Extension { #name : #RBProgramNode }
{ #category : #'*renraku' }
RBProgramNode >> banChecksForValidation [
"returns ban levels that have to be chacked before validation"
self methodNode ifNotNil: [ :mNode |
mNode compiledMethod ifNotNil: [ :method |
^ method banChecksForValidation ] ].
^ #()
]
{ #category : #'*renraku' }
RBProgramNode >> banLevelCandidates [
"returns code entities which can ban a rule for this entity"
self methodNode ifNotNil: [ :mNode |
mNode compiledMethod ifNotNil: [ :method |
^ method banLevelCandidates ] ].
^ #()
]
{ #category : #'*renraku' }
RBProgramNode >> critiques [
<eProperty>
^ ReCriticEngine critiquesOf: self
]
{ #category : #'*renraku' }
RBProgramNode >> glmCritiqueSourceIn: aGLMCompositePresentation [
^ self gtInspectorSourceCodeIn: aGLMCompositePresentation
]
{ #category : #'*renraku' }
RBProgramNode >> match: aNode onSuccess: aBlock onFailure: anAlternativeBlock [
| context |
context := SmallDictionary new.
(self match: aNode inContext: context)
ifTrue: [ aBlock cull: context ]
ifFalse: anAlternativeBlock
]
{ #category : #'*renraku' }
RBProgramNode >> nodeAtTraversalIndex: anIndex [
| index |
index := 0.
self nodesDo: [ :n |
index := index + 1.
index = anIndex ifTrue: [ ^ n ] ].
NotFound signal.
]
{ #category : #'*renraku' }
RBProgramNode >> package [
"a hack to make the critique check working"
"the package information is used to determin bans"
^ nil
]
{ #category : #'*renraku' }
RBProgramNode >> suitableRulesFrom: aReRuleManager [
^ aReRuleManager nodeRules
]
{ #category : #'*renraku' }
RBProgramNode >> traversalIndexOf: aNode [
| index |
index := 0.
self nodesDo: [ :n |
index := index + 1.
n == aNode ifTrue: [ ^ index ] ].
^ -1.
]