--- a/compiler/PPCNotNode.st Wed Nov 05 21:40:01 2014 +0000
+++ b/compiler/PPCNotNode.st Wed Nov 05 23:05:19 2014 +0000
@@ -15,8 +15,12 @@
!PPCNotNode methodsFor:'analysis'!
+firstCharSet
+ ^ PPCharSetPredicate on: [:e | true ]
+!
+
isFirstSetTerminal
- ^ false
+ ^ true
! !
!PPCNotNode methodsFor:'compiling'!
@@ -27,9 +31,7 @@
compiler addVariable: 'memento'.
compiler add: (compiler smartRemember: child).
- compiler startTokenMode.
compiler call: (child compileWith: compiler).
- compiler stopTokenMode.
compiler add: (compiler smartRestore: child).
compiler add: '^ error ifFalse: [ self error ] ifTrue: [ self clearError. nil ]'.
@@ -68,6 +70,12 @@
name: self name;
predicate: child predicate;
yourself
- ]
+ ].
+
+ "Can do the fast version, because we throw away the result and return nil"
+ (self allNodes anySatisfy: [ :node | node asFast ~= node ]) ifTrue: [
+ changeStatus change.
+ self replace: child with: (child transform: [:node | node asFast]).
+ ]
! !