compiler/tests/PPCNodeFirstFollowNextTests.st
changeset 464 f6d77fee9811
parent 452 9f4558b3be66
child 523 09afcf28ed60
--- a/compiler/tests/PPCNodeFirstFollowNextTests.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/PPCNodeFirstFollowNextTests.st	Thu May 21 14:12:22 2015 +0100
@@ -9,13 +9,22 @@
 	category:'PetitCompiler-Tests-Nodes'
 !
 
+PPCNodeFirstFollowNextTests class instanceVariableNames:'first'
+
+"
+ The following class instance variables are inherited by this class:
+
+	TestCase - lastOutcomes
+	TestAsserter - 
+	Object - 
+"
+!
+
 !PPCNodeFirstFollowNextTests methodsFor:'setup'!
 
 setUp
     configuration := PPCConfiguration default.
     configuration arguments generate: false.
-    "The First/Follow is not allowed after this phase:"
-    configuration arguments specialize: false.
 ! !
 
 !PPCNodeFirstFollowNextTests methodsFor:'support'!
@@ -336,7 +345,7 @@
     first := self first: tree.
     
     self assert: first size: 2.
-    self assert: first anyMatchesType: PPCPredicateNode.
+    self assert: first anyMatchesType: PPCMessagePredicateNode.
     self assert: first anyMatchesType: PPCSentinelNode.
 !
 
@@ -344,7 +353,11 @@
     configuration arguments specialize: true.
     tree := self treeFrom: #space asParser star.
     
-    self should: [ self first: tree ] raise: Exception.
+    first := self first: tree.
+    
+    self assert: first size: 2.
+    self assert: first anyMatchesType: PPCMessagePredicateNode.
+    self assert: first anyMatchesType: PPCSentinelNode.
     
     
 !
@@ -419,6 +432,20 @@
     self assert: first anyOne name = 'foo'.
 ! !
 
+!PPCNodeFirstFollowNextTests methodsFor:'testing - first tokens'!
+
+testFirstTokenStar
+    | token  |
+    token := '.' asParser token.
+    
+    tree := self treeFrom: token star.
+    
+    first := tree firstSetWithTokens.
+    self assert: first size = 2.
+    self assert: first anySatisfy: [ :e | e isTokenNode ].
+    self assert: first anySatisfy: [ :e | e = PPCSentinelNode instance ].
+! !
+
 !PPCNodeFirstFollowNextTests methodsFor:'testing - follow'!
 
 testFollowSet1