6 instanceVariableNames:'node result visitor' |
6 instanceVariableNames:'node result visitor' |
7 classVariableNames:'' |
7 classVariableNames:'' |
8 poolDictionaries:'' |
8 poolDictionaries:'' |
9 category:'PetitCompiler-Tests-Visitors' |
9 category:'PetitCompiler-Tests-Visitors' |
10 ! |
10 ! |
|
11 |
11 |
12 |
12 !PPCInliningVisitorTest methodsFor:'as yet unclassified'! |
13 !PPCInliningVisitorTest methodsFor:'as yet unclassified'! |
13 |
14 |
14 assert: object type: class |
15 assert: object type: class |
15 self assert: object class == class |
16 self assert: object class == class |
97 self assert: result child isMarkedForInline. |
98 self assert: result child isMarkedForInline. |
98 self assert: result child literal = 'foo'. |
99 self assert: result child literal = 'foo'. |
99 ! |
100 ! |
100 |
101 |
101 testPluggable |
102 testPluggable |
102 | pluggableNode | |
103 | pluggableNode | |
103 pluggableNode := PPCPluggableNode new |
104 pluggableNode := PPCPluggableNode new |
104 block: [:ctx | nil] asParser. |
105 block: [:ctx | nil] asParser. |
105 node := PPCSequenceNode new |
106 node := PPCSequenceNode new |
106 children: { pluggableNode }; |
107 children: { pluggableNode }; |
107 yourself. |
108 yourself. |
108 |
109 |
109 result := visitor visit: node. |
110 result := visitor visit: node. |
110 |
111 |
111 ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue: |
112 ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue:[ |
112 [ |
113 self skipIf: true description: 'skipped test, inlining of pluggable nodes not supported!!'. |
113 self skip: 'skipped test, inlining of pluggable nodes not supported!!'. |
114 ]. |
114 ]. |
|
115 |
115 |
116 self assert: result children first type: PPCPluggableNode. |
116 self assert: result children first type: PPCPluggableNode. |
117 self assert: result children first isMarkedForInline. |
117 self assert: result children first isMarkedForInline. |
118 |
118 |
119 "Modified: / 23-04-2015 / 12:18:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
119 "Modified: / 01-05-2015 / 14:22:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
120 ! |
120 ! |
121 |
121 |
122 testSequenceInline |
122 testSequenceInline |
123 | charNode1 charNode2 | |
123 | charNode1 charNode2 | |
124 charNode1 := PPCCharacterNode new |
124 charNode1 := PPCCharacterNode new |