1 USING: smalltalk.compiler tools.test prettyprint smalltalk.ast
2 smalltalk.compiler.lexenv stack-checker locals.rewrite
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 2length ;
22 { T{ ast-name f "b" } }
37 { T{ ast-name f "b" } }
45 T{ ast-return f T{ ast-name f "c" } }
66 { receiver T{ ast-name { name "i" } } }
83 { { T{ ast-block { body { "a" } } } } }
84 } test-compilation call first call