1 USING: smalltalk.compiler tools.test prettyprint smalltalk.ast
2 smalltalk.compiler.lexenv stack-checker locals.rewrite.closures
3 kernel accessors compiler.units sequences arrays ;
4 IN: smalltalk.compiler.tests
6 : test-compilation ( ast -- quot )
8 1array ast-sequence new swap >>body
9 compile-smalltalk [ call ] append
10 ] with-compilation-unit ;
12 : test-inference ( ast -- in# out# )
13 test-compilation infer [ in>> ] [ out>> ] bi [ length ] bi@ ;
22 { T{ ast-name f "b" } }
37 { T{ ast-name f "b" } }
45 T{ ast-return f T{ ast-name f "c" } }
67 T{ ast-name { name "i" } }
85 { { T{ ast-block { body { "a" } } } } }
86 } test-compilation call first call