compiler/PPCMessagePredicateNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 06 Nov 2014 02:22:56 +0000
changeset 416 b0fd54ee0412
parent 392 9b297f0d949c
child 421 7e08b31e0dae
permissions -rw-r--r--
Do not try to inline PPCPluggableNode on Smalltalk/X Sadly, on Smalltalk/X blocks cannot be inlined because the VM does not provide enough information to map it back to the source code. Very bad indeed!

"{ Package: 'stx:goodies/petitparser/compiler' }"

PPCAbstractPredicateNode subclass:#PPCMessagePredicateNode
	instanceVariableNames:'message'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Nodes'
!

!PPCMessagePredicateNode methodsFor:'accessing'!

asInlined
	^ PPCInlineMessagePredicateNode new
		message: message;
		predicate: predicate;
		name: name;
		yourself
!

message
	
	^ message
!

message: anObject
	
	message := anObject
! !

!PPCMessagePredicateNode methodsFor:'as yet unclassified'!

bodyOfPredicate: compiler
	compiler addOnLine: '(context peek ', self message, ')'.
	compiler indent.
	compiler add: 'ifFalse: [ self error: ''predicate not found'' ]'.
	compiler add: 'ifTrue: [ context next ].'.
	compiler dedent.
! !