diff -r 19a9c25960ef -r 0ca7a70db0f5 compiler/tests/PPCCodeGeneratorTest.st --- a/compiler/tests/PPCCodeGeneratorTest.st Mon Jun 15 19:13:49 2015 +0100 +++ b/compiler/tests/PPCCodeGeneratorTest.st Tue Jun 16 06:45:26 2015 +0100 @@ -488,6 +488,45 @@ "Created: / 15-06-2015 / 18:27:18 / Jan Vrany " ! +testMappedNode3 + node := ((#letter asParser , #letter asParser) + ==> [:nodes | String with:(nodes first) with:(nodes second) ]) asCompilerTree. + node child markForInline. + + self compileTree:node. + + self assert:parser parse:'ab' to:'ab'. + self assert:parser parse:'cz' to:'cz'. + self assert:parser fail:''. + + "Created: / 16-06-2015 / 06:01:53 / Jan Vrany " +! + +testMappedNode4 + node := ((#letter asParser , #letter asParser) + ==> [:nodes | String with:(nodes first) with:(nodes second) ]) asCompilerTree. + node child markForInline. + + self compileTree:node. + + self assert:parser fail:'a'. + + "Created: / 16-06-2015 / 06:13:37 / Jan Vrany " +! + +testMappedNode5 + node := ((#letter asParser , #letter asParser optional) + ==> [:nodes | String with:(nodes first) with:((nodes second) isNil ifTrue:[$?] ifFalse:[nodes second]) ]) asCompilerTree. + node child markForInline. + + self compileTree:node. + + self assert:parser parse:'cz' to:'cz'. + self assert:parser parse:'c' to:'c?'. + + "Created: / 16-06-2015 / 06:32:24 / Jan Vrany " +! + testMessagePredicate | messageNode | messageNode := PPCMessagePredicateNode new