363 self assert: parser fail: ''. |
363 self assert: parser fail: ''. |
364 ! |
364 ! |
365 |
365 |
366 testInlinePluggableNode |
366 testInlinePluggableNode |
367 "Sadly, on Smalltalk/X blocks cannot be inlined because |
367 "Sadly, on Smalltalk/X blocks cannot be inlined because |
368 the VM does not provide enough information to map |
368 the VM does not provide enough information to map |
369 it back to source code. Very bad indeed!!" |
369 it back to source code. Very bad indeed!!" |
370 ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue:[ |
370 ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue:[ |
371 self skipIf: true description: 'Blocks cannot be inlined due to a lack of proper VM support'. |
371 self skipIf: true description: 'Blocks cannot be inlined due to a lack of proper VM support'. |
372 ]. |
372 ]. |
373 |
373 |
374 node := PPCSequenceNode new |
374 node := PPCSequenceNode new |
375 children: { |
375 children: { |
376 PPCPluggableNode new block: [ :ctx | ctx next ]; markForInline; yourself. |
376 PPCPluggableNode new block: [ :ctx | ctx next ]; markForInline; yourself. |
377 $a asParser asCompilerNode }. |
377 $a asParser asCompilerNode }. |
378 |
378 |
379 self compileTree: node. |
379 self compileTree: node. |
380 |
380 |
381 self assert: parser class methodDictionary size = 2. |
381 self assert: parser class methodDictionary size = 2. |
382 self assert: parser parse: 'ba' to: #($b $a). |
382 self assert: parser parse: 'ba' to: #($b $a). |
383 ! |
383 ! |
384 |
384 |
385 testLiteralNode |
385 testLiteralNode |
386 node := PPCLiteralNode new |
386 node := PPCLiteralNode new |
387 literal: 'foo'; |
387 literal: 'foo'; |