compiler/tests/PPCCodeGeneratorTest.st
changeset 481 34ee0d3c72e7
parent 471 7544e517db96
child 484 e829f3860745
equal deleted inserted replaced
480:5b0254cca4db 481:34ee0d3c72e7
   418     
   418     
   419     self assert: parser class methodDictionary size = 1.
   419     self assert: parser class methodDictionary size = 1.
   420     self assert: parser parse: 'foo'  to: 'foo'.
   420     self assert: parser parse: 'foo'  to: 'foo'.
   421     self assert: parser parse: 'foobar'  to: 'foo' end: 3.
   421     self assert: parser parse: 'foobar'  to: 'foo' end: 3.
   422     self assert: parser fail: 'boo'.
   422     self assert: parser fail: 'boo'.
       
   423 !
       
   424 
       
   425 testMappedActionNode1
       
   426     node := ((#letter asParser , #letter asParser) 
       
   427             map:[:a :b | String with:a with:b ]) asCompilerTree.
       
   428     self compileTree:node.
       
   429     self 
       
   430         assert:parser
       
   431         parse:'ab'
       
   432         to:'ab'.
       
   433     self 
       
   434         assert:parser
       
   435         parse:'cz'
       
   436         to:'cz'.
       
   437     self assert:parser fail:''.
       
   438     self assert:parser fail:'asd'.
       
   439 
       
   440     "Created: / 02-06-2015 / 17:04:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   441     "Modified: / 03-06-2015 / 06:10:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   423 !
   442 !
   424 
   443 
   425 testMessagePredicate
   444 testMessagePredicate
   426     | messageNode |
   445     | messageNode |
   427     messageNode := PPCMessagePredicateNode new
   446     messageNode := PPCMessagePredicateNode new