2008-07-24 00:50:21 -04:00
|
|
|
IN: compiler.tree.builder.tests
|
2008-08-15 00:35:19 -04:00
|
|
|
USING: compiler.tree.builder tools.test sequences kernel
|
2009-04-20 22:15:19 -04:00
|
|
|
compiler.tree stack-checker stack-checker.errors ;
|
2008-08-15 00:35:19 -04:00
|
|
|
|
|
|
|
: inline-recursive ( -- ) inline-recursive ; inline recursive
|
|
|
|
|
2009-02-24 00:55:16 -05:00
|
|
|
[ t ] [ \ inline-recursive build-tree-from-word [ #recursive? ] any? ] unit-test
|
2009-04-20 22:15:19 -04:00
|
|
|
|
|
|
|
: bad-recursion-1 ( a -- b )
|
|
|
|
dup [ drop bad-recursion-1 5 ] [ ] if ;
|
|
|
|
|
|
|
|
[ \ bad-recursion-1 build-tree-from-word ] [ inference-error? ] must-fail-with
|
|
|
|
|
|
|
|
FORGET: bad-recursion-1
|
|
|
|
|
|
|
|
: bad-recursion-2 ( obj -- obj )
|
|
|
|
dup [ dup first swap second bad-recursion-2 ] [ ] if ;
|
|
|
|
|
|
|
|
[ \ bad-recursion-2 build-tree-from-word ] [ inference-error? ] must-fail-with
|
|
|
|
|
|
|
|
FORGET: bad-recursion-2
|
|
|
|
|
|
|
|
: bad-bin ( a b -- ) 5 [ 5 bad-bin bad-bin 5 ] [ 2drop ] if ;
|
|
|
|
|
|
|
|
[ \ bad-bin build-tree-from-word ] [ inference-error? ] must-fail-with
|
|
|
|
|
|
|
|
FORGET: bad-bin
|