From 4d80343a574b4fe9a432930a2a801aacc7d3c944 Mon Sep 17 00:00:00 2001 From: ldXiao Date: Sun, 16 May 2021 11:17:01 -0400 Subject: [PATCH] test kit --- pa3-tests/README.md | 24 + pa3-tests/benchmarks/exp.py | 25 + pa3-tests/benchmarks/exp.py.ast.typed | 562 ++++ .../benchmarks/exp.py.ast.typed.s.result | 43 + pa3-tests/benchmarks/prime.py | 30 + pa3-tests/benchmarks/prime.py.ast.typed | 658 ++++ .../benchmarks/prime.py.ast.typed.s.result | 15 + pa3-tests/benchmarks/sieve.py | 107 + pa3-tests/benchmarks/sieve.py.ast.typed | 2816 +++++++++++++++++ .../benchmarks/sieve.py.ast.typed.s.result | 15 + pa3-tests/benchmarks/stdlib.py | 77 + pa3-tests/benchmarks/stdlib.py.ast.typed | 1813 +++++++++++ .../benchmarks/stdlib.py.ast.typed.s.result | 21 + pa3-tests/benchmarks/tree.py | 83 + pa3-tests/benchmarks/tree.py.ast.typed | 2301 ++++++++++++++ .../benchmarks/tree.py.ast.typed.s.result | 4 + pa3-tests/chocopy-ref.jar | Bin 0 -> 144814 bytes pa3-tests/core/call.py | 17 + pa3-tests/core/call.py.ast.typed | 386 +++ pa3-tests/core/call.py.ast.typed.s.result | 7 + pa3-tests/core/call_with_args.py | 19 + pa3-tests/core/call_with_args.py.ast.typed | 554 ++++ .../core/call_with_args.py.ast.typed.s.result | 9 + pa3-tests/core/error_div_zero.py | 1 + pa3-tests/core/error_div_zero.py.ast.typed | 65 + .../core/error_div_zero.py.ast.typed.s.result | 2 + pa3-tests/core/error_invalid_print.py | 1 + .../core/error_invalid_print.py.ast.typed | 46 + .../error_invalid_print.py.ast.typed.s.result | 2 + pa3-tests/core/error_mod_zero.py | 1 + pa3-tests/core/error_mod_zero.py.ast.typed | 65 + .../core/error_mod_zero.py.ast.typed.s.result | 2 + pa3-tests/core/expr_if.py | 2 + pa3-tests/core/expr_if.py.ast.typed | 135 + pa3-tests/core/expr_if.py.ast.typed.s.result | 2 + pa3-tests/core/id_global.py | 2 + pa3-tests/core/id_global.py.ast.typed | 73 + .../core/id_global.py.ast.typed.s.result | 1 + pa3-tests/core/id_local.py | 5 + pa3-tests/core/id_local.py.ast.typed | 114 + pa3-tests/core/id_local.py.ast.typed.s.result | 1 + pa3-tests/core/input.py | 8 + pa3-tests/core/input.py.ast.in | 4 + pa3-tests/core/input.py.ast.typed | 196 ++ pa3-tests/core/input.py.ast.typed.in | 4 + pa3-tests/core/input.py.ast.typed.s.result | 8 + pa3-tests/core/input.py.in | 4 + pa3-tests/core/len_invalid_1.py | 3 + pa3-tests/core/len_invalid_1.py.ast.typed | 103 + .../core/len_invalid_1.py.ast.typed.s.result | 2 + pa3-tests/core/len_invalid_2.py | 3 + pa3-tests/core/len_invalid_2.py.ast.typed | 97 + .../core/len_invalid_2.py.ast.typed.s.result | 2 + pa3-tests/core/list_concat.py | 12 + pa3-tests/core/list_concat.py.ast.typed | 437 +++ .../core/list_concat.py.ast.typed.s.result | 6 + pa3-tests/core/list_concat_2.py | 8 + pa3-tests/core/list_concat_2.py.ast.typed | 366 +++ .../core/list_concat_2.py.ast.typed.s.result | 9 + pa3-tests/core/list_concat_none.py | 4 + pa3-tests/core/list_concat_none.py.ast.typed | 156 + .../list_concat_none.py.ast.typed.s.result | 2 + pa3-tests/core/list_get_element.py | 6 + pa3-tests/core/list_get_element.py.ast.typed | 259 ++ .../list_get_element.py.ast.typed.s.result | 3 + pa3-tests/core/list_get_element_complex.py | 11 + .../list_get_element_complex.py.ast.typed | 313 ++ ..._get_element_complex.py.ast.typed.s.result | 1 + pa3-tests/core/list_get_element_none.py | 3 + .../core/list_get_element_none.py.ast.typed | 96 + ...ist_get_element_none.py.ast.typed.s.result | 2 + pa3-tests/core/list_get_element_oob_1.py | 4 + .../core/list_get_element_oob_1.py.ast.typed | 156 + ...st_get_element_oob_1.py.ast.typed.s.result | 2 + pa3-tests/core/list_get_element_oob_2.py | 4 + .../core/list_get_element_oob_2.py.ast.typed | 147 + ...st_get_element_oob_2.py.ast.typed.s.result | 2 + pa3-tests/core/list_get_element_oob_3.py | 4 + .../core/list_get_element_oob_3.py.ast.typed | 120 + ...st_get_element_oob_3.py.ast.typed.s.result | 2 + pa3-tests/core/list_len.py | 4 + pa3-tests/core/list_len.py.ast.typed | 154 + pa3-tests/core/list_len.py.ast.typed.s.result | 1 + pa3-tests/core/list_len_empty.py | 4 + pa3-tests/core/list_len_empty.py.ast.typed | 127 + .../core/list_len_empty.py.ast.typed.s.result | 1 + pa3-tests/core/list_set_element.py | 9 + pa3-tests/core/list_set_element.py.ast.typed | 382 +++ .../list_set_element.py.ast.typed.s.result | 3 + pa3-tests/core/list_set_element_none.py | 4 + .../core/list_set_element_none.py.ast.typed | 81 + ...ist_set_element_none.py.ast.typed.s.result | 2 + pa3-tests/core/list_set_element_oob_1.py | 7 + .../core/list_set_element_oob_1.py.ast.typed | 309 ++ ...st_set_element_oob_1.py.ast.typed.s.result | 2 + pa3-tests/core/list_set_element_oob_2.py | 7 + .../core/list_set_element_oob_2.py.ast.typed | 300 ++ ...st_set_element_oob_2.py.ast.typed.s.result | 2 + pa3-tests/core/list_set_element_oob_3.py | 4 + .../core/list_set_element_oob_3.py.ast.typed | 105 + ...st_set_element_oob_3.py.ast.typed.s.result | 2 + pa3-tests/core/literal_bool.py | 2 + pa3-tests/core/literal_bool.py.ast.typed | 83 + .../core/literal_bool.py.ast.typed.s.result | 2 + pa3-tests/core/literal_int.py | 2 + pa3-tests/core/literal_int.py.ast.typed | 83 + .../core/literal_int.py.ast.typed.s.result | 2 + pa3-tests/core/literal_str.py | 1 + pa3-tests/core/literal_str.py.ast.typed | 47 + .../core/literal_str.py.ast.typed.s.result | 1 + pa3-tests/core/nested.py | 11 + pa3-tests/core/nested.py.ast.typed | 272 ++ pa3-tests/core/nested.py.ast.typed.s.result | 1 + pa3-tests/core/nested2.py | 14 + pa3-tests/core/nested2.py.ast.typed | 337 ++ pa3-tests/core/nested2.py.ast.typed.s.result | 1 + pa3-tests/core/object_attr_get.py | 16 + pa3-tests/core/object_attr_get.py.ast.typed | 387 +++ .../object_attr_get.py.ast.typed.s.result | 4 + pa3-tests/core/object_attr_get_none.py | 16 + .../core/object_attr_get_none.py.ast.typed | 379 +++ ...object_attr_get_none.py.ast.typed.s.result | 4 + pa3-tests/core/object_attr_set.py | 18 + pa3-tests/core/object_attr_set.py.ast.typed | 455 +++ .../object_attr_set.py.ast.typed.s.result | 4 + pa3-tests/core/object_attr_set_eval_order.py | 33 + .../object_attr_set_eval_order.py.ast.typed | 771 +++++ ..._attr_set_eval_order.py.ast.typed.s.result | 10 + pa3-tests/core/object_attr_set_none.py | 19 + .../core/object_attr_set_none.py.ast.typed | 447 +++ ...object_attr_set_none.py.ast.typed.s.result | 4 + pa3-tests/core/object_init.py | 11 + pa3-tests/core/object_init.py.ast.typed | 173 + .../core/object_init.py.ast.typed.s.result | 1 + pa3-tests/core/object_method.py | 16 + pa3-tests/core/object_method.py.ast.typed | 387 +++ .../core/object_method.py.ast.typed.s.result | 2 + pa3-tests/core/object_method_complex_call.py | 19 + .../object_method_complex_call.py.ast.typed | 492 +++ ..._method_complex_call.py.ast.typed.s.result | 3 + pa3-tests/core/object_method_nested.py | 18 + .../core/object_method_nested.py.ast.typed | 439 +++ ...object_method_nested.py.ast.typed.s.result | 2 + pa3-tests/core/object_method_none.py | 17 + .../core/object_method_none.py.ast.typed | 412 +++ .../object_method_none.py.ast.typed.s.result | 3 + pa3-tests/core/object_method_override.py | 19 + .../core/object_method_override.py.ast.typed | 441 +++ ...ject_method_override.py.ast.typed.s.result | 2 + pa3-tests/core/op_add.py | 1 + pa3-tests/core/op_add.py.ast.typed | 65 + pa3-tests/core/op_add.py.ast.typed.s.result | 1 + pa3-tests/core/op_cmp_bool.py | 8 + pa3-tests/core/op_cmp_bool.py.ast.typed | 443 +++ .../core/op_cmp_bool.py.ast.typed.s.result | 8 + pa3-tests/core/op_cmp_int.py | 16 + pa3-tests/core/op_cmp_int.py.ast.typed | 711 +++++ .../core/op_cmp_int.py.ast.typed.s.result | 12 + pa3-tests/core/op_div_mod.py | 5 + pa3-tests/core/op_div_mod.py.ast.typed | 171 + .../core/op_div_mod.py.ast.typed.s.result | 2 + pa3-tests/core/op_is.py | 19 + pa3-tests/core/op_is.py.ast.typed | 598 ++++ pa3-tests/core/op_is.py.ast.typed.s.result | 7 + pa3-tests/core/op_logical.py | 13 + pa3-tests/core/op_logical.py.ast.typed | 411 +++ .../core/op_logical.py.ast.typed.s.result | 6 + pa3-tests/core/op_mul.py | 1 + pa3-tests/core/op_mul.py.ast.typed | 83 + pa3-tests/core/op_mul.py.ast.typed.s.result | 1 + pa3-tests/core/op_negate.py | 2 + pa3-tests/core/op_negate.py.ast.typed | 82 + .../core/op_negate.py.ast.typed.s.result | 1 + pa3-tests/core/op_sub.py | 1 + pa3-tests/core/op_sub.py.ast.typed | 65 + pa3-tests/core/op_sub.py.ast.typed.s.result | 1 + pa3-tests/core/pass.py | 1 + pa3-tests/core/pass.py.ast.typed | 11 + pa3-tests/core/pass.py.ast.typed.s.result | 0 pa3-tests/core/predef_constructors.py | 4 + .../core/predef_constructors.py.ast.typed | 192 ++ .../predef_constructors.py.ast.typed.s.result | 4 + pa3-tests/core/stmt_for_list.py | 7 + pa3-tests/core/stmt_for_list.py.ast.typed | 178 ++ .../core/stmt_for_list.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_list_empty.py | 12 + .../core/stmt_for_list_empty.py.ast.typed | 318 ++ .../stmt_for_list_empty.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_list_eval.py | 8 + .../core/stmt_for_list_eval.py.ast.typed | 202 ++ .../stmt_for_list_eval.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_list_modify.py | 8 + .../core/stmt_for_list_modify.py.ast.typed | 219 ++ ...stmt_for_list_modify.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_list_nested.py | 9 + .../core/stmt_for_list_nested.py.ast.typed | 247 ++ ...stmt_for_list_nested.py.ast.typed.s.result | 9 + .../core/stmt_for_list_nested_same_var.py | 9 + ...stmt_for_list_nested_same_var.py.ast.typed | 229 ++ ...list_nested_same_var.py.ast.typed.s.result | 9 + pa3-tests/core/stmt_for_list_none.py | 5 + .../core/stmt_for_list_none.py.ast.typed | 127 + .../stmt_for_list_none.py.ast.typed.s.result | 2 + pa3-tests/core/stmt_for_list_nonlocal.py | 15 + .../core/stmt_for_list_nonlocal.py.ast.typed | 408 +++ ...mt_for_list_nonlocal.py.ast.typed.s.result | 1 + pa3-tests/core/stmt_for_list_return.py | 8 + .../core/stmt_for_list_return.py.ast.typed | 241 ++ ...stmt_for_list_return.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_str.py | 5 + pa3-tests/core/stmt_for_str.py.ast.typed | 121 + .../core/stmt_for_str.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_str_empty.py | 8 + .../core/stmt_for_str_empty.py.ast.typed | 205 ++ .../stmt_for_str_empty.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_str_eval.py | 6 + pa3-tests/core/stmt_for_str_eval.py.ast.typed | 142 + .../stmt_for_str_eval.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_for_str_nested.py | 8 + .../core/stmt_for_str_nested.py.ast.typed | 205 ++ .../stmt_for_str_nested.py.ast.typed.s.result | 12 + pa3-tests/core/stmt_for_str_same_var.py | 4 + .../core/stmt_for_str_same_var.py.ast.typed | 95 + ...tmt_for_str_same_var.py.ast.typed.s.result | 3 + pa3-tests/core/stmt_if.py | 7 + pa3-tests/core/stmt_if.py.ast.typed | 125 + pa3-tests/core/stmt_if.py.ast.typed.s.result | 1 + pa3-tests/core/stmt_return_early.py | 6 + pa3-tests/core/stmt_return_early.py.ast.typed | 113 + .../stmt_return_early.py.ast.typed.s.result | 1 + pa3-tests/core/stmt_while.py | 4 + pa3-tests/core/stmt_while.py.ast.typed | 143 + .../core/stmt_while.py.ast.typed.s.result | 9 + pa3-tests/core/str_cat.py | 17 + pa3-tests/core/str_cat.py.ast.typed | 738 +++++ pa3-tests/core/str_cat.py.ast.typed.s.result | 6 + pa3-tests/core/str_cat_2.py | 19 + pa3-tests/core/str_cat_2.py.ast.typed | 638 ++++ .../core/str_cat_2.py.ast.typed.s.result | 3 + pa3-tests/core/str_cmp.py | 17 + pa3-tests/core/str_cmp.py.ast.typed | 659 ++++ pa3-tests/core/str_cmp.py.ast.typed.s.result | 6 + pa3-tests/core/str_get_element.py | 14 + pa3-tests/core/str_get_element.py.ast.typed | 462 +++ .../str_get_element.py.ast.typed.s.result | 3 + pa3-tests/core/str_get_element_oob_1.py | 8 + .../core/str_get_element_oob_1.py.ast.typed | 235 ++ ...tr_get_element_oob_1.py.ast.typed.s.result | 2 + pa3-tests/core/str_get_element_oob_2.py | 8 + .../core/str_get_element_oob_2.py.ast.typed | 226 ++ ...tr_get_element_oob_2.py.ast.typed.s.result | 2 + pa3-tests/core/str_get_element_oob_3.py | 8 + .../core/str_get_element_oob_3.py.ast.typed | 226 ++ ...tr_get_element_oob_3.py.ast.typed.s.result | 2 + pa3-tests/core/str_len.py | 1 + pa3-tests/core/str_len.py.ast.typed | 71 + pa3-tests/core/str_len.py.ast.typed.s.result | 1 + pa3-tests/core/var_assign.py | 4 + pa3-tests/core/var_assign.py.ast.typed | 128 + .../core/var_assign.py.ast.typed.s.result | 1 + pa3-tests/run-tests.sh | 18 + 261 files changed, 30055 insertions(+) create mode 100644 pa3-tests/README.md create mode 100644 pa3-tests/benchmarks/exp.py create mode 100644 pa3-tests/benchmarks/exp.py.ast.typed create mode 100644 pa3-tests/benchmarks/exp.py.ast.typed.s.result create mode 100644 pa3-tests/benchmarks/prime.py create mode 100644 pa3-tests/benchmarks/prime.py.ast.typed create mode 100644 pa3-tests/benchmarks/prime.py.ast.typed.s.result create mode 100644 pa3-tests/benchmarks/sieve.py create mode 100644 pa3-tests/benchmarks/sieve.py.ast.typed create mode 100644 pa3-tests/benchmarks/sieve.py.ast.typed.s.result create mode 100644 pa3-tests/benchmarks/stdlib.py create mode 100644 pa3-tests/benchmarks/stdlib.py.ast.typed create mode 100644 pa3-tests/benchmarks/stdlib.py.ast.typed.s.result create mode 100644 pa3-tests/benchmarks/tree.py create mode 100644 pa3-tests/benchmarks/tree.py.ast.typed create mode 100644 pa3-tests/benchmarks/tree.py.ast.typed.s.result create mode 100644 pa3-tests/chocopy-ref.jar create mode 100644 pa3-tests/core/call.py create mode 100644 pa3-tests/core/call.py.ast.typed create mode 100644 pa3-tests/core/call.py.ast.typed.s.result create mode 100644 pa3-tests/core/call_with_args.py create mode 100644 pa3-tests/core/call_with_args.py.ast.typed create mode 100644 pa3-tests/core/call_with_args.py.ast.typed.s.result create mode 100644 pa3-tests/core/error_div_zero.py create mode 100644 pa3-tests/core/error_div_zero.py.ast.typed create mode 100644 pa3-tests/core/error_div_zero.py.ast.typed.s.result create mode 100644 pa3-tests/core/error_invalid_print.py create mode 100644 pa3-tests/core/error_invalid_print.py.ast.typed create mode 100644 pa3-tests/core/error_invalid_print.py.ast.typed.s.result create mode 100644 pa3-tests/core/error_mod_zero.py create mode 100644 pa3-tests/core/error_mod_zero.py.ast.typed create mode 100644 pa3-tests/core/error_mod_zero.py.ast.typed.s.result create mode 100644 pa3-tests/core/expr_if.py create mode 100644 pa3-tests/core/expr_if.py.ast.typed create mode 100644 pa3-tests/core/expr_if.py.ast.typed.s.result create mode 100644 pa3-tests/core/id_global.py create mode 100644 pa3-tests/core/id_global.py.ast.typed create mode 100644 pa3-tests/core/id_global.py.ast.typed.s.result create mode 100644 pa3-tests/core/id_local.py create mode 100644 pa3-tests/core/id_local.py.ast.typed create mode 100644 pa3-tests/core/id_local.py.ast.typed.s.result create mode 100644 pa3-tests/core/input.py create mode 100644 pa3-tests/core/input.py.ast.in create mode 100644 pa3-tests/core/input.py.ast.typed create mode 100644 pa3-tests/core/input.py.ast.typed.in create mode 100644 pa3-tests/core/input.py.ast.typed.s.result create mode 100644 pa3-tests/core/input.py.in create mode 100644 pa3-tests/core/len_invalid_1.py create mode 100644 pa3-tests/core/len_invalid_1.py.ast.typed create mode 100644 pa3-tests/core/len_invalid_1.py.ast.typed.s.result create mode 100644 pa3-tests/core/len_invalid_2.py create mode 100644 pa3-tests/core/len_invalid_2.py.ast.typed create mode 100644 pa3-tests/core/len_invalid_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_concat.py create mode 100644 pa3-tests/core/list_concat.py.ast.typed create mode 100644 pa3-tests/core/list_concat.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_concat_2.py create mode 100644 pa3-tests/core/list_concat_2.py.ast.typed create mode 100644 pa3-tests/core/list_concat_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_concat_none.py create mode 100644 pa3-tests/core/list_concat_none.py.ast.typed create mode 100644 pa3-tests/core/list_concat_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element.py create mode 100644 pa3-tests/core/list_get_element.py.ast.typed create mode 100644 pa3-tests/core/list_get_element.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element_complex.py create mode 100644 pa3-tests/core/list_get_element_complex.py.ast.typed create mode 100644 pa3-tests/core/list_get_element_complex.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element_none.py create mode 100644 pa3-tests/core/list_get_element_none.py.ast.typed create mode 100644 pa3-tests/core/list_get_element_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element_oob_1.py create mode 100644 pa3-tests/core/list_get_element_oob_1.py.ast.typed create mode 100644 pa3-tests/core/list_get_element_oob_1.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element_oob_2.py create mode 100644 pa3-tests/core/list_get_element_oob_2.py.ast.typed create mode 100644 pa3-tests/core/list_get_element_oob_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_get_element_oob_3.py create mode 100644 pa3-tests/core/list_get_element_oob_3.py.ast.typed create mode 100644 pa3-tests/core/list_get_element_oob_3.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_len.py create mode 100644 pa3-tests/core/list_len.py.ast.typed create mode 100644 pa3-tests/core/list_len.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_len_empty.py create mode 100644 pa3-tests/core/list_len_empty.py.ast.typed create mode 100644 pa3-tests/core/list_len_empty.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_set_element.py create mode 100644 pa3-tests/core/list_set_element.py.ast.typed create mode 100644 pa3-tests/core/list_set_element.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_set_element_none.py create mode 100644 pa3-tests/core/list_set_element_none.py.ast.typed create mode 100644 pa3-tests/core/list_set_element_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_set_element_oob_1.py create mode 100644 pa3-tests/core/list_set_element_oob_1.py.ast.typed create mode 100644 pa3-tests/core/list_set_element_oob_1.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_set_element_oob_2.py create mode 100644 pa3-tests/core/list_set_element_oob_2.py.ast.typed create mode 100644 pa3-tests/core/list_set_element_oob_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/list_set_element_oob_3.py create mode 100644 pa3-tests/core/list_set_element_oob_3.py.ast.typed create mode 100644 pa3-tests/core/list_set_element_oob_3.py.ast.typed.s.result create mode 100644 pa3-tests/core/literal_bool.py create mode 100644 pa3-tests/core/literal_bool.py.ast.typed create mode 100644 pa3-tests/core/literal_bool.py.ast.typed.s.result create mode 100644 pa3-tests/core/literal_int.py create mode 100644 pa3-tests/core/literal_int.py.ast.typed create mode 100644 pa3-tests/core/literal_int.py.ast.typed.s.result create mode 100644 pa3-tests/core/literal_str.py create mode 100644 pa3-tests/core/literal_str.py.ast.typed create mode 100644 pa3-tests/core/literal_str.py.ast.typed.s.result create mode 100644 pa3-tests/core/nested.py create mode 100644 pa3-tests/core/nested.py.ast.typed create mode 100644 pa3-tests/core/nested.py.ast.typed.s.result create mode 100644 pa3-tests/core/nested2.py create mode 100644 pa3-tests/core/nested2.py.ast.typed create mode 100644 pa3-tests/core/nested2.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_attr_get.py create mode 100644 pa3-tests/core/object_attr_get.py.ast.typed create mode 100644 pa3-tests/core/object_attr_get.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_attr_get_none.py create mode 100644 pa3-tests/core/object_attr_get_none.py.ast.typed create mode 100644 pa3-tests/core/object_attr_get_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_attr_set.py create mode 100644 pa3-tests/core/object_attr_set.py.ast.typed create mode 100644 pa3-tests/core/object_attr_set.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_attr_set_eval_order.py create mode 100644 pa3-tests/core/object_attr_set_eval_order.py.ast.typed create mode 100644 pa3-tests/core/object_attr_set_eval_order.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_attr_set_none.py create mode 100644 pa3-tests/core/object_attr_set_none.py.ast.typed create mode 100644 pa3-tests/core/object_attr_set_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_init.py create mode 100644 pa3-tests/core/object_init.py.ast.typed create mode 100644 pa3-tests/core/object_init.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_method.py create mode 100644 pa3-tests/core/object_method.py.ast.typed create mode 100644 pa3-tests/core/object_method.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_method_complex_call.py create mode 100644 pa3-tests/core/object_method_complex_call.py.ast.typed create mode 100644 pa3-tests/core/object_method_complex_call.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_method_nested.py create mode 100644 pa3-tests/core/object_method_nested.py.ast.typed create mode 100644 pa3-tests/core/object_method_nested.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_method_none.py create mode 100644 pa3-tests/core/object_method_none.py.ast.typed create mode 100644 pa3-tests/core/object_method_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/object_method_override.py create mode 100644 pa3-tests/core/object_method_override.py.ast.typed create mode 100644 pa3-tests/core/object_method_override.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_add.py create mode 100644 pa3-tests/core/op_add.py.ast.typed create mode 100644 pa3-tests/core/op_add.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_cmp_bool.py create mode 100644 pa3-tests/core/op_cmp_bool.py.ast.typed create mode 100644 pa3-tests/core/op_cmp_bool.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_cmp_int.py create mode 100644 pa3-tests/core/op_cmp_int.py.ast.typed create mode 100644 pa3-tests/core/op_cmp_int.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_div_mod.py create mode 100644 pa3-tests/core/op_div_mod.py.ast.typed create mode 100644 pa3-tests/core/op_div_mod.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_is.py create mode 100644 pa3-tests/core/op_is.py.ast.typed create mode 100644 pa3-tests/core/op_is.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_logical.py create mode 100644 pa3-tests/core/op_logical.py.ast.typed create mode 100644 pa3-tests/core/op_logical.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_mul.py create mode 100644 pa3-tests/core/op_mul.py.ast.typed create mode 100644 pa3-tests/core/op_mul.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_negate.py create mode 100644 pa3-tests/core/op_negate.py.ast.typed create mode 100644 pa3-tests/core/op_negate.py.ast.typed.s.result create mode 100644 pa3-tests/core/op_sub.py create mode 100644 pa3-tests/core/op_sub.py.ast.typed create mode 100644 pa3-tests/core/op_sub.py.ast.typed.s.result create mode 100644 pa3-tests/core/pass.py create mode 100644 pa3-tests/core/pass.py.ast.typed create mode 100644 pa3-tests/core/pass.py.ast.typed.s.result create mode 100644 pa3-tests/core/predef_constructors.py create mode 100644 pa3-tests/core/predef_constructors.py.ast.typed create mode 100644 pa3-tests/core/predef_constructors.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list.py create mode 100644 pa3-tests/core/stmt_for_list.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_empty.py create mode 100644 pa3-tests/core/stmt_for_list_empty.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_empty.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_eval.py create mode 100644 pa3-tests/core/stmt_for_list_eval.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_eval.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_modify.py create mode 100644 pa3-tests/core/stmt_for_list_modify.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_modify.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_nested.py create mode 100644 pa3-tests/core/stmt_for_list_nested.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_nested.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_nested_same_var.py create mode 100644 pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_none.py create mode 100644 pa3-tests/core/stmt_for_list_none.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_none.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_nonlocal.py create mode 100644 pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_list_return.py create mode 100644 pa3-tests/core/stmt_for_list_return.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_list_return.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_str.py create mode 100644 pa3-tests/core/stmt_for_str.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_str.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_str_empty.py create mode 100644 pa3-tests/core/stmt_for_str_empty.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_str_empty.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_str_eval.py create mode 100644 pa3-tests/core/stmt_for_str_eval.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_str_eval.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_str_nested.py create mode 100644 pa3-tests/core/stmt_for_str_nested.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_str_nested.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_for_str_same_var.py create mode 100644 pa3-tests/core/stmt_for_str_same_var.py.ast.typed create mode 100644 pa3-tests/core/stmt_for_str_same_var.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_if.py create mode 100644 pa3-tests/core/stmt_if.py.ast.typed create mode 100644 pa3-tests/core/stmt_if.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_return_early.py create mode 100644 pa3-tests/core/stmt_return_early.py.ast.typed create mode 100644 pa3-tests/core/stmt_return_early.py.ast.typed.s.result create mode 100644 pa3-tests/core/stmt_while.py create mode 100644 pa3-tests/core/stmt_while.py.ast.typed create mode 100644 pa3-tests/core/stmt_while.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_cat.py create mode 100644 pa3-tests/core/str_cat.py.ast.typed create mode 100644 pa3-tests/core/str_cat.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_cat_2.py create mode 100644 pa3-tests/core/str_cat_2.py.ast.typed create mode 100644 pa3-tests/core/str_cat_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_cmp.py create mode 100644 pa3-tests/core/str_cmp.py.ast.typed create mode 100644 pa3-tests/core/str_cmp.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_get_element.py create mode 100644 pa3-tests/core/str_get_element.py.ast.typed create mode 100644 pa3-tests/core/str_get_element.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_get_element_oob_1.py create mode 100644 pa3-tests/core/str_get_element_oob_1.py.ast.typed create mode 100644 pa3-tests/core/str_get_element_oob_1.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_get_element_oob_2.py create mode 100644 pa3-tests/core/str_get_element_oob_2.py.ast.typed create mode 100644 pa3-tests/core/str_get_element_oob_2.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_get_element_oob_3.py create mode 100644 pa3-tests/core/str_get_element_oob_3.py.ast.typed create mode 100644 pa3-tests/core/str_get_element_oob_3.py.ast.typed.s.result create mode 100644 pa3-tests/core/str_len.py create mode 100644 pa3-tests/core/str_len.py.ast.typed create mode 100644 pa3-tests/core/str_len.py.ast.typed.s.result create mode 100644 pa3-tests/core/var_assign.py create mode 100644 pa3-tests/core/var_assign.py.ast.typed create mode 100644 pa3-tests/core/var_assign.py.ast.typed.s.result create mode 100755 pa3-tests/run-tests.sh diff --git a/pa3-tests/README.md b/pa3-tests/README.md new file mode 100644 index 0000000..1e320cd --- /dev/null +++ b/pa3-tests/README.md @@ -0,0 +1,24 @@ +# Tests for PA3: ChocoPy Code Generation + +Clone a student repository: +``` +TEAM="team" +git clone --branch=pa3final \ + https://github.com/nyu-compiler-construction/pa3-chocopy-code-generation-${TEAM} +``` + +Build it: +``` +cd pa3-chocopy-code-generation-${TEAM} +mvn clean package +``` + +Clone the tests _into_ the student repository: +``` +git clone https://github.com/nyu-compiler-construction/pa3-tests +``` + +Run the tests: +``` +./pa3-tests/run-tests.sh +``` diff --git a/pa3-tests/benchmarks/exp.py b/pa3-tests/benchmarks/exp.py new file mode 100644 index 0000000..3915517 --- /dev/null +++ b/pa3-tests/benchmarks/exp.py @@ -0,0 +1,25 @@ +# Compute x**y +def exp(x: int, y: int) -> int: + a: int = 0 + def f(i: int) -> int: + nonlocal a + def geta() -> int: + return a + if i <= 0: + return geta() + else: + a = a * x + return f(i-1) + a = 1 + return f(y) + +# Input parameter +n:int = 42 + +# Run [0, n] +i:int = 0 + +# Crunch +while i <= n: + print(exp(2, i % 31)) + i = i + 1 \ No newline at end of file diff --git a/pa3-tests/benchmarks/exp.py.ast.typed b/pa3-tests/benchmarks/exp.py.ast.typed new file mode 100644 index 0000000..39a7fa1 --- /dev/null +++ b/pa3-tests/benchmarks/exp.py.ast.typed @@ -0,0 +1,562 @@ +{ + "kind" : "Program", + "location" : [ 2, 1, 26, 1 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 2, 1, 14, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 7 ], + "name" : "exp" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 9, 2, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 9, 2, 9 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 12, 2, 14 ], + "className" : "int" + } + }, { + "kind" : "TypedVar", + "location" : [ 2, 17, 2, 22 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 17, 2, 17 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 20, 2, 22 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 28, 2, 30 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 2, 3, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 2, 3, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 2, 3, 2 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 5, 3, 7 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 11, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 2, 13, 1 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 6, 4, 6 ], + "name" : "f" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 8, 4, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 8, 4, 8 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 11, 4, 13 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 19, 4, 21 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "NonLocalDecl", + "location" : [ 5, 3, 5, 12 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "name" : "a" + } + }, { + "kind" : "FuncDef", + "location" : [ 6, 3, 7, 12 ], + "name" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 10 ], + "name" : "geta" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 6, 17, 6, 19 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 7, 4, 7, 11 ], + "value" : { + "kind" : "Identifier", + "location" : [ 7, 11, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "a" + } + } ] + } ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 8, 3, 13, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 8, 6, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 6, 8, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<=", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 8, 11, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 4, 9, 16 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 9, 11, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 11, 9, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "geta" + }, + "args" : [ ] + } + } ], + "elseBody" : [ { + "kind" : "AssignStmt", + "location" : [ 11, 4, 11, 12 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 11, 4, 11, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "a" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 11, 8, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 11, 8, 11, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "a" + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } + }, { + "kind" : "ReturnStmt", + "location" : [ 12, 4, 12, 16 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 12, 11, 12, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 11, 12, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 12, 13, 12, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 12, 13, 12, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "-", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 12, 15, 12, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 2, 13, 6 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 2, 13, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "a" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 13, 6, 13, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "ReturnStmt", + "location" : [ 14, 2, 14, 12 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 14, 9, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 11, 14, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } ] + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 17, 1, 17, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 17, 1, 17, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 1 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 17, 3, 17, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 17, 9, 17, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "VarDef", + "location" : [ 20, 1, 20, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 20, 1, 20, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 20, 1, 20, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 20, 3, 20, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 20, 9, 20, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 23, 1, 26, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 23, 7, 23, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 23, 7, 23, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<=", + "right" : { + "kind" : "Identifier", + "location" : [ 23, 12, 23, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 24, 2, 24, 22 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 24, 2, 24, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 24, 2, 24, 6 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 24, 8, 24, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 24, 8, 24, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "exp" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 24, 12, 24, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "BinaryExpr", + "location" : [ 24, 15, 24, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 24, 15, 24, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "%", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 24, 19, 24, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 31 + } + } ] + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 25, 2, 25, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 25, 2, 25, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 25, 6, 25, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 25, 6, 25, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 25, 10, 25, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/benchmarks/exp.py.ast.typed.s.result b/pa3-tests/benchmarks/exp.py.ast.typed.s.result new file mode 100644 index 0000000..6bce2e5 --- /dev/null +++ b/pa3-tests/benchmarks/exp.py.ast.typed.s.result @@ -0,0 +1,43 @@ +1 +2 +4 +8 +16 +32 +64 +128 +256 +512 +1024 +2048 +4096 +8192 +16384 +32768 +65536 +131072 +262144 +524288 +1048576 +2097152 +4194304 +8388608 +16777216 +33554432 +67108864 +134217728 +268435456 +536870912 +1073741824 +1 +2 +4 +8 +16 +32 +64 +128 +256 +512 +1024 +2048 diff --git a/pa3-tests/benchmarks/prime.py b/pa3-tests/benchmarks/prime.py new file mode 100644 index 0000000..7568705 --- /dev/null +++ b/pa3-tests/benchmarks/prime.py @@ -0,0 +1,30 @@ +# Get the n-th prime starting from 2 +def get_prime(n:int) -> int: + candidate:int = 2 + found:int = 0 + while True: + if is_prime(candidate): + found = found + 1 + if found == n: + return candidate + candidate = candidate + 1 + return 0 # Never happens + +def is_prime(x:int) -> bool: + div:int = 2 + while div < x: + if x % div == 0: + return False + div = div + 1 + return True + +# Input parameter +n:int = 15 + +# Run [1, n] +i:int = 1 + +# Crunch +while i <= n: + print(get_prime(i)) + i = i + 1 diff --git a/pa3-tests/benchmarks/prime.py.ast.typed b/pa3-tests/benchmarks/prime.py.ast.typed new file mode 100644 index 0000000..a3062b6 --- /dev/null +++ b/pa3-tests/benchmarks/prime.py.ast.typed @@ -0,0 +1,658 @@ +{ + "kind" : "Program", + "location" : [ 2, 1, 31, 1 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 2, 1, 11, 29 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 13 ], + "name" : "get_prime" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 15, 2, 19 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 15, 2, 15 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 17, 2, 19 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 25, 2, 27 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 21 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 13 ], + "name" : "candidate" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 15, 3, 17 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 21, 3, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + }, { + "kind" : "VarDef", + "location" : [ 4, 5, 4, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 5, 4, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 9 ], + "name" : "found" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 11, 4, 13 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 17, 4, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 5, 5, 11, 4 ], + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 11, 5, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "body" : [ { + "kind" : "IfStmt", + "location" : [ 6, 9, 10, 8 ], + "condition" : { + "kind" : "CallExpr", + "location" : [ 6, 12, 6, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 12, 6, 19 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "is_prime" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 21, 6, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "candidate" + } ] + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 13, 7, 29 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "found" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 7, 21, 7, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 7, 21, 7, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "found" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 7, 29, 7, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + }, { + "kind" : "IfStmt", + "location" : [ 8, 13, 10, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 8, 16, 8, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 16, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "found" + }, + "operator" : "==", + "right" : { + "kind" : "Identifier", + "location" : [ 8, 25, 8, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 17, 9, 32 ], + "value" : { + "kind" : "Identifier", + "location" : [ 9, 24, 9, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "candidate" + } + } ], + "elseBody" : [ ] + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 10, 9, 10, 33 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "candidate" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 10, 21, 10, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 10, 21, 10, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "candidate" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 10, 33, 10, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 11, 5, 11, 12 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 1, 19, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 12 ], + "name" : "is_prime" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 14, 13, 18 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 14, 13, 14 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 16, 13, 18 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 24, 13, 27 ], + "className" : "bool" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 14, 5, 14, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 14, 5, 14, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 14, 5, 14, 7 ], + "name" : "div" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 14, 9, 14, 11 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 14, 15, 14, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 15, 5, 19, 4 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 15, 11, 15, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 15, 11, 15, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "div" + }, + "operator" : "<", + "right" : { + "kind" : "Identifier", + "location" : [ 15, 17, 15, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + }, + "body" : [ { + "kind" : "IfStmt", + "location" : [ 16, 9, 18, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 16, 12, 16, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 16, 12, 16, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 16, 12, 16, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "%", + "right" : { + "kind" : "Identifier", + "location" : [ 16, 16, 16, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "div" + } + }, + "operator" : "==", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 16, 23, 16, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 17, 13, 17, 24 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 17, 20, 17, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 18, 9, 18, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 18, 9, 18, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "div" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 18, 15, 18, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 18, 15, 18, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "div" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 18, 21, 18, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 19, 5, 19, 15 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 19, 12, 19, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 22, 1, 22, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 22, 1, 22, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 22, 1, 22, 1 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 22, 3, 22, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 22, 9, 22, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 15 + } + }, { + "kind" : "VarDef", + "location" : [ 25, 1, 25, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 25, 1, 25, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 25, 1, 25, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 25, 3, 25, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 25, 9, 25, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 28, 1, 31, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 28, 7, 28, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 28, 7, 28, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<=", + "right" : { + "kind" : "Identifier", + "location" : [ 28, 12, 28, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 29, 5, 29, 23 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 29, 5, 29, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 29, 5, 29, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 29, 11, 29, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 29, 11, 29, 19 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "get_prime" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 29, 21, 29, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 30, 5, 30, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 30, 5, 30, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 30, 9, 30, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 30, 9, 30, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 30, 13, 30, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/benchmarks/prime.py.ast.typed.s.result b/pa3-tests/benchmarks/prime.py.ast.typed.s.result new file mode 100644 index 0000000..6beaeaa --- /dev/null +++ b/pa3-tests/benchmarks/prime.py.ast.typed.s.result @@ -0,0 +1,15 @@ +2 +3 +5 +7 +11 +13 +17 +19 +23 +29 +31 +37 +41 +43 +47 diff --git a/pa3-tests/benchmarks/sieve.py b/pa3-tests/benchmarks/sieve.py new file mode 100644 index 0000000..b6aa977 --- /dev/null +++ b/pa3-tests/benchmarks/sieve.py @@ -0,0 +1,107 @@ +# A resizable list of integers +class Vector(object): + items: [int] = None + size: int = 0 + + def __init__(self:"Vector"): + self.items = [0] + + # Returns current capacity + def capacity(self:"Vector") -> int: + return len(self.items) + + # Increases capacity of vector by one element + def increase_capacity(self:"Vector") -> int: + self.items = self.items + [0] + return self.capacity() + + # Appends one item to end of vector + def append(self:"Vector", item: int) -> object: + if self.size == self.capacity(): + self.increase_capacity() + + self.items[self.size] = item + self.size = self.size + 1 + + # Appends many items to end of vector + def append_all(self:"Vector", new_items: [int]) -> object: + item:int = 0 + for item in new_items: + self.append(item) + + # Removes an item from the middle of vector + def remove_at(self:"Vector", idx: int) -> object: + if idx < 0: + return + + while idx < self.size - 1: + self.items[idx] = self.items[idx + 1] + idx = idx + 1 + + self.size = self.size - 1 + + # Retrieves an item at a given index + def get(self:"Vector", idx: int) -> int: + return self.items[idx] + + # Retrieves the current size of the vector + def length(self:"Vector") -> int: + return self.size + +# A faster (but more memory-consuming) implementation of vector +class DoublingVector(Vector): + doubling_limit:int = 1000 + + # Overriding to do fewer resizes + def increase_capacity(self:"DoublingVector") -> int: + if (self.capacity() <= self.doubling_limit // 2): + self.items = self.items + self.items + else: + # If doubling limit has been reached, fall back to + # standard capacity increases + self.items = self.items + [0] + return self.capacity() + +# Makes a vector in the range [i, j) +def vrange(i:int, j:int) -> Vector: + v:Vector = None + v = DoublingVector() + + while i < j: + v.append(i) + i = i + 1 + + return v + +# Sieve of Eratosthenes (not really) +def sieve(v:Vector) -> object: + i:int = 0 + j:int = 0 + k:int = 0 + + while i < v.length(): + k = v.get(i) + j = i + 1 + while j < v.length(): + if v.get(j) % k == 0: + v.remove_at(j) + else: + j = j + 1 + i = i + 1 + +# Input parameter +n:int = 50 + +# Data +v:Vector = None +i:int = 0 + +# Crunch +v = vrange(2, n) +sieve(v) + +# Print +while i < v.length(): + print(v.get(i)) + i = i + 1 + diff --git a/pa3-tests/benchmarks/sieve.py.ast.typed b/pa3-tests/benchmarks/sieve.py.ast.typed new file mode 100644 index 0000000..1c0eb6c --- /dev/null +++ b/pa3-tests/benchmarks/sieve.py.ast.typed @@ -0,0 +1,2816 @@ +{ + "kind" : "Program", + "location" : [ 2, 1, 108, 1 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 2, 1, 52, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 7, 2, 12 ], + "name" : "Vector" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 2, 14, 2, 19 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 23 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 16 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 9 ], + "name" : "items" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 12, 3, 16 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 13, 3, 15 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 20, 3, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 4, 5, 4, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 5, 4, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 8 ], + "name" : "size" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 11, 4, 13 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 17, 4, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "FuncDef", + "location" : [ 6, 5, 7, 25 ], + "name" : { + "kind" : "Identifier", + "location" : [ 6, 9, 6, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 6, 18, 6, 30 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 18, 6, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 6, 23, 6, 30 ], + "className" : "Vector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 6, 32, 6, 32 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 9, 7, 24 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 7, 9, 7, 18 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 7, 14, 7, 18 ], + "name" : "items" + } + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 7, 22, 7, 24 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 7, 23, 7, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 31 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "capacity" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 30 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 30 ], + "className" : "Vector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 36, 10, 38 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 11, 9, 11, 30 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 11, 16, 11, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 16, 11, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 11, 20, 11, 29 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 11, 20, 11, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 11, 25, 11, 29 ], + "name" : "items" + } + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 14, 5, 16, 31 ], + "name" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 25 ], + "name" : "increase_capacity" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 14, 27, 14, 39 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 14, 27, 14, 30 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 14, 32, 14, 39 ], + "className" : "Vector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 14, 45, 14, 47 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 15, 9, 15, 37 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 15, 9, 15, 18 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 9, 15, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 14, 15, 18 ], + "name" : "items" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 15, 22, 15, 37 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 15, 22, 15, 31 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 22, 15, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 27, 15, 31 ], + "name" : "items" + } + }, + "operator" : "+", + "right" : { + "kind" : "ListExpr", + "location" : [ 15, 35, 15, 37 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 15, 36, 15, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } ] + } + } + }, { + "kind" : "ReturnStmt", + "location" : [ 16, 9, 16, 30 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 16, 16, 16, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 16, 16, 16, 28 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 16, 16, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 21, 16, 28 ], + "name" : "capacity" + } + }, + "args" : [ ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 19, 5, 24, 34 ], + "name" : { + "kind" : "Identifier", + "location" : [ 19, 9, 19, 14 ], + "name" : "append" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 19, 16, 19, 28 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 19, 16, 19, 19 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 19, 21, 19, 28 ], + "className" : "Vector" + } + }, { + "kind" : "TypedVar", + "location" : [ 19, 31, 19, 39 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 19, 31, 19, 34 ], + "name" : "item" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 19, 37, 19, 39 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 19, 45, 19, 50 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 20, 9, 23, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 20, 12, 20, 39 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 20, 12, 20, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 20, 12, 20, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 20, 17, 20, 20 ], + "name" : "size" + } + }, + "operator" : "==", + "right" : { + "kind" : "MethodCallExpr", + "location" : [ 20, 25, 20, 39 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 20, 25, 20, 37 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 20, 25, 20, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 20, 30, 20, 37 ], + "name" : "capacity" + } + }, + "args" : [ ] + } + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 21, 13, 21, 36 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 21, 13, 21, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 21, 13, 21, 34 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 21, 13, 21, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 21, 18, 21, 34 ], + "name" : "increase_capacity" + } + }, + "args" : [ ] + } + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 23, 9, 23, 36 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 23, 9, 23, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "MemberExpr", + "location" : [ 23, 9, 23, 18 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 23, 9, 23, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 23, 14, 23, 18 ], + "name" : "items" + } + }, + "index" : { + "kind" : "MemberExpr", + "location" : [ 23, 20, 23, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 23, 20, 23, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 23, 25, 23, 28 ], + "name" : "size" + } + } + } ], + "value" : { + "kind" : "Identifier", + "location" : [ 23, 33, 23, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "item" + } + }, { + "kind" : "AssignStmt", + "location" : [ 24, 9, 24, 33 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 24, 9, 24, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 24, 9, 24, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 24, 14, 24, 17 ], + "name" : "size" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 24, 21, 24, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 24, 21, 24, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 24, 21, 24, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 24, 26, 24, 29 ], + "name" : "size" + } + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 24, 33, 24, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 27, 5, 33, 4 ], + "name" : { + "kind" : "Identifier", + "location" : [ 27, 9, 27, 18 ], + "name" : "append_all" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 27, 20, 27, 32 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 27, 20, 27, 23 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 27, 25, 27, 32 ], + "className" : "Vector" + } + }, { + "kind" : "TypedVar", + "location" : [ 27, 35, 27, 50 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 27, 35, 27, 43 ], + "name" : "new_items" + }, + "type" : { + "kind" : "ListType", + "location" : [ 27, 46, 27, 50 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 27, 47, 27, 49 ], + "className" : "int" + } + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 27, 56, 27, 61 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 28, 9, 28, 20 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 28, 9, 28, 16 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 28, 9, 28, 12 ], + "name" : "item" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 28, 14, 28, 16 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 28, 20, 28, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 29, 9, 33, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 29, 13, 29, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "item" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 29, 21, 29, 29 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "new_items" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 30, 13, 30, 29 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 30, 13, 30, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 30, 13, 30, 23 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 30, 13, 30, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 30, 18, 30, 23 ], + "name" : "append" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 30, 25, 30, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "item" + } ] + } + } ] + } ] + }, { + "kind" : "FuncDef", + "location" : [ 33, 5, 41, 34 ], + "name" : { + "kind" : "Identifier", + "location" : [ 33, 9, 33, 17 ], + "name" : "remove_at" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 33, 19, 33, 31 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 33, 19, 33, 22 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 33, 24, 33, 31 ], + "className" : "Vector" + } + }, { + "kind" : "TypedVar", + "location" : [ 33, 34, 33, 41 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 33, 34, 33, 36 ], + "name" : "idx" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 33, 39, 33, 41 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 33, 47, 33, 52 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 34, 9, 37, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 34, 12, 34, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 34, 12, 34, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + }, + "operator" : "<", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 34, 18, 34, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 35, 13, 35, 18 ], + "value" : null + } ], + "elseBody" : [ ] + }, { + "kind" : "WhileStmt", + "location" : [ 37, 9, 41, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 37, 15, 37, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 37, 15, 37, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + }, + "operator" : "<", + "right" : { + "kind" : "BinaryExpr", + "location" : [ 37, 21, 37, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 37, 21, 37, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 37, 21, 37, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 37, 26, 37, 29 ], + "name" : "size" + } + }, + "operator" : "-", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 37, 33, 37, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 38, 13, 38, 49 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 38, 13, 38, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "MemberExpr", + "location" : [ 38, 13, 38, 22 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 38, 13, 38, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 38, 18, 38, 22 ], + "name" : "items" + } + }, + "index" : { + "kind" : "Identifier", + "location" : [ 38, 24, 38, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + } + } ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 38, 31, 38, 49 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "MemberExpr", + "location" : [ 38, 31, 38, 40 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 38, 31, 38, 34 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 38, 36, 38, 40 ], + "name" : "items" + } + }, + "index" : { + "kind" : "BinaryExpr", + "location" : [ 38, 42, 38, 48 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 38, 42, 38, 44 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 38, 48, 38, 48 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } + }, { + "kind" : "AssignStmt", + "location" : [ 39, 13, 39, 25 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 39, 13, 39, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 39, 19, 39, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 39, 19, 39, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 39, 25, 39, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "AssignStmt", + "location" : [ 41, 9, 41, 33 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 41, 9, 41, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 41, 9, 41, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 41, 14, 41, 17 ], + "name" : "size" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 41, 21, 41, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 41, 21, 41, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 41, 21, 41, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 41, 26, 41, 29 ], + "name" : "size" + } + }, + "operator" : "-", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 41, 33, 41, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 44, 5, 45, 31 ], + "name" : { + "kind" : "Identifier", + "location" : [ 44, 9, 44, 11 ], + "name" : "get" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 44, 13, 44, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 44, 13, 44, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 44, 18, 44, 25 ], + "className" : "Vector" + } + }, { + "kind" : "TypedVar", + "location" : [ 44, 28, 44, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 44, 28, 44, 30 ], + "name" : "idx" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 44, 33, 44, 35 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 44, 41, 44, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 45, 9, 45, 30 ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 45, 16, 45, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "MemberExpr", + "location" : [ 45, 16, 45, 25 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 45, 16, 45, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 45, 21, 45, 25 ], + "name" : "items" + } + }, + "index" : { + "kind" : "Identifier", + "location" : [ 45, 27, 45, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "idx" + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 48, 5, 49, 25 ], + "name" : { + "kind" : "Identifier", + "location" : [ 48, 9, 48, 14 ], + "name" : "length" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 48, 16, 48, 28 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 48, 16, 48, 19 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 48, 21, 48, 28 ], + "className" : "Vector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 48, 34, 48, 36 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 49, 9, 49, 24 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 49, 16, 49, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 49, 16, 49, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 49, 21, 49, 24 ], + "name" : "size" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 52, 1, 66, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 52, 7, 52, 20 ], + "name" : "DoublingVector" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 52, 22, 52, 27 ], + "name" : "Vector" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 53, 5, 53, 29 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 53, 5, 53, 22 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 53, 5, 53, 18 ], + "name" : "doubling_limit" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 53, 20, 53, 22 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 53, 26, 53, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1000 + } + }, { + "kind" : "FuncDef", + "location" : [ 56, 5, 63, 31 ], + "name" : { + "kind" : "Identifier", + "location" : [ 56, 9, 56, 25 ], + "name" : "increase_capacity" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 56, 27, 56, 47 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 56, 27, 56, 30 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 56, 32, 56, 47 ], + "className" : "DoublingVector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 56, 53, 56, 55 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 57, 9, 63, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 57, 13, 57, 55 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MethodCallExpr", + "location" : [ 57, 13, 57, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 57, 13, 57, 25 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 57, 13, 57, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 57, 18, 57, 25 ], + "name" : "capacity" + } + }, + "args" : [ ] + }, + "operator" : "<=", + "right" : { + "kind" : "BinaryExpr", + "location" : [ 57, 32, 57, 55 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 57, 32, 57, 50 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 57, 32, 57, 35 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 57, 37, 57, 50 ], + "name" : "doubling_limit" + } + }, + "operator" : "//", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 57, 55, 57, 55 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 58, 13, 58, 48 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 58, 13, 58, 22 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 58, 13, 58, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 58, 18, 58, 22 ], + "name" : "items" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 58, 26, 58, 48 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 58, 26, 58, 35 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 58, 26, 58, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 58, 31, 58, 35 ], + "name" : "items" + } + }, + "operator" : "+", + "right" : { + "kind" : "MemberExpr", + "location" : [ 58, 39, 58, 48 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 58, 39, 58, 42 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 58, 44, 58, 48 ], + "name" : "items" + } + } + } + } ], + "elseBody" : [ { + "kind" : "AssignStmt", + "location" : [ 62, 13, 62, 41 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 62, 13, 62, 22 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 62, 13, 62, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 62, 18, 62, 22 ], + "name" : "items" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 62, 26, 62, 41 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 62, 26, 62, 35 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 62, 26, 62, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 62, 31, 62, 35 ], + "name" : "items" + } + }, + "operator" : "+", + "right" : { + "kind" : "ListExpr", + "location" : [ 62, 39, 62, 41 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 62, 40, 62, 40 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } ] + } + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 63, 9, 63, 30 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 63, 16, 63, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 63, 16, 63, 28 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 63, 16, 63, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 63, 21, 63, 28 ], + "name" : "capacity" + } + }, + "args" : [ ] + } + } ] + } ] + }, { + "kind" : "FuncDef", + "location" : [ 66, 1, 74, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 66, 5, 66, 10 ], + "name" : "vrange" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 66, 12, 66, 16 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 66, 12, 66, 12 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 66, 14, 66, 16 ], + "className" : "int" + } + }, { + "kind" : "TypedVar", + "location" : [ 66, 19, 66, 23 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 66, 19, 66, 19 ], + "name" : "j" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 66, 21, 66, 23 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 66, 29, 66, 34 ], + "className" : "Vector" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 67, 5, 67, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 67, 5, 67, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 67, 5, 67, 5 ], + "name" : "v" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 67, 7, 67, 12 ], + "className" : "Vector" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 67, 16, 67, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 68, 5, 68, 24 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 68, 5, 68, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 68, 9, 68, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "DoublingVector" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 68, 9, 68, 22 ], + "name" : "DoublingVector" + }, + "args" : [ ] + } + }, { + "kind" : "WhileStmt", + "location" : [ 70, 5, 74, 4 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 70, 11, 70, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 70, 11, 70, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "Identifier", + "location" : [ 70, 15, 70, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 71, 9, 71, 19 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 71, 9, 71, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 71, 9, 71, 16 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 71, 9, 71, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 71, 11, 71, 16 ], + "name" : "append" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 71, 18, 71, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 72, 9, 72, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 72, 9, 72, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 72, 13, 72, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 72, 13, 72, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 72, 17, 72, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 74, 5, 74, 12 ], + "value" : { + "kind" : "Identifier", + "location" : [ 74, 12, 74, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 77, 1, 93, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 77, 5, 77, 9 ], + "name" : "sieve" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 77, 11, 77, 18 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 77, 11, 77, 11 ], + "name" : "v" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 77, 13, 77, 18 ], + "className" : "Vector" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 77, 24, 77, 29 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 78, 5, 78, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 78, 5, 78, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 78, 5, 78, 5 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 78, 7, 78, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 78, 13, 78, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 79, 5, 79, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 79, 5, 79, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 79, 5, 79, 5 ], + "name" : "j" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 79, 7, 79, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 79, 13, 79, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 80, 5, 80, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 80, 5, 80, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 80, 5, 80, 5 ], + "name" : "k" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 80, 7, 80, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 80, 13, 80, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 82, 5, 93, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 82, 11, 82, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 82, 11, 82, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "MethodCallExpr", + "location" : [ 82, 15, 82, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 82, 15, 82, 22 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 82, 15, 82, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 82, 17, 82, 22 ], + "name" : "length" + } + }, + "args" : [ ] + } + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 83, 9, 83, 20 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 83, 9, 83, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "k" + } ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 83, 13, 83, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 83, 13, 83, 17 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 83, 13, 83, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 83, 15, 83, 17 ], + "name" : "get" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 83, 19, 83, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 84, 9, 84, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 84, 9, 84, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 84, 13, 84, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 84, 13, 84, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 84, 17, 84, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + }, { + "kind" : "WhileStmt", + "location" : [ 85, 9, 90, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 85, 15, 85, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 85, 15, 85, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + }, + "operator" : "<", + "right" : { + "kind" : "MethodCallExpr", + "location" : [ 85, 19, 85, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 85, 19, 85, 26 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 85, 19, 85, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 85, 21, 85, 26 ], + "name" : "length" + } + }, + "args" : [ ] + } + }, + "body" : [ { + "kind" : "IfStmt", + "location" : [ 86, 13, 90, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 86, 16, 86, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 86, 16, 86, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MethodCallExpr", + "location" : [ 86, 16, 86, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 86, 16, 86, 20 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 86, 16, 86, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 86, 18, 86, 20 ], + "name" : "get" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 86, 22, 86, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + } ] + }, + "operator" : "%", + "right" : { + "kind" : "Identifier", + "location" : [ 86, 27, 86, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "k" + } + }, + "operator" : "==", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 86, 32, 86, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 87, 17, 87, 30 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 87, 17, 87, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 87, 17, 87, 27 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 87, 17, 87, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 87, 19, 87, 27 ], + "name" : "remove_at" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 87, 29, 87, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + } ] + } + } ], + "elseBody" : [ { + "kind" : "AssignStmt", + "location" : [ 89, 17, 89, 25 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 89, 17, 89, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 89, 21, 89, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 89, 21, 89, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "j" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 89, 25, 89, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ] + }, { + "kind" : "AssignStmt", + "location" : [ 90, 9, 90, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 90, 9, 90, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 90, 13, 90, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 90, 13, 90, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 90, 17, 90, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 93, 1, 93, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 93, 1, 93, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 93, 1, 93, 1 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 93, 3, 93, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 93, 9, 93, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 50 + } + }, { + "kind" : "VarDef", + "location" : [ 96, 1, 96, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 96, 1, 96, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 96, 1, 96, 1 ], + "name" : "v" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 96, 3, 96, 8 ], + "className" : "Vector" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 96, 12, 96, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 97, 1, 97, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 97, 1, 97, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 97, 1, 97, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 97, 3, 97, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 97, 9, 97, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 100, 1, 100, 16 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 100, 1, 100, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 100, 5, 100, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 100, 5, 100, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "Vector" + } + }, + "name" : "vrange" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 100, 12, 100, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "Identifier", + "location" : [ 100, 15, 100, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 101, 1, 101, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 101, 1, 101, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 101, 1, 101, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "sieve" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 101, 7, 101, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + } ] + } + }, { + "kind" : "WhileStmt", + "location" : [ 104, 1, 108, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 104, 7, 104, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 104, 7, 104, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "MethodCallExpr", + "location" : [ 104, 11, 104, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 104, 11, 104, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 104, 11, 104, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 104, 13, 104, 18 ], + "name" : "length" + } + }, + "args" : [ ] + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 105, 5, 105, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 105, 5, 105, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 105, 5, 105, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 105, 11, 105, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 105, 11, 105, 15 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Vector" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 105, 11, 105, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Vector" + }, + "name" : "v" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 105, 13, 105, 15 ], + "name" : "get" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 105, 17, 105, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 106, 5, 106, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 106, 5, 106, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 106, 9, 106, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 106, 9, 106, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 106, 13, 106, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/benchmarks/sieve.py.ast.typed.s.result b/pa3-tests/benchmarks/sieve.py.ast.typed.s.result new file mode 100644 index 0000000..6beaeaa --- /dev/null +++ b/pa3-tests/benchmarks/sieve.py.ast.typed.s.result @@ -0,0 +1,15 @@ +2 +3 +5 +7 +11 +13 +17 +19 +23 +29 +31 +37 +41 +43 +47 diff --git a/pa3-tests/benchmarks/stdlib.py b/pa3-tests/benchmarks/stdlib.py new file mode 100644 index 0000000..e7323bd --- /dev/null +++ b/pa3-tests/benchmarks/stdlib.py @@ -0,0 +1,77 @@ +# ChocoPy library functions +def int_to_str(x: int) -> str: + digits:[str] = None + result:str = "" + + # Set-up digit mapping + digits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] + + # Write sign if necessary + if x < 0: + result = "-" + x = -x + + # Write digits using a recursive call + if x >= 10: + result = result + int_to_str(x // 10) + result = result + digits[x % 10] + return result + +def str_to_int(x: str) -> int: + result:int = 0 + digit:int = 0 + char:str = "" + sign:int = 1 + first_char:bool = True + + # Parse digits + for char in x: + if char == "-": + if not first_char: + return 0 # Error + sign = -1 + elif char == "0": + digit = 0 + elif char == "1": + digit = 1 + elif char == "2": + digit = 2 + elif char == "3": + digit = 3 + elif char == "3": + digit = 3 + elif char == "4": + digit = 4 + elif char == "5": + digit = 5 + elif char == "6": + digit = 6 + elif char == "7": + digit = 7 + elif char == "8": + digit = 8 + elif char == "9": + digit = 9 + else: + return 0 # On error + first_char = False + result = result * 10 + digit + + # Compute result + return result * sign + +# Input parameters +c:int = 42 +n:int = 10 + +# Run [-nc, nc] with step size c +s:str = "" +i:int = 0 +i = -n * c + +# Crunch +while i <= n * c: + s = int_to_str(i) + print(s) + i = str_to_int(s) + c + diff --git a/pa3-tests/benchmarks/stdlib.py.ast.typed b/pa3-tests/benchmarks/stdlib.py.ast.typed new file mode 100644 index 0000000..72079ff --- /dev/null +++ b/pa3-tests/benchmarks/stdlib.py.ast.typed @@ -0,0 +1,1813 @@ +{ + "kind" : "Program", + "location" : [ 2, 1, 78, 1 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 2, 1, 18, 18 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 14 ], + "name" : "int_to_str" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 16, 2, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 16, 2, 16 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 19, 2, 21 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 27, 2, 29 ], + "className" : "str" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 23 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 16 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 10 ], + "name" : "digits" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 12, 3, 16 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 13, 3, 15 ], + "className" : "str" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 20, 3, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 4, 5, 4, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 5, 4, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 10 ], + "name" : "result" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 12, 4, 14 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 4, 18, 4, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 5, 7, 63 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "digits" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 7, 14, 7, 63 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "elements" : [ { + "kind" : "StringLiteral", + "location" : [ 7, 15, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "0" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 20, 7, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "1" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 25, 7, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "2" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 30, 7, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "3" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 35, 7, 37 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "4" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 40, 7, 42 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "5" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 45, 7, 47 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "6" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 50, 7, 52 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "7" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 55, 7, 57 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "8" + }, { + "kind" : "StringLiteral", + "location" : [ 7, 60, 7, 62 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "9" + } ] + } + }, { + "kind" : "IfStmt", + "location" : [ 10, 5, 15, 4 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 10, 8, 10, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 10, 8, 10, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 10, 12, 10, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 11, 9, 11, 20 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + } ], + "value" : { + "kind" : "StringLiteral", + "location" : [ 11, 18, 11, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "-" + } + }, { + "kind" : "AssignStmt", + "location" : [ 12, 9, 12, 14 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 12, 9, 12, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ], + "value" : { + "kind" : "UnaryExpr", + "location" : [ 12, 13, 12, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "Identifier", + "location" : [ 12, 14, 12, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } + } ], + "elseBody" : [ ] + }, { + "kind" : "IfStmt", + "location" : [ 15, 5, 17, 4 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 15, 8, 15, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 15, 8, 15, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">=", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 15, 13, 15, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 16, 9, 16, 45 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 16, 18, 16, 45 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 16, 18, 16, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + }, + "operator" : "+", + "right" : { + "kind" : "CallExpr", + "location" : [ 16, 27, 16, 45 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 27, 16, 36 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "int_to_str" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 16, 38, 16, 44 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 16, 38, 16, 38 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "//", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 16, 43, 16, 44 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + } ] + } + } + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 17, 5, 17, 36 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 17, 5, 17, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 17, 14, 17, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 17, 14, 17, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + }, + "operator" : "+", + "right" : { + "kind" : "IndexExpr", + "location" : [ 17, 23, 17, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 17, 23, 17, 28 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "digits" + }, + "index" : { + "kind" : "BinaryExpr", + "location" : [ 17, 30, 17, 35 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 17, 30, 17, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "%", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 17, 34, 17, 35 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + } + } + } + }, { + "kind" : "ReturnStmt", + "location" : [ 18, 5, 18, 17 ], + "value" : { + "kind" : "Identifier", + "location" : [ 18, 12, 18, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "result" + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 20, 1, 61, 25 ], + "name" : { + "kind" : "Identifier", + "location" : [ 20, 5, 20, 14 ], + "name" : "str_to_int" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 20, 16, 20, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 20, 16, 20, 16 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 20, 19, 20, 21 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 20, 27, 20, 29 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 21, 5, 21, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 21, 5, 21, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 21, 5, 21, 10 ], + "name" : "result" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 21, 12, 21, 14 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 21, 18, 21, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 22, 5, 22, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 22, 5, 22, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 22, 5, 22, 9 ], + "name" : "digit" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 22, 11, 22, 13 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 22, 17, 22, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 23, 5, 23, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 23, 5, 23, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 23, 5, 23, 8 ], + "name" : "char" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 23, 10, 23, 12 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 23, 16, 23, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 24, 5, 24, 16 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 24, 5, 24, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 24, 5, 24, 8 ], + "name" : "sign" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 24, 10, 24, 12 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 24, 16, 24, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "VarDef", + "location" : [ 25, 5, 25, 26 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 25, 5, 25, 19 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 25, 5, 25, 14 ], + "name" : "first_char" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 25, 16, 25, 19 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 25, 23, 25, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 28, 5, 61, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 28, 9, 28, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 28, 17, 28, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "body" : [ { + "kind" : "IfStmt", + "location" : [ 29, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 29, 12, 29, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 29, 12, 29, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 29, 20, 29, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "-" + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 30, 13, 32, 12 ], + "condition" : { + "kind" : "UnaryExpr", + "location" : [ 30, 16, 30, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "operator" : "not", + "operand" : { + "kind" : "Identifier", + "location" : [ 30, 20, 30, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "name" : "first_char" + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 31, 17, 31, 24 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 31, 24, 31, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 32, 13, 32, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 32, 13, 32, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "sign" + } ], + "value" : { + "kind" : "UnaryExpr", + "location" : [ 32, 20, 32, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 32, 21, 32, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 33, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 33, 14, 33, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 33, 14, 33, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 33, 22, 33, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "0" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 34, 13, 34, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 34, 13, 34, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 34, 21, 34, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 35, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 35, 14, 35, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 35, 14, 35, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 35, 22, 35, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "1" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 36, 13, 36, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 36, 13, 36, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 36, 21, 36, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 37, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 37, 14, 37, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 37, 14, 37, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 37, 22, 37, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "2" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 38, 13, 38, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 38, 13, 38, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 38, 21, 38, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 39, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 39, 14, 39, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 39, 14, 39, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 39, 22, 39, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "3" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 40, 13, 40, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 40, 13, 40, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 40, 21, 40, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 41, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 41, 14, 41, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 41, 14, 41, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 41, 22, 41, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "3" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 42, 13, 42, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 42, 13, 42, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 42, 21, 42, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 43, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 43, 14, 43, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 43, 14, 43, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 43, 22, 43, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "4" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 44, 13, 44, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 44, 13, 44, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 44, 21, 44, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 45, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 45, 14, 45, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 45, 14, 45, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 45, 22, 45, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "5" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 46, 13, 46, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 46, 13, 46, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 46, 21, 46, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 5 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 47, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 47, 14, 47, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 47, 14, 47, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 47, 22, 47, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "6" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 48, 13, 48, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 48, 13, 48, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 48, 21, 48, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 49, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 49, 14, 49, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 49, 14, 49, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 49, 22, 49, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "7" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 50, 13, 50, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 50, 13, 50, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 50, 21, 50, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 7 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 51, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 51, 14, 51, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 51, 14, 51, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 51, 22, 51, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "8" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 52, 13, 52, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 52, 13, 52, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 52, 21, 52, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 8 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 53, 9, 57, 8 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 53, 14, 53, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 53, 14, 53, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "char" + }, + "operator" : "==", + "right" : { + "kind" : "StringLiteral", + "location" : [ 53, 22, 53, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "9" + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 54, 13, 54, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 54, 13, 54, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 54, 21, 54, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 9 + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 56, 13, 56, 20 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 56, 20, 56, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } ] + } ] + } ] + } ] + } ] + } ] + } ] + } ] + } ] + } ] + } ] + }, { + "kind" : "AssignStmt", + "location" : [ 57, 9, 57, 26 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 57, 9, 57, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "name" : "first_char" + } ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 57, 22, 57, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + }, { + "kind" : "AssignStmt", + "location" : [ 58, 9, 58, 36 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 58, 9, 58, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "result" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 58, 18, 58, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 58, 18, 58, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 58, 18, 58, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "result" + }, + "operator" : "*", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 58, 27, 58, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 58, 32, 58, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "digit" + } + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 61, 5, 61, 24 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 61, 12, 61, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 61, 12, 61, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "result" + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 61, 21, 61, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "sign" + } + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 64, 1, 64, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 64, 1, 64, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 64, 1, 64, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 64, 3, 64, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 64, 9, 64, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "VarDef", + "location" : [ 65, 1, 65, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 65, 1, 65, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 65, 1, 65, 1 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 65, 3, 65, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 65, 9, 65, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + }, { + "kind" : "VarDef", + "location" : [ 68, 1, 68, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 68, 1, 68, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 68, 1, 68, 1 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 68, 3, 68, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 68, 9, 68, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 69, 1, 69, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 69, 1, 69, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 69, 1, 69, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 69, 3, 69, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 69, 9, 69, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 70, 1, 70, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 70, 1, 70, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 70, 5, 70, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "UnaryExpr", + "location" : [ 70, 5, 70, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "Identifier", + "location" : [ 70, 6, 70, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 70, 10, 70, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "c" + } + } + }, { + "kind" : "WhileStmt", + "location" : [ 73, 1, 78, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 73, 7, 73, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 73, 7, 73, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<=", + "right" : { + "kind" : "BinaryExpr", + "location" : [ 73, 12, 73, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 73, 12, 73, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 73, 16, 73, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "c" + } + } + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 74, 5, 74, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 74, 5, 74, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 74, 9, 74, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 74, 9, 74, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "int_to_str" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 74, 20, 74, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 75, 5, 75, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 75, 5, 75, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 75, 5, 75, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 75, 11, 75, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 76, 5, 76, 25 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 76, 5, 76, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 76, 9, 76, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 76, 9, 76, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 76, 9, 76, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "str_to_int" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 76, 20, 76, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ] + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 76, 25, 76, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "c" + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/benchmarks/stdlib.py.ast.typed.s.result b/pa3-tests/benchmarks/stdlib.py.ast.typed.s.result new file mode 100644 index 0000000..3a07fa4 --- /dev/null +++ b/pa3-tests/benchmarks/stdlib.py.ast.typed.s.result @@ -0,0 +1,21 @@ +-420 +-378 +-336 +-294 +-252 +-210 +-168 +-126 +-84 +-42 +0 +42 +84 +126 +168 +210 +252 +294 +336 +378 +420 diff --git a/pa3-tests/benchmarks/tree.py b/pa3-tests/benchmarks/tree.py new file mode 100644 index 0000000..9f337fd --- /dev/null +++ b/pa3-tests/benchmarks/tree.py @@ -0,0 +1,83 @@ +# Binary-search trees +class TreeNode(object): + value:int = 0 + left:"TreeNode" = None + right:"TreeNode" = None + + def insert(self:"TreeNode", x:int) -> bool: + if x < self.value: + if self.left is None: + self.left = makeNode(x) + return True + else: + return self.left.insert(x) + elif x > self.value: + if self.right is None: + self.right = makeNode(x) + return True + else: + return self.right.insert(x) + return False + + def contains(self:"TreeNode", x:int) -> bool: + if x < self.value: + if self.left is None: + return False + else: + return self.left.contains(x) + elif x > self.value: + if self.right is None: + return False + else: + return self.right.contains(x) + else: + return True + +class Tree(object): + root:TreeNode = None + size:int = 0 + + def insert(self:"Tree", x:int) -> object: + if self.root is None: + self.root = makeNode(x) + self.size = 1 + else: + if self.root.insert(x): + self.size = self.size + 1 + + def contains(self:"Tree", x:int) -> bool: + if self.root is None: + return False + else: + return self.root.contains(x) + +def makeNode(x: int) -> TreeNode: + b:TreeNode = None + b = TreeNode() + b.value = x + return b + + +# Input parameters +n:int = 100 +c:int = 4 + +# Data +t:Tree = None +i:int = 0 +k:int = 37813 + +# Crunch +t = Tree() +while i < n: + t.insert(k) + k = (k * 37813) % 37831 + if i % c != 0: + t.insert(i) + i = i + 1 + +print(t.size) + +for i in [4, 8, 15, 16, 23, 42]: + if t.contains(i): + print(i) diff --git a/pa3-tests/benchmarks/tree.py.ast.typed b/pa3-tests/benchmarks/tree.py.ast.typed new file mode 100644 index 0000000..a8d3cb3 --- /dev/null +++ b/pa3-tests/benchmarks/tree.py.ast.typed @@ -0,0 +1,2301 @@ +{ + "kind" : "Program", + "location" : [ 2, 1, 84, 2 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 2, 1, 36, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 7, 2, 14 ], + "name" : "TreeNode" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 2, 16, 2, 21 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 2, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 2, 3, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 2, 3, 6 ], + "name" : "value" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 8, 3, 10 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 14, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 4, 2, 4, 23 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 2, 4, 16 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 2, 4, 5 ], + "name" : "left" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 7, 4, 16 ], + "className" : "TreeNode" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 4, 20, 4, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 5, 2, 5, 24 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 2, 5, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 2, 5, 6 ], + "name" : "right" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 8, 5, 17 ], + "className" : "TreeNode" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 5, 21, 5, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 2, 20, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 6, 7, 11 ], + "name" : "insert" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 13, 7, 27 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 18, 7, 27 ], + "className" : "TreeNode" + } + }, { + "kind" : "TypedVar", + "location" : [ 7, 30, 7, 34 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 30, 7, 30 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 32, 7, 34 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 40, 7, 43 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 8, 3, 20, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 8, 6, 8, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 6, 8, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "MemberExpr", + "location" : [ 8, 10, 8, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 8, 10, 8, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 8, 15, 8, 19 ], + "name" : "value" + } + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 9, 4, 14, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 9, 7, 9, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 9, 7, 9, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 9, 7, 9, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 9, 12, 9, 15 ], + "name" : "left" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 9, 20, 9, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 10, 5, 10, 27 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 10, 5, 10, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 10, 10, 10, 13 ], + "name" : "left" + } + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 10, 17, 10, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 17, 10, 24 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + } + }, + "name" : "makeNode" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 10, 26, 10, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 11, 5, 11, 15 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 11, 12, 11, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 13, 5, 13, 30 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 13, 12, 13, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 13, 12, 13, 27 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 13, 12, 13, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 13, 12, 13, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 13, 17, 13, 20 ], + "name" : "left" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 13, 22, 13, 27 ], + "name" : "insert" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 13, 29, 13, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 14, 3, 20, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 14, 8, 14, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 14, 8, 14, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">", + "right" : { + "kind" : "MemberExpr", + "location" : [ 14, 12, 14, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 12, 14, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 17, 14, 21 ], + "name" : "value" + } + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 15, 4, 20, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 15, 7, 15, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 15, 7, 15, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 12, 15, 16 ], + "name" : "right" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 15, 21, 15, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 16, 5, 16, 28 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 16, 5, 16, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 5, 16, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 10, 16, 14 ], + "name" : "right" + } + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 16, 18, 16, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 18, 16, 25 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + } + }, + "name" : "makeNode" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 16, 27, 16, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 17, 5, 17, 15 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 17, 12, 17, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 19, 5, 19, 31 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 19, 12, 19, 31 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 19, 12, 19, 28 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 19, 12, 19, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 19, 12, 19, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 19, 17, 19, 21 ], + "name" : "right" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 19, 23, 19, 28 ], + "name" : "insert" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 19, 30, 19, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "elseBody" : [ ] + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 20, 3, 20, 14 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 20, 10, 20, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 22, 2, 36, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 22, 6, 22, 13 ], + "name" : "contains" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 22, 15, 22, 29 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 22, 15, 22, 18 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 22, 20, 22, 29 ], + "className" : "TreeNode" + } + }, { + "kind" : "TypedVar", + "location" : [ 22, 32, 22, 36 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 22, 32, 22, 32 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 22, 34, 22, 36 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 22, 42, 22, 45 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 23, 3, 36, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 23, 6, 23, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 23, 6, 23, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "MemberExpr", + "location" : [ 23, 10, 23, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 23, 10, 23, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 23, 15, 23, 19 ], + "name" : "value" + } + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 24, 4, 28, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 24, 7, 24, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 24, 7, 24, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 24, 7, 24, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 24, 12, 24, 15 ], + "name" : "left" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 24, 20, 24, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 25, 5, 25, 16 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 25, 12, 25, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 27, 5, 27, 32 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 27, 12, 27, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 27, 12, 27, 29 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 27, 12, 27, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 27, 12, 27, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 27, 17, 27, 20 ], + "name" : "left" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 27, 22, 27, 29 ], + "name" : "contains" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 27, 31, 27, 31 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 28, 3, 36, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 28, 8, 28, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 28, 8, 28, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">", + "right" : { + "kind" : "MemberExpr", + "location" : [ 28, 12, 28, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 28, 12, 28, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 28, 17, 28, 21 ], + "name" : "value" + } + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 29, 4, 33, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 29, 7, 29, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 29, 7, 29, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 29, 7, 29, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 29, 12, 29, 16 ], + "name" : "right" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 29, 21, 29, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 30, 5, 30, 16 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 30, 12, 30, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 32, 5, 32, 33 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 32, 12, 32, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 32, 12, 32, 30 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 32, 12, 32, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 32, 12, 32, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 32, 17, 32, 21 ], + "name" : "right" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 32, 23, 32, 30 ], + "name" : "contains" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 32, 32, 32, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 34, 4, 34, 14 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 34, 11, 34, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + } ] + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 36, 1, 54, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 36, 7, 36, 10 ], + "name" : "Tree" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 36, 12, 36, 17 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 37, 2, 37, 21 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 37, 2, 37, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 37, 2, 37, 5 ], + "name" : "root" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 37, 7, 37, 14 ], + "className" : "TreeNode" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 37, 18, 37, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 38, 2, 38, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 38, 2, 38, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 38, 2, 38, 5 ], + "name" : "size" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 38, 7, 38, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 38, 13, 38, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "FuncDef", + "location" : [ 40, 2, 48, 1 ], + "name" : { + "kind" : "Identifier", + "location" : [ 40, 6, 40, 11 ], + "name" : "insert" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 40, 13, 40, 23 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 40, 13, 40, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 40, 18, 40, 23 ], + "className" : "Tree" + } + }, { + "kind" : "TypedVar", + "location" : [ 40, 26, 40, 30 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 40, 26, 40, 26 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 40, 28, 40, 30 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 40, 36, 40, 41 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 41, 3, 48, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 41, 6, 41, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 41, 6, 41, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 41, 6, 41, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 41, 11, 41, 14 ], + "name" : "root" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 41, 19, 41, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 42, 4, 42, 26 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 42, 4, 42, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 42, 4, 42, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 42, 9, 42, 12 ], + "name" : "root" + } + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 42, 16, 42, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 42, 16, 42, 23 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + } + }, + "name" : "makeNode" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 42, 25, 42, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 43, 4, 43, 16 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 43, 4, 43, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 43, 4, 43, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 43, 9, 43, 12 ], + "name" : "size" + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 43, 16, 43, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 45, 4, 48, 1 ], + "condition" : { + "kind" : "MethodCallExpr", + "location" : [ 45, 7, 45, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 45, 7, 45, 22 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 45, 7, 45, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 45, 7, 45, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 45, 12, 45, 15 ], + "name" : "root" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 45, 17, 45, 22 ], + "name" : "insert" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 45, 24, 45, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + }, + "thenBody" : [ { + "kind" : "AssignStmt", + "location" : [ 46, 5, 46, 29 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 46, 5, 46, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 46, 5, 46, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 46, 10, 46, 13 ], + "name" : "size" + } + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 46, 17, 46, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 46, 17, 46, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 46, 17, 46, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 46, 22, 46, 25 ], + "name" : "size" + } + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 46, 29, 46, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ], + "elseBody" : [ ] + } ] + } ] + }, { + "kind" : "FuncDef", + "location" : [ 48, 2, 54, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 48, 6, 48, 13 ], + "name" : "contains" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 48, 15, 48, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 48, 15, 48, 18 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 48, 20, 48, 25 ], + "className" : "Tree" + } + }, { + "kind" : "TypedVar", + "location" : [ 48, 28, 48, 32 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 48, 28, 48, 28 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 48, 30, 48, 32 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 48, 38, 48, 41 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 49, 3, 54, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 49, 6, 49, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "MemberExpr", + "location" : [ 49, 6, 49, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 49, 6, 49, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 49, 11, 49, 14 ], + "name" : "root" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 49, 19, 49, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 50, 4, 50, 15 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 50, 11, 50, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ], + "elseBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 52, 4, 52, 31 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 52, 11, 52, 31 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 52, 11, 52, 28 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "MemberExpr", + "location" : [ 52, 11, 52, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 52, 11, 52, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 52, 16, 52, 19 ], + "name" : "root" + } + }, + "member" : { + "kind" : "Identifier", + "location" : [ 52, 21, 52, 28 ], + "name" : "contains" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 52, 30, 52, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ] + } ] + }, { + "kind" : "FuncDef", + "location" : [ 54, 1, 58, 10 ], + "name" : { + "kind" : "Identifier", + "location" : [ 54, 5, 54, 12 ], + "name" : "makeNode" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 54, 14, 54, 19 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 54, 14, 54, 14 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 54, 17, 54, 19 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 54, 25, 54, 32 ], + "className" : "TreeNode" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 55, 2, 55, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 55, 2, 55, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 55, 2, 55, 2 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 55, 4, 55, 11 ], + "className" : "TreeNode" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 55, 15, 55, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 56, 2, 56, 15 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 56, 2, 56, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "b" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 56, 6, 56, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 56, 6, 56, 13 ], + "name" : "TreeNode" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 57, 2, 57, 12 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 57, 2, 57, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 57, 2, 57, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 57, 4, 57, 8 ], + "name" : "value" + } + } ], + "value" : { + "kind" : "Identifier", + "location" : [ 57, 12, 57, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + }, { + "kind" : "ReturnStmt", + "location" : [ 58, 2, 58, 9 ], + "value" : { + "kind" : "Identifier", + "location" : [ 58, 9, 58, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "TreeNode" + }, + "name" : "b" + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 62, 1, 62, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 62, 1, 62, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 62, 1, 62, 1 ], + "name" : "n" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 62, 3, 62, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 62, 9, 62, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 100 + } + }, { + "kind" : "VarDef", + "location" : [ 63, 1, 63, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 63, 1, 63, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 63, 1, 63, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 63, 3, 63, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 63, 9, 63, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + }, { + "kind" : "VarDef", + "location" : [ 66, 1, 66, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 66, 1, 66, 6 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 66, 1, 66, 1 ], + "name" : "t" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 66, 3, 66, 6 ], + "className" : "Tree" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 66, 10, 66, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 67, 1, 67, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 67, 1, 67, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 67, 1, 67, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 67, 3, 67, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 67, 9, 67, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 68, 1, 68, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 68, 1, 68, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 68, 1, 68, 1 ], + "name" : "k" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 68, 3, 68, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 68, 9, 68, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 37813 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 71, 1, 71, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 71, 1, 71, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "t" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 71, 5, 71, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 71, 5, 71, 8 ], + "name" : "Tree" + }, + "args" : [ ] + } + }, { + "kind" : "WhileStmt", + "location" : [ 72, 1, 79, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 72, 7, 72, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 72, 7, 72, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "Identifier", + "location" : [ 72, 11, 72, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "n" + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 73, 2, 73, 12 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 73, 2, 73, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 73, 2, 73, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Tree" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 73, 2, 73, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "t" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 73, 4, 73, 9 ], + "name" : "insert" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 73, 11, 73, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "k" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 74, 2, 74, 24 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 74, 2, 74, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "k" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 74, 6, 74, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 74, 7, 74, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 74, 7, 74, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "k" + }, + "operator" : "*", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 74, 11, 74, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 37813 + } + }, + "operator" : "%", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 74, 20, 74, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 37831 + } + } + }, { + "kind" : "IfStmt", + "location" : [ 75, 2, 77, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 75, 5, 75, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 75, 5, 75, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 75, 5, 75, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "%", + "right" : { + "kind" : "Identifier", + "location" : [ 75, 9, 75, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "c" + } + }, + "operator" : "!=", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 75, 14, 75, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 76, 3, 76, 13 ], + "expr" : { + "kind" : "MethodCallExpr", + "location" : [ 76, 3, 76, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 76, 3, 76, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Tree" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 76, 3, 76, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "t" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 76, 5, 76, 10 ], + "name" : "insert" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 76, 12, 76, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } + } ], + "elseBody" : [ ] + }, { + "kind" : "AssignStmt", + "location" : [ 77, 2, 77, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 77, 2, 77, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 77, 6, 77, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 77, 6, 77, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 77, 10, 77, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + }, { + "kind" : "ExprStmt", + "location" : [ 79, 1, 79, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 79, 1, 79, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 79, 1, 79, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 79, 7, 79, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 79, 7, 79, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "t" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 79, 9, 79, 12 ], + "name" : "size" + } + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 81, 1, 84, 2 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 81, 5, 81, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "iterable" : { + "kind" : "ListExpr", + "location" : [ 81, 10, 81, 31 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 81, 11, 81, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + }, { + "kind" : "IntegerLiteral", + "location" : [ 81, 14, 81, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 8 + }, { + "kind" : "IntegerLiteral", + "location" : [ 81, 17, 81, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 15 + }, { + "kind" : "IntegerLiteral", + "location" : [ 81, 21, 81, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 16 + }, { + "kind" : "IntegerLiteral", + "location" : [ 81, 25, 81, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 23 + }, { + "kind" : "IntegerLiteral", + "location" : [ 81, 29, 81, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } ] + }, + "body" : [ { + "kind" : "IfStmt", + "location" : [ 82, 2, 84, 1 ], + "condition" : { + "kind" : "MethodCallExpr", + "location" : [ 82, 5, 82, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 82, 5, 82, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "Tree" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 82, 5, 82, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "Tree" + }, + "name" : "t" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 82, 7, 82, 14 ], + "name" : "contains" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 82, 16, 82, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 83, 3, 83, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 83, 3, 83, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 83, 3, 83, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 83, 9, 83, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ] + } + } ], + "elseBody" : [ ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/benchmarks/tree.py.ast.typed.s.result b/pa3-tests/benchmarks/tree.py.ast.typed.s.result new file mode 100644 index 0000000..bc9d65b --- /dev/null +++ b/pa3-tests/benchmarks/tree.py.ast.typed.s.result @@ -0,0 +1,4 @@ +175 +15 +23 +42 diff --git a/pa3-tests/chocopy-ref.jar b/pa3-tests/chocopy-ref.jar new file mode 100644 index 0000000000000000000000000000000000000000..d036a97163131d2eb06312e914f6c7029b03d9b0 GIT binary patch literal 144814 zcmafab97~Iwr!k>ZQHghw(UBxbz(ae+qO|LDz;OxQ?XewU;1|UyZ!6i@4hk49((We z*EjYz=UnSsYfU9ta0pls5Rfk*CE6Z}QLuOUI-hSwpBMV)B`>Zf%pk2G!6YxNAT1%T zs>UcU@kf4QTuzpO@fU(D1MSqrbb|`>JlpSmCq@~0dTIGzE)|U`4)juTQ&Q?z^7OKk zs?3XQ;G=xWW(P_Brja*nsDEHlRat3ON&0Bo4QN(0U{gGyJSl(b{nP_d`pa6H~s78rWWO zqFQPxm580Gan8ew3OyUraWn<`%TVZrF+We_h?E3<>iu=&VWkAAL8nv=8zH2|>IAfm zo~}oo>;q@`!QuG0-`?4xbEv`2)CQf*)cpFf+`5ya5AqfHOxFpGWW5_dbu$X&L^VVqB+JOSuKnMdTS*#Je}7tv&1s@kHV_ZT_dLoK-t zk|}9cl_W{Oi$rRJCuCIxc27DtX%Zy`w`@Ayt!8N@_0)Wy)-A_08vx{8cR4dG=4(m8 zz2`>09gl28F)^U~f6yslpeaVRdoFnyPUVmn%j$`X8jNJ|XG=97j~H~oSnJq0fxkXz zxVdQ2nlZD%6I)VwOgt!7ERVH0mx?xQx}?67^55iJs-WbHWs`$*;2509B-mL{J6uI9 zDm%!?58}1n+-|4tSZA3)#nzfX1FU5-_u)$B$55MmX^~te6&1HT3(`q32qrU48xjxB zz$k?RLvZ#I$i^SEKqckNPDDoi~)6_}|J30l*T@WxlYpvLvqZPR(7Y;JEl zD_`Y8tkK4?{03l<${i0|B4=@qGF;*U(ClQ9oUgv&BU!M*L)ThN{))$UR<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D^4l zjA%>i13Va50bqwWyFH(H7xK3*|8PV1#2XtSl)b;M5a|LU-yEo|?7R4XyAIHO+aj!^ z?Ibtgy5J~aPNX*`Q%?TB67PwyZr5nOM(P3a`|oLgtyCZ$y4xAut`d3;deU?a`fchr zPiX!}@N&DB)d+Yib5? ziRV7*uLG*v1?+BL?{-nMYa}gjz<8gq0)Lh`yDjVO+Dg~p%bq{L zf1A`loXOpb$?eSi*I4Y4Kd^t~>Ax-H?X>#WwETb2ZcO~&N%n7}Zs#YzMiq`-3-(Xc z{n^TIvv21!x@M2A-^KphgWPl7`gVquYhLWuzw+)mO1ga)>ow049^(He1_ADAm6d>g U@aubKz@I(9spX&nD+Sp91K_~}$N&HU literal 0 HcmV?d00001 diff --git a/pa3-tests/core/call.py b/pa3-tests/core/call.py new file mode 100644 index 0000000..6b9ba64 --- /dev/null +++ b/pa3-tests/core/call.py @@ -0,0 +1,17 @@ +def f() -> int: + print("start f") + g() + print("end f") + return 42 + + +def g() -> object: + print("start g") + h() + print("end g") + +def h() -> object: + print("start h") + print("end h") + +print(f()) diff --git a/pa3-tests/core/call.py.ast.typed b/pa3-tests/core/call.py.ast.typed new file mode 100644 index 0000000..dd6d3f1 --- /dev/null +++ b/pa3-tests/core/call.py.ast.typed @@ -0,0 +1,386 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 17, 11 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 5, 14 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 5 ], + "name" : "f" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 12, 1, 14 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 5, 2, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 5, 2, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 2, 11, 2, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "start f" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 3, 5, 3, 7 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 5, 3, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "g" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 5, 4, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 5, 4, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 4, 11, 4, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "end f" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 5, 5, 5, 13 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 12, 5, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 8, 1, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "g" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 8, 12, 8, 17 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 9, 5, 9, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 9, 5, 9, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 5, 9, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 9, 11, 9, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "start g" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 10, 5, 10, 7 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 10, 5, 10, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "h" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 11, 5, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 5, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 5, 11, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 11, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "end g" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 1, 15, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "name" : "h" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 12, 13, 17 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 14, 5, 14, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 5, 14, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 5, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 14, 11, 14, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "start h" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 5, 15, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 5, 15, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 5, 15, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 15, 11, 15, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "end h" + } ] + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 17, 1, 17, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 1, 17, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 17, 7, 17, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 7, 17, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/call.py.ast.typed.s.result b/pa3-tests/core/call.py.ast.typed.s.result new file mode 100644 index 0000000..ff1eea8 --- /dev/null +++ b/pa3-tests/core/call.py.ast.typed.s.result @@ -0,0 +1,7 @@ +start f +start g +start h +end h +end g +end f +42 diff --git a/pa3-tests/core/call_with_args.py b/pa3-tests/core/call_with_args.py new file mode 100644 index 0000000..bc9b16a --- /dev/null +++ b/pa3-tests/core/call_with_args.py @@ -0,0 +1,19 @@ +def f(x:int) -> int: + print("start f") + print(x) + g(1, x) + print("end f") + return x + + +def g(y:int, z:int) -> object: + print("start g") + print(y) + print(z) + h("h") + print("end g") + +def h(msg: str) -> object: + print(msg) + +print(f(4)) diff --git a/pa3-tests/core/call_with_args.py.ast.typed b/pa3-tests/core/call_with_args.py.ast.typed new file mode 100644 index 0000000..0ff917c --- /dev/null +++ b/pa3-tests/core/call_with_args.py.ast.typed @@ -0,0 +1,554 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 12 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 6, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 5 ], + "name" : "f" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 1, 7, 1, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 9, 1, 11 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 17, 1, 19 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 5, 2, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 5, 2, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 2, 11, 2, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "start f" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 3, 5, 3, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 5, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 3, 11, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 5, 4, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 5, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "g" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "Identifier", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 5, 5, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 5, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 5, 11, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "end f" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 6, 5, 6, 12 ], + "value" : { + "kind" : "Identifier", + "location" : [ 6, 12, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 9, 1, 14, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 9, 5, 9, 5 ], + "name" : "g" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 9, 7, 9, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 9, 7, 9, 7 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 9, 9, 9, 11 ], + "className" : "int" + } + }, { + "kind" : "TypedVar", + "location" : [ 9, 14, 9, 18 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 9, 14, 9, 14 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 9, 16, 9, 18 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 9, 24, 9, 29 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 10, 5, 10, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 10, 5, 10, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 10, 11, 10, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "start g" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 11, 5, 11, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 5, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 5, 11, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 11, 11, 11, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 12, 5, 12, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 5, 12, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 5, 12, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 12, 11, 12, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "z" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 5, 13, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 5, 13, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "h" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 13, 7, 13, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "h" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 5, 14, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 5, 14, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 5, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 14, 11, 14, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "end g" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 16, 1, 17, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 16, 5, 16, 5 ], + "name" : "h" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 16, 7, 16, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 9 ], + "name" : "msg" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 16, 12, 16, 14 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 16, 20, 16, 25 ], + "className" : "object" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 17, 5, 17, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 5, 17, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 5, 17, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 17, 11, 17, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "msg" + } ] + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 19, 7, 19, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 7, 19, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 19, 9, 19, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/call_with_args.py.ast.typed.s.result b/pa3-tests/core/call_with_args.py.ast.typed.s.result new file mode 100644 index 0000000..816ee29 --- /dev/null +++ b/pa3-tests/core/call_with_args.py.ast.typed.s.result @@ -0,0 +1,9 @@ +start f +4 +start g +1 +4 +h +end g +end f +4 diff --git a/pa3-tests/core/error_div_zero.py b/pa3-tests/core/error_div_zero.py new file mode 100644 index 0000000..f4481c6 --- /dev/null +++ b/pa3-tests/core/error_div_zero.py @@ -0,0 +1 @@ +print(42 // 0) diff --git a/pa3-tests/core/error_div_zero.py.ast.typed b/pa3-tests/core/error_div_zero.py.ast.typed new file mode 100644 index 0000000..c498a39 --- /dev/null +++ b/pa3-tests/core/error_div_zero.py.ast.typed @@ -0,0 +1,65 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 15 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + }, + "operator" : "//", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 13, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/error_div_zero.py.ast.typed.s.result b/pa3-tests/core/error_div_zero.py.ast.typed.s.result new file mode 100644 index 0000000..3233f6d --- /dev/null +++ b/pa3-tests/core/error_div_zero.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Division by zero +Exited with error code 2 diff --git a/pa3-tests/core/error_invalid_print.py b/pa3-tests/core/error_invalid_print.py new file mode 100644 index 0000000..ca057e5 --- /dev/null +++ b/pa3-tests/core/error_invalid_print.py @@ -0,0 +1 @@ +print(None) diff --git a/pa3-tests/core/error_invalid_print.py.ast.typed b/pa3-tests/core/error_invalid_print.py.ast.typed new file mode 100644 index 0000000..311e64a --- /dev/null +++ b/pa3-tests/core/error_invalid_print.py.ast.typed @@ -0,0 +1,46 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 12 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "NoneLiteral", + "location" : [ 1, 7, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/error_invalid_print.py.ast.typed.s.result b/pa3-tests/core/error_invalid_print.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/pa3-tests/core/error_invalid_print.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/pa3-tests/core/error_mod_zero.py b/pa3-tests/core/error_mod_zero.py new file mode 100644 index 0000000..09cfbef --- /dev/null +++ b/pa3-tests/core/error_mod_zero.py @@ -0,0 +1 @@ +print(42 % 0) diff --git a/pa3-tests/core/error_mod_zero.py.ast.typed b/pa3-tests/core/error_mod_zero.py.ast.typed new file mode 100644 index 0000000..371eb36 --- /dev/null +++ b/pa3-tests/core/error_mod_zero.py.ast.typed @@ -0,0 +1,65 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 14 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + }, + "operator" : "%", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 12, 1, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/error_mod_zero.py.ast.typed.s.result b/pa3-tests/core/error_mod_zero.py.ast.typed.s.result new file mode 100644 index 0000000..3233f6d --- /dev/null +++ b/pa3-tests/core/error_mod_zero.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Division by zero +Exited with error code 2 diff --git a/pa3-tests/core/expr_if.py b/pa3-tests/core/expr_if.py new file mode 100644 index 0000000..e0f0764 --- /dev/null +++ b/pa3-tests/core/expr_if.py @@ -0,0 +1,2 @@ +print(3 if True else 4) +print(3 if False else 4) diff --git a/pa3-tests/core/expr_if.py.ast.typed b/pa3-tests/core/expr_if.py.ast.typed new file mode 100644 index 0000000..3b06e26 --- /dev/null +++ b/pa3-tests/core/expr_if.py.ast.typed @@ -0,0 +1,135 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 2, 25 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 23 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IfExpr", + "location" : [ 1, 7, 1, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 1, 12, 1, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "thenExpr" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + }, + "elseExpr" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 22, 1, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 24 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IfExpr", + "location" : [ 2, 7, 2, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 2, 12, 2, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "thenExpr" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 7, 2, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + }, + "elseExpr" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 23, 2, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/expr_if.py.ast.typed.s.result b/pa3-tests/core/expr_if.py.ast.typed.s.result new file mode 100644 index 0000000..b944734 --- /dev/null +++ b/pa3-tests/core/expr_if.py.ast.typed.s.result @@ -0,0 +1,2 @@ +3 +4 diff --git a/pa3-tests/core/id_global.py b/pa3-tests/core/id_global.py new file mode 100644 index 0000000..d72c7d2 --- /dev/null +++ b/pa3-tests/core/id_global.py @@ -0,0 +1,2 @@ +x:int = 42 +print(x) diff --git a/pa3-tests/core/id_global.py.ast.typed b/pa3-tests/core/id_global.py.ast.typed new file mode 100644 index 0000000..9605936 --- /dev/null +++ b/pa3-tests/core/id_global.py.ast.typed @@ -0,0 +1,73 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 2, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 2, 7, 2, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/id_global.py.ast.typed.s.result b/pa3-tests/core/id_global.py.ast.typed.s.result new file mode 100644 index 0000000..d81cc07 --- /dev/null +++ b/pa3-tests/core/id_global.py.ast.typed.s.result @@ -0,0 +1 @@ +42 diff --git a/pa3-tests/core/id_local.py b/pa3-tests/core/id_local.py new file mode 100644 index 0000000..ff6dec8 --- /dev/null +++ b/pa3-tests/core/id_local.py @@ -0,0 +1,5 @@ +def f() -> int: + x:int = 1 + return x + +print(f()) diff --git a/pa3-tests/core/id_local.py.ast.typed b/pa3-tests/core/id_local.py.ast.typed new file mode 100644 index 0000000..472aa17 --- /dev/null +++ b/pa3-tests/core/id_local.py.ast.typed @@ -0,0 +1,114 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 5, 11 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 3, 11 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 5 ], + "name" : "f" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 12, 1, 14 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 3, 2, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 3, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 3, 2, 3 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 5, 2, 7 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 11, 2, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 3, 3, 3, 10 ], + "value" : { + "kind" : "Identifier", + "location" : [ 3, 10, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 5, 7, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/id_local.py.ast.typed.s.result b/pa3-tests/core/id_local.py.ast.typed.s.result new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/pa3-tests/core/id_local.py.ast.typed.s.result @@ -0,0 +1 @@ +1 diff --git a/pa3-tests/core/input.py b/pa3-tests/core/input.py new file mode 100644 index 0000000..a47c902 --- /dev/null +++ b/pa3-tests/core/input.py @@ -0,0 +1,8 @@ +# Test of 'input' function. + +s: str = "" + +s = input() +while len(s) > 0: + print(s) + s = input() diff --git a/pa3-tests/core/input.py.ast.in b/pa3-tests/core/input.py.ast.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/pa3-tests/core/input.py.ast.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/pa3-tests/core/input.py.ast.typed b/pa3-tests/core/input.py.ast.typed new file mode 100644 index 0000000..edf0a5d --- /dev/null +++ b/pa3-tests/core/input.py.ast.typed @@ -0,0 +1,196 @@ +{ + "kind" : "Program", + "location" : [ 3, 1, 9, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 6 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 4, 3, 6 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 10, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 5, 1, 5, 11 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 5, 5, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "input" + }, + "args" : [ ] + } + }, { + "kind" : "WhileStmt", + "location" : [ 6, 1, 9, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 6, 7, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 6, 7, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ] + }, + "operator" : ">", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 16, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 7, 5, 7, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 11, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 8, 5, 8, 15 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "input" + }, + "args" : [ ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/input.py.ast.typed.in b/pa3-tests/core/input.py.ast.typed.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/pa3-tests/core/input.py.ast.typed.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/pa3-tests/core/input.py.ast.typed.s.result b/pa3-tests/core/input.py.ast.typed.s.result new file mode 100644 index 0000000..86e7fe4 --- /dev/null +++ b/pa3-tests/core/input.py.ast.typed.s.result @@ -0,0 +1,8 @@ +First line. + +Next line is blank. + + + +Last line. + diff --git a/pa3-tests/core/input.py.in b/pa3-tests/core/input.py.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/pa3-tests/core/input.py.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/pa3-tests/core/len_invalid_1.py b/pa3-tests/core/len_invalid_1.py new file mode 100644 index 0000000..1dfa598 --- /dev/null +++ b/pa3-tests/core/len_invalid_1.py @@ -0,0 +1,3 @@ +x:[int] = None + +print(len(x)) diff --git a/pa3-tests/core/len_invalid_1.py.ast.typed b/pa3-tests/core/len_invalid_1.py.ast.typed new file mode 100644 index 0000000..170d7ee --- /dev/null +++ b/pa3-tests/core/len_invalid_1.py.ast.typed @@ -0,0 +1,103 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 3, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 3, 1, 3, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 1, 3, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 3, 7, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 7, 3, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 3, 11, 3, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/len_invalid_1.py.ast.typed.s.result b/pa3-tests/core/len_invalid_1.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/pa3-tests/core/len_invalid_1.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/pa3-tests/core/len_invalid_2.py b/pa3-tests/core/len_invalid_2.py new file mode 100644 index 0000000..de46502 --- /dev/null +++ b/pa3-tests/core/len_invalid_2.py @@ -0,0 +1,3 @@ +x:int = 1 + +print(len(x)) diff --git a/pa3-tests/core/len_invalid_2.py.ast.typed b/pa3-tests/core/len_invalid_2.py.ast.typed new file mode 100644 index 0000000..afc264d --- /dev/null +++ b/pa3-tests/core/len_invalid_2.py.ast.typed @@ -0,0 +1,97 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 3, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 3, 1, 3, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 1, 3, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 3, 7, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 7, 3, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 3, 11, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/len_invalid_2.py.ast.typed.s.result b/pa3-tests/core/len_invalid_2.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/pa3-tests/core/len_invalid_2.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/pa3-tests/core/list_concat.py b/pa3-tests/core/list_concat.py new file mode 100644 index 0000000..d2ef21d --- /dev/null +++ b/pa3-tests/core/list_concat.py @@ -0,0 +1,12 @@ +def concat(x:[int], y:[int]) -> [int]: + return x + y + +z:[int] = None +i:int = 0 + +z = concat([1,2,3], [4,5,6]) + +while i < len(z): + print(z[i]) + i = i + 1 + diff --git a/pa3-tests/core/list_concat.py.ast.typed b/pa3-tests/core/list_concat.py.ast.typed new file mode 100644 index 0000000..38ba198 --- /dev/null +++ b/pa3-tests/core/list_concat.py.ast.typed @@ -0,0 +1,437 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 13, 1 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 2, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 10 ], + "name" : "concat" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 1, 12, 1, 18 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 12, 1, 12 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 14, 1, 18 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 15, 1, 17 ], + "className" : "int" + } + } + }, { + "kind" : "TypedVar", + "location" : [ 1, 21, 1, 27 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 21, 1, 21 ], + "name" : "y" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 23, 1, 27 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 24, 1, 26 ], + "className" : "int" + } + } + } ], + "returnType" : { + "kind" : "ListType", + "location" : [ 1, 33, 1, 37 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 34, 1, 36 ], + "className" : "int" + } + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 2, 5, 2, 16 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 2, 12, 2, 16 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "Identifier", + "location" : [ 2, 12, 2, 12 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 2, 16, 2, 16 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "y" + } + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 4, 1, 4, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 1, 4, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 4, 3, 4, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 4, 4, 4, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 4, 11, 4, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 5, 1, 5, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 1, 5, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 3, 5, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 1, 7, 28 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 28 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } + }, + "name" : "concat" + }, + "args" : [ { + "kind" : "ListExpr", + "location" : [ 7, 12, 7, 18 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 15, 7, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 17, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + }, { + "kind" : "ListExpr", + "location" : [ 7, 21, 7, 27 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 7, 22, 7, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 24, 7, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 5 + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 26, 7, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + } ] + } ] + } + }, { + "kind" : "WhileStmt", + "location" : [ 9, 1, 13, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 9, 7, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 9, 7, 9, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "CallExpr", + "location" : [ 9, 11, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 11, 9, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 9, 15, 9, 15 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ] + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 10, 5, 10, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 10, 5, 10, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 10, 11, 10, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 10, 11, 10, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 10, 13, 10, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 11, 5, 11, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 11, 5, 11, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 11, 13, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_concat.py.ast.typed.s.result b/pa3-tests/core/list_concat.py.ast.typed.s.result new file mode 100644 index 0000000..b414108 --- /dev/null +++ b/pa3-tests/core/list_concat.py.ast.typed.s.result @@ -0,0 +1,6 @@ +1 +2 +3 +4 +5 +6 diff --git a/pa3-tests/core/list_concat_2.py b/pa3-tests/core/list_concat_2.py new file mode 100644 index 0000000..ed0826c --- /dev/null +++ b/pa3-tests/core/list_concat_2.py @@ -0,0 +1,8 @@ +z:[int] = None +i:int = 0 + +z = [1,2,3] + [4,5,6] + [7,8,9] + +while i < len(z): + print(z[i]) + i = i + 1 diff --git a/pa3-tests/core/list_concat_2.py.ast.typed b/pa3-tests/core/list_concat_2.py.ast.typed new file mode 100644 index 0000000..f5a28b0 --- /dev/null +++ b/pa3-tests/core/list_concat_2.py.ast.typed @@ -0,0 +1,366 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 31 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 4, 5, 4, 31 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 4, 5, 4, 21 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "ListExpr", + "location" : [ 4, 5, 4, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 6, 4, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 8, 4, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + }, + "operator" : "+", + "right" : { + "kind" : "ListExpr", + "location" : [ 4, 15, 4, 21 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 16, 4, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 18, 4, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 5 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 20, 4, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + } ] + } + }, + "operator" : "+", + "right" : { + "kind" : "ListExpr", + "location" : [ 4, 25, 4, 31 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 26, 4, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 7 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 28, 4, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 8 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 30, 4, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 9 + } ] + } + } + }, { + "kind" : "WhileStmt", + "location" : [ 6, 1, 9, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 6, 7, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "<", + "right" : { + "kind" : "CallExpr", + "location" : [ 6, 11, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 15, 6, 15 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ] + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 7, 5, 7, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 7, 11, 7, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 11, 7, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 8, 5, 8, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 8, 13, 8, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_concat_2.py.ast.typed.s.result b/pa3-tests/core/list_concat_2.py.ast.typed.s.result new file mode 100644 index 0000000..0719398 --- /dev/null +++ b/pa3-tests/core/list_concat_2.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/pa3-tests/core/list_concat_none.py b/pa3-tests/core/list_concat_none.py new file mode 100644 index 0000000..ad0a310 --- /dev/null +++ b/pa3-tests/core/list_concat_none.py @@ -0,0 +1,4 @@ +x:[int] = None +y:[int] = None + +print(len(x+y)) diff --git a/pa3-tests/core/list_concat_none.py.ast.typed b/pa3-tests/core/list_concat_none.py.ast.typed new file mode 100644 index 0000000..5c50b2a --- /dev/null +++ b/pa3-tests/core/list_concat_none.py.ast.typed @@ -0,0 +1,156 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 16 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 3, 2, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 4, 2, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 4, 7, 4, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 4, 11, 4, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "left" : { + "kind" : "Identifier", + "location" : [ 4, 11, 4, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "y" + } + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_concat_none.py.ast.typed.s.result b/pa3-tests/core/list_concat_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/pa3-tests/core/list_concat_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/list_get_element.py b/pa3-tests/core/list_get_element.py new file mode 100644 index 0000000..54a3835 --- /dev/null +++ b/pa3-tests/core/list_get_element.py @@ -0,0 +1,6 @@ +x:[int] = None + +x = [1, 2, 3] +print(x[0]) +print(x[1]) +print(x[2]) diff --git a/pa3-tests/core/list_get_element.py.ast.typed b/pa3-tests/core/list_get_element.py.ast.typed new file mode 100644 index 0000000..71a94cb --- /dev/null +++ b/pa3-tests/core/list_get_element.py.ast.typed @@ -0,0 +1,259 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 6, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 7, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 5, 7, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 6, 7, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 9, 6, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element.py.ast.typed.s.result b/pa3-tests/core/list_get_element.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/pa3-tests/core/list_get_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/pa3-tests/core/list_get_element_complex.py b/pa3-tests/core/list_get_element_complex.py new file mode 100644 index 0000000..fe03e8d --- /dev/null +++ b/pa3-tests/core/list_get_element_complex.py @@ -0,0 +1,11 @@ +next:int = 0 + +def next_int() -> int: + global next + next = next + 1 + return next + +def make_list() -> [int]: + return [next_int(), next_int(), next_int()] + +print(make_list()[next_int() - 3]) diff --git a/pa3-tests/core/list_get_element_complex.py.ast.typed b/pa3-tests/core/list_get_element_complex.py.ast.typed new file mode 100644 index 0000000..f3c48bb --- /dev/null +++ b/pa3-tests/core/list_get_element_complex.py.ast.typed @@ -0,0 +1,313 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 11, 35 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 12 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 4 ], + "name" : "next" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 6, 1, 8 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 12, 1, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "FuncDef", + "location" : [ 3, 1, 6, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 12 ], + "name" : "next_int" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 3, 19, 3, 21 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "GlobalDecl", + "location" : [ 4, 5, 4, 15 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 4, 12, 4, 15 ], + "name" : "next" + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 5, 5, 5, 19 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "next" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 5, 12, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "next" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 19, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + }, { + "kind" : "ReturnStmt", + "location" : [ 6, 5, 6, 15 ], + "value" : { + "kind" : "Identifier", + "location" : [ 6, 12, 6, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "next" + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 8, 1, 9, 48 ], + "name" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 13 ], + "name" : "make_list" + }, + "params" : [ ], + "returnType" : { + "kind" : "ListType", + "location" : [ 8, 20, 8, 24 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 8, 21, 8, 23 ], + "className" : "int" + } + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 5, 9, 47 ], + "value" : { + "kind" : "ListExpr", + "location" : [ 9, 12, 9, 47 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "CallExpr", + "location" : [ 9, 13, 9, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 13, 9, 20 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "next_int" + }, + "args" : [ ] + }, { + "kind" : "CallExpr", + "location" : [ 9, 25, 9, 34 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 25, 9, 32 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "next_int" + }, + "args" : [ ] + }, { + "kind" : "CallExpr", + "location" : [ 9, 37, 9, 46 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 37, 9, 44 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "next_int" + }, + "args" : [ ] + } ] + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 34 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 34 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 11, 7, 11, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "CallExpr", + "location" : [ 11, 7, 11, 17 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 7, 11, 15 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } + }, + "name" : "make_list" + }, + "args" : [ ] + }, + "index" : { + "kind" : "BinaryExpr", + "location" : [ 11, 19, 11, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 11, 19, 11, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 19, 11, 26 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "next_int" + }, + "args" : [ ] + }, + "operator" : "-", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 11, 32, 11, 32 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element_complex.py.ast.typed.s.result b/pa3-tests/core/list_get_element_complex.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/pa3-tests/core/list_get_element_complex.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/pa3-tests/core/list_get_element_none.py b/pa3-tests/core/list_get_element_none.py new file mode 100644 index 0000000..871b395 --- /dev/null +++ b/pa3-tests/core/list_get_element_none.py @@ -0,0 +1,3 @@ +x:[int] = None + +print(x[0]) diff --git a/pa3-tests/core/list_get_element_none.py.ast.typed b/pa3-tests/core/list_get_element_none.py.ast.typed new file mode 100644 index 0000000..a95c813 --- /dev/null +++ b/pa3-tests/core/list_get_element_none.py.ast.typed @@ -0,0 +1,96 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 3, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 3, 1, 3, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 1, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 3, 7, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 3, 7, 3, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element_none.py.ast.typed.s.result b/pa3-tests/core/list_get_element_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/pa3-tests/core/list_get_element_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/list_get_element_oob_1.py b/pa3-tests/core/list_get_element_oob_1.py new file mode 100644 index 0000000..7b0e490 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_1.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(x[-1]) diff --git a/pa3-tests/core/list_get_element_oob_1.py.ast.typed b/pa3-tests/core/list_get_element_oob_1.py.ast.typed new file mode 100644 index 0000000..c5e9254 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_1.py.ast.typed @@ -0,0 +1,156 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 13 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 7, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "UnaryExpr", + "location" : [ 4, 9, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element_oob_1.py.ast.typed.s.result b/pa3-tests/core/list_get_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_1.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/list_get_element_oob_2.py b/pa3-tests/core/list_get_element_oob_2.py new file mode 100644 index 0000000..ba070b2 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_2.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(x[3]) diff --git a/pa3-tests/core/list_get_element_oob_2.py.ast.typed b/pa3-tests/core/list_get_element_oob_2.py.ast.typed new file mode 100644 index 0000000..070d13b --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_2.py.ast.typed @@ -0,0 +1,147 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 7, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element_oob_2.py.ast.typed.s.result b/pa3-tests/core/list_get_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_2.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/list_get_element_oob_3.py b/pa3-tests/core/list_get_element_oob_3.py new file mode 100644 index 0000000..827aae5 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_3.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +print(x[0]) diff --git a/pa3-tests/core/list_get_element_oob_3.py.ast.typed b/pa3-tests/core/list_get_element_oob_3.py.ast.typed new file mode 100644 index 0000000..aaeb34f --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_3.py.ast.typed @@ -0,0 +1,120 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 6 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "elements" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 7, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_get_element_oob_3.py.ast.typed.s.result b/pa3-tests/core/list_get_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_get_element_oob_3.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/list_len.py b/pa3-tests/core/list_len.py new file mode 100644 index 0000000..95ba341 --- /dev/null +++ b/pa3-tests/core/list_len.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(len(x)) diff --git a/pa3-tests/core/list_len.py.ast.typed b/pa3-tests/core/list_len.py.ast.typed new file mode 100644 index 0000000..5a34893 --- /dev/null +++ b/pa3-tests/core/list_len.py.ast.typed @@ -0,0 +1,154 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 4, 7, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 4, 11, 4, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_len.py.ast.typed.s.result b/pa3-tests/core/list_len.py.ast.typed.s.result new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/pa3-tests/core/list_len.py.ast.typed.s.result @@ -0,0 +1 @@ +3 diff --git a/pa3-tests/core/list_len_empty.py b/pa3-tests/core/list_len_empty.py new file mode 100644 index 0000000..52bd178 --- /dev/null +++ b/pa3-tests/core/list_len_empty.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +print(len(x)) diff --git a/pa3-tests/core/list_len_empty.py.ast.typed b/pa3-tests/core/list_len_empty.py.ast.typed new file mode 100644 index 0000000..4b70475 --- /dev/null +++ b/pa3-tests/core/list_len_empty.py.ast.typed @@ -0,0 +1,127 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 6 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "elements" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 4, 7, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 4, 11, 4, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_len_empty.py.ast.typed.s.result b/pa3-tests/core/list_len_empty.py.ast.typed.s.result new file mode 100644 index 0000000..573541a --- /dev/null +++ b/pa3-tests/core/list_len_empty.py.ast.typed.s.result @@ -0,0 +1 @@ +0 diff --git a/pa3-tests/core/list_set_element.py b/pa3-tests/core/list_set_element.py new file mode 100644 index 0000000..c678fe9 --- /dev/null +++ b/pa3-tests/core/list_set_element.py @@ -0,0 +1,9 @@ +x:[int] = None + +x = [1, 2, 3] +x[0] = 4 +x[1] = 5 +x[2] = 6 +print(x[0]) +print(x[1]) +print(x[2]) diff --git a/pa3-tests/core/list_set_element.py.ast.typed b/pa3-tests/core/list_set_element.py.ast.typed new file mode 100644 index 0000000..69649ee --- /dev/null +++ b/pa3-tests/core/list_set_element.py.ast.typed @@ -0,0 +1,382 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 1, 4, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 3, 4, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 8, 4, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + }, { + "kind" : "AssignStmt", + "location" : [ 5, 1, 5, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 5, 1, 5, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 3, 5, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 8, 5, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 5 + } + }, { + "kind" : "AssignStmt", + "location" : [ 6, 1, 6, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 6, 1, 6, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 3, 6, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 8, 6, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + } + }, { + "kind" : "ExprStmt", + "location" : [ 7, 1, 7, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 1, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 7, 7, 7, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 7, 9, 7, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 8, 7, 8, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 8, 7, 8, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 8, 9, 8, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 9, 1, 9, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 9, 1, 9, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 1, 9, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 9, 7, 9, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 9, 7, 9, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 9, 9, 9, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_set_element.py.ast.typed.s.result b/pa3-tests/core/list_set_element.py.ast.typed.s.result new file mode 100644 index 0000000..4578bc1 --- /dev/null +++ b/pa3-tests/core/list_set_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +4 +5 +6 diff --git a/pa3-tests/core/list_set_element_none.py b/pa3-tests/core/list_set_element_none.py new file mode 100644 index 0000000..281c7b4 --- /dev/null +++ b/pa3-tests/core/list_set_element_none.py @@ -0,0 +1,4 @@ +x:[int] = None + +x[0] = 1 + diff --git a/pa3-tests/core/list_set_element_none.py.ast.typed b/pa3-tests/core/list_set_element_none.py.ast.typed new file mode 100644 index 0000000..fd16a97 --- /dev/null +++ b/pa3-tests/core/list_set_element_none.py.ast.typed @@ -0,0 +1,81 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 3, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 3, 1, 3, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 3, 3, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 8, 3, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_set_element_none.py.ast.typed.s.result b/pa3-tests/core/list_set_element_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/pa3-tests/core/list_set_element_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/list_set_element_oob_1.py b/pa3-tests/core/list_set_element_oob_1.py new file mode 100644 index 0000000..efd92ca --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_1.py @@ -0,0 +1,7 @@ +x:[int] = None + +x = [1, 2, 3] +x[-1] = 4 +print(x[0]) +print(x[1]) +print(x[2]) diff --git a/pa3-tests/core/list_set_element_oob_1.py.ast.typed b/pa3-tests/core/list_set_element_oob_1.py.ast.typed new file mode 100644 index 0000000..ed84b22 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_1.py.ast.typed @@ -0,0 +1,309 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 7, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 9 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "UnaryExpr", + "location" : [ 4, 3, 4, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 4, 4, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 5, 7, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 6, 7, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 9, 6, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 7, 1, 7, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 1, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 7, 7, 7, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 7, 9, 7, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_set_element_oob_1.py.ast.typed.s.result b/pa3-tests/core/list_set_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_1.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/list_set_element_oob_2.py b/pa3-tests/core/list_set_element_oob_2.py new file mode 100644 index 0000000..301cea1 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_2.py @@ -0,0 +1,7 @@ +x:[int] = None + +x = [1, 2, 3] +x[4] = 4 +print(x[0]) +print(x[1]) +print(x[2]) diff --git a/pa3-tests/core/list_set_element_oob_2.py.ast.typed b/pa3-tests/core/list_set_element_oob_2.py.ast.typed new file mode 100644 index 0000000..5c06dca --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_2.py.ast.typed @@ -0,0 +1,300 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 7, 12 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 3, 6, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 3, 12, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 1, 4, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 3, 4, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 8, 4, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 5, 7, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 6, 7, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 6, 9, 6, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 7, 1, 7, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 1, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IndexExpr", + "location" : [ 7, 7, 7, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 7, 9, 7, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_set_element_oob_2.py.ast.typed.s.result b/pa3-tests/core/list_set_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_2.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/list_set_element_oob_3.py b/pa3-tests/core/list_set_element_oob_3.py new file mode 100644 index 0000000..281c93c --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_3.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +x[0] = 4 diff --git a/pa3-tests/core/list_set_element_oob_3.py.ast.typed b/pa3-tests/core/list_set_element_oob_3.py.ast.typed new file mode 100644 index 0000000..ec34032 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_3.py.ast.typed @@ -0,0 +1,105 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 3, 1, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 1, 11, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 6 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 3, 5, 3, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "elements" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 8 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 4, 1, 4, 4 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "x" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 3, 4, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 8, 4, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/list_set_element_oob_3.py.ast.typed.s.result b/pa3-tests/core/list_set_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/list_set_element_oob_3.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/literal_bool.py b/pa3-tests/core/literal_bool.py new file mode 100644 index 0000000..54b7f1f --- /dev/null +++ b/pa3-tests/core/literal_bool.py @@ -0,0 +1,2 @@ +print(True) +print(False) diff --git a/pa3-tests/core/literal_bool.py.ast.typed b/pa3-tests/core/literal_bool.py.ast.typed new file mode 100644 index 0000000..436e5f7 --- /dev/null +++ b/pa3-tests/core/literal_bool.py.ast.typed @@ -0,0 +1,83 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 2, 13 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 11 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BooleanLiteral", + "location" : [ 1, 7, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BooleanLiteral", + "location" : [ 2, 7, 2, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/literal_bool.py.ast.typed.s.result b/pa3-tests/core/literal_bool.py.ast.typed.s.result new file mode 100644 index 0000000..1cc8b5e --- /dev/null +++ b/pa3-tests/core/literal_bool.py.ast.typed.s.result @@ -0,0 +1,2 @@ +True +False diff --git a/pa3-tests/core/literal_int.py b/pa3-tests/core/literal_int.py new file mode 100644 index 0000000..3e78541 --- /dev/null +++ b/pa3-tests/core/literal_int.py @@ -0,0 +1,2 @@ +print(42) +print(65999) diff --git a/pa3-tests/core/literal_int.py.ast.typed b/pa3-tests/core/literal_int.py.ast.typed new file mode 100644 index 0000000..eed7bda --- /dev/null +++ b/pa3-tests/core/literal_int.py.ast.typed @@ -0,0 +1,83 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 2, 13 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 9 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 2, 7, 2, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 65999 + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/literal_int.py.ast.typed.s.result b/pa3-tests/core/literal_int.py.ast.typed.s.result new file mode 100644 index 0000000..454025b --- /dev/null +++ b/pa3-tests/core/literal_int.py.ast.typed.s.result @@ -0,0 +1,2 @@ +42 +65999 diff --git a/pa3-tests/core/literal_str.py b/pa3-tests/core/literal_str.py new file mode 100644 index 0000000..ad35e5a --- /dev/null +++ b/pa3-tests/core/literal_str.py @@ -0,0 +1 @@ +print("Hello World") diff --git a/pa3-tests/core/literal_str.py.ast.typed b/pa3-tests/core/literal_str.py.ast.typed new file mode 100644 index 0000000..9b924a5 --- /dev/null +++ b/pa3-tests/core/literal_str.py.ast.typed @@ -0,0 +1,47 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 21 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 1, 7, 1, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Hello World" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/literal_str.py.ast.typed.s.result b/pa3-tests/core/literal_str.py.ast.typed.s.result new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/pa3-tests/core/literal_str.py.ast.typed.s.result @@ -0,0 +1 @@ +Hello World diff --git a/pa3-tests/core/nested.py b/pa3-tests/core/nested.py new file mode 100644 index 0000000..3faa85b --- /dev/null +++ b/pa3-tests/core/nested.py @@ -0,0 +1,11 @@ +g: int = 1 +def foo(x: int) -> int: + y: int = 2 + def bar() -> int: + z: int = 3 + def baz() -> int: + return y + return baz() + return bar() + +print(foo(g)) diff --git a/pa3-tests/core/nested.py.ast.typed b/pa3-tests/core/nested.py.ast.typed new file mode 100644 index 0000000..ecdc57d --- /dev/null +++ b/pa3-tests/core/nested.py.ast.typed @@ -0,0 +1,272 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 11, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 6 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "g" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 10, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "FuncDef", + "location" : [ 2, 1, 9, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 7 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 9, 2, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 9, 2, 9 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 12, 2, 14 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 20, 2, 22 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 8, 3, 10 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 14, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 8, 21 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "bar" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 9, 5, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 9, 5, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 9, 5, 9 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 12, 5, 14 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 18, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + }, { + "kind" : "FuncDef", + "location" : [ 6, 9, 7, 21 ], + "name" : { + "kind" : "Identifier", + "location" : [ 6, 13, 6, 15 ], + "name" : "baz" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 6, 22, 6, 24 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 7, 13, 7, 20 ], + "value" : { + "kind" : "Identifier", + "location" : [ 7, 20, 7, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 8, 9, 8, 20 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 8, 16, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 16, 8, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "baz" + }, + "args" : [ ] + } + } ] + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 5, 9, 16 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 9, 12, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 12, 9, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "bar" + }, + "args" : [ ] + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 11, 7, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 7, 11, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "foo" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 11, 11, 11, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "g" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/nested.py.ast.typed.s.result b/pa3-tests/core/nested.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/pa3-tests/core/nested.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/pa3-tests/core/nested2.py b/pa3-tests/core/nested2.py new file mode 100644 index 0000000..abafcce --- /dev/null +++ b/pa3-tests/core/nested2.py @@ -0,0 +1,14 @@ +g: int = 1 +def foo(x: int) -> int: + y: int = 2 + def bar() -> int: + z: int = 3 + def baz() -> int: + return qux(y) + return baz() + def qux(p: int) -> int: + return p + + return bar() + +print(foo(g)) diff --git a/pa3-tests/core/nested2.py.ast.typed b/pa3-tests/core/nested2.py.ast.typed new file mode 100644 index 0000000..8955e9f --- /dev/null +++ b/pa3-tests/core/nested2.py.ast.typed @@ -0,0 +1,337 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 14, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 6 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "g" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 4, 1, 6 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 10, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "FuncDef", + "location" : [ 2, 1, 12, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 7 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 9, 2, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 9, 2, 9 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 12, 2, 14 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 20, 2, 22 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 8, 3, 10 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 14, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 8, 21 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "bar" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 9, 5, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 9, 5, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 9, 5, 9 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 12, 5, 14 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 18, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } + }, { + "kind" : "FuncDef", + "location" : [ 6, 9, 7, 26 ], + "name" : { + "kind" : "Identifier", + "location" : [ 6, 13, 6, 15 ], + "name" : "baz" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 6, 22, 6, 24 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 7, 13, 7, 25 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 7, 20, 7, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 20, 7, 22 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "qux" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 24, 7, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } ] + } + } ] + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 8, 9, 8, 20 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 8, 16, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 16, 8, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "baz" + }, + "args" : [ ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 9, 5, 10, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 9, 9, 9, 11 ], + "name" : "qux" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 9, 13, 9, 18 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 9, 13, 9, 13 ], + "name" : "p" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 9, 16, 9, 18 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 9, 24, 9, 26 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 10, 9, 10, 16 ], + "value" : { + "kind" : "Identifier", + "location" : [ 10, 16, 10, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "p" + } + } ] + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 12, 5, 12, 16 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 12, 12, 12, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 12, 12, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "bar" + }, + "args" : [ ] + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 14, 7, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "foo" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 11, 14, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "g" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/nested2.py.ast.typed.s.result b/pa3-tests/core/nested2.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/pa3-tests/core/nested2.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/pa3-tests/core/object_attr_get.py b/pa3-tests/core/object_attr_get.py new file mode 100644 index 0000000..a6bed67 --- /dev/null +++ b/pa3-tests/core/object_attr_get.py @@ -0,0 +1,16 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + +a:A = None +b:B = None + +a = b = B() +print(a.a) +print(b.a) +print(b.b) diff --git a/pa3-tests/core/object_attr_get.py.ast.typed b/pa3-tests/core/object_attr_get.py.ast.typed new file mode 100644 index 0000000..f87f054 --- /dev/null +++ b/pa3-tests/core/object_attr_get.py.ast.typed @@ -0,0 +1,387 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 11 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 10, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 10, 1, 10, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 10, 1, 10, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 3, 10, 3 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 10, 7, 10, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 11, 1, 11, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 11, 1, 11, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 11, 3, 11, 3 ], + "className" : "B" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 1, 13, 11 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 13, 9, 13, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 9 ], + "name" : "B" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 15, 7, 15, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 9, 15, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 9 ], + "name" : "b" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_attr_get.py.ast.typed.s.result b/pa3-tests/core/object_attr_get.py.ast.typed.s.result new file mode 100644 index 0000000..79171bc --- /dev/null +++ b/pa3-tests/core/object_attr_get.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +42 +42 +True diff --git a/pa3-tests/core/object_attr_get_none.py b/pa3-tests/core/object_attr_get_none.py new file mode 100644 index 0000000..270bb16 --- /dev/null +++ b/pa3-tests/core/object_attr_get_none.py @@ -0,0 +1,16 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + +a:A = None +b:B = None + +a = B() +print(a.a) +print(b.a) +print(b.b) diff --git a/pa3-tests/core/object_attr_get_none.py.ast.typed b/pa3-tests/core/object_attr_get_none.py.ast.typed new file mode 100644 index 0000000..2787984 --- /dev/null +++ b/pa3-tests/core/object_attr_get_none.py.ast.typed @@ -0,0 +1,379 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 11 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 10, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 10, 1, 10, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 10, 1, 10, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 3, 10, 3 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 10, 7, 10, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 11, 1, 11, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 11, 1, 11, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 11, 3, 11, 3 ], + "className" : "B" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 1, 13, 7 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 13, 5, 13, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "name" : "B" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 15, 7, 15, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 9, 15, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 9 ], + "name" : "b" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_attr_get_none.py.ast.typed.s.result b/pa3-tests/core/object_attr_get_none.py.ast.typed.s.result new file mode 100644 index 0000000..80d81d1 --- /dev/null +++ b/pa3-tests/core/object_attr_get_none.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +42 +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/object_attr_set.py b/pa3-tests/core/object_attr_set.py new file mode 100644 index 0000000..4183999 --- /dev/null +++ b/pa3-tests/core/object_attr_set.py @@ -0,0 +1,18 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + +a:A = None +b:B = None + +a = b = B() +b.a = 1 +b.b = False +print(a.a) +print(b.a) +print(b.b) diff --git a/pa3-tests/core/object_attr_set.py.ast.typed b/pa3-tests/core/object_attr_set.py.ast.typed new file mode 100644 index 0000000..4ea6427 --- /dev/null +++ b/pa3-tests/core/object_attr_set.py.ast.typed @@ -0,0 +1,455 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 18, 11 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 10, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 10, 1, 10, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 10, 1, 10, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 3, 10, 3 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 10, 7, 10, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 11, 1, 11, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 11, 1, 11, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 11, 3, 11, 3 ], + "className" : "B" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 1, 13, 11 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 13, 9, 13, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 9 ], + "name" : "B" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 14, 1, 14, 7 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 1, 14, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 3, 14, 3 ], + "name" : "a" + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "AssignStmt", + "location" : [ 15, 1, 15, 11 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 15, 1, 15, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 3, 15, 3 ], + "name" : "b" + } + } ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 15, 7, 15, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 17, 1, 17, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 1, 17, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 17, 7, 17, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 17, 7, 17, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 17, 9, 17, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 18, 1, 18, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 1, 18, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 1, 18, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 18, 7, 18, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 18, 7, 18, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 18, 9, 18, 9 ], + "name" : "b" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_attr_set.py.ast.typed.s.result b/pa3-tests/core/object_attr_set.py.ast.typed.s.result new file mode 100644 index 0000000..abf1b17 --- /dev/null +++ b/pa3-tests/core/object_attr_set.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +1 +1 +False diff --git a/pa3-tests/core/object_attr_set_eval_order.py b/pa3-tests/core/object_attr_set_eval_order.py new file mode 100644 index 0000000..162559d --- /dev/null +++ b/pa3-tests/core/object_attr_set_eval_order.py @@ -0,0 +1,33 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + +a:A = None +b:B = None + +def get_b() -> B: + print("Getting B") + return b + +def get_one() -> int: + print("Getting 1") + return 1 + +def get_false() -> bool: + print("Getting False") + return False + +a = b = B() +get_b().a = get_one() +print("Assigned B.a") +get_b().b = get_false() +print("Assigned B.b") + +print(a.a) +print(b.a) +print(b.b) diff --git a/pa3-tests/core/object_attr_set_eval_order.py.ast.typed b/pa3-tests/core/object_attr_set_eval_order.py.ast.typed new file mode 100644 index 0000000..16ae244 --- /dev/null +++ b/pa3-tests/core/object_attr_set_eval_order.py.ast.typed @@ -0,0 +1,771 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 33, 11 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 10, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 10, 1, 10, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 10, 1, 10, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 3, 10, 3 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 10, 7, 10, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 11, 1, 11, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 11, 1, 11, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 11, 3, 11, 3 ], + "className" : "B" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "FuncDef", + "location" : [ 13, 1, 15, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 9 ], + "name" : "get_b" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 16, 13, 16 ], + "className" : "B" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 14, 5, 14, 22 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 5, 14, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 5, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 14, 11, 14, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Getting B" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 15, 5, 15, 12 ], + "value" : { + "kind" : "Identifier", + "location" : [ 15, 12, 15, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 17, 1, 19, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 17, 5, 17, 11 ], + "name" : "get_one" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 17, 18, 17, 20 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 18, 5, 18, 22 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 5, 18, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 5, 18, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 18, 11, 18, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Getting 1" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 19, 5, 19, 12 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 19, 12, 19, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 21, 1, 23, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 21, 5, 21, 13 ], + "name" : "get_false" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 21, 20, 21, 23 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 22, 5, 22, 26 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 22, 5, 22, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 22, 5, 22, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 22, 11, 22, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Getting False" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 23, 5, 23, 16 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 23, 12, 23, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 25, 1, 25, 11 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 25, 1, 25, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 25, 5, 25, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 25, 9, 25, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 25, 9, 25, 9 ], + "name" : "B" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 26, 1, 26, 21 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 26, 1, 26, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 26, 1, 26, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 26, 1, 26, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "B" + } + }, + "name" : "get_b" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 26, 9, 26, 9 ], + "name" : "a" + } + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 26, 13, 26, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 26, 13, 26, 19 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "get_one" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 27, 1, 27, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 27, 1, 27, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 27, 1, 27, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 27, 7, 27, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Assigned B.a" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 28, 1, 28, 23 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 28, 1, 28, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 28, 1, 28, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 28, 1, 28, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "B" + } + }, + "name" : "get_b" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 28, 9, 28, 9 ], + "name" : "b" + } + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 28, 13, 28, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 28, 13, 28, 21 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "get_false" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 29, 1, 29, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 29, 1, 29, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 29, 1, 29, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 29, 7, 29, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Assigned B.b" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 31, 1, 31, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 31, 1, 31, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 31, 1, 31, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 31, 7, 31, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 31, 7, 31, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 31, 9, 31, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 32, 1, 32, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 32, 1, 32, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 32, 1, 32, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 32, 7, 32, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 32, 7, 32, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 32, 9, 32, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 33, 1, 33, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 33, 1, 33, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 33, 1, 33, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 33, 7, 33, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 33, 7, 33, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 33, 9, 33, 9 ], + "name" : "b" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_attr_set_eval_order.py.ast.typed.s.result b/pa3-tests/core/object_attr_set_eval_order.py.ast.typed.s.result new file mode 100644 index 0000000..3f82dac --- /dev/null +++ b/pa3-tests/core/object_attr_set_eval_order.py.ast.typed.s.result @@ -0,0 +1,10 @@ +B +Getting 1 +Getting B +Assigned B.a +Getting False +Getting B +Assigned B.b +1 +1 +False diff --git a/pa3-tests/core/object_attr_set_none.py b/pa3-tests/core/object_attr_set_none.py new file mode 100644 index 0000000..bfd3184 --- /dev/null +++ b/pa3-tests/core/object_attr_set_none.py @@ -0,0 +1,19 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + +a:A = None +b:B = None + +a = B() +print(a.a) + +b.a = 1 +b.b = False +print(b.a) +print(b.b) diff --git a/pa3-tests/core/object_attr_set_none.py.ast.typed b/pa3-tests/core/object_attr_set_none.py.ast.typed new file mode 100644 index 0000000..e6f5695 --- /dev/null +++ b/pa3-tests/core/object_attr_set_none.py.ast.typed @@ -0,0 +1,447 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 11 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 10, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + }, { + "kind" : "VarDef", + "location" : [ 10, 1, 10, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 10, 1, 10, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 3, 10, 3 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 10, 7, 10, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 11, 1, 11, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 11, 1, 11, 3 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 11, 3, 11, 3 ], + "className" : "B" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 1, 13, 7 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 13, 5, 13, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 5 ], + "name" : "B" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 16, 1, 16, 7 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 16, 1, 16, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 3, 16, 3 ], + "name" : "a" + } + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 16, 7, 16, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + }, { + "kind" : "AssignStmt", + "location" : [ 17, 1, 17, 11 ], + "targets" : [ { + "kind" : "MemberExpr", + "location" : [ 17, 1, 17, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 17, 3, 17, 3 ], + "name" : "b" + } + } ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 17, 7, 17, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + }, { + "kind" : "ExprStmt", + "location" : [ 18, 1, 18, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 1, 18, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 1, 18, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 18, 7, 18, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 18, 7, 18, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 18, 9, 18, 9 ], + "name" : "a" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 19, 7, 19, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 19, 7, 19, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "b" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 19, 9, 19, 9 ], + "name" : "b" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_attr_set_none.py.ast.typed.s.result b/pa3-tests/core/object_attr_set_none.py.ast.typed.s.result new file mode 100644 index 0000000..80d81d1 --- /dev/null +++ b/pa3-tests/core/object_attr_set_none.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +42 +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/object_init.py b/pa3-tests/core/object_init.py new file mode 100644 index 0000000..e48a5cd --- /dev/null +++ b/pa3-tests/core/object_init.py @@ -0,0 +1,11 @@ +class A(object): + a:int = 42 + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + +B() diff --git a/pa3-tests/core/object_init.py.ast.typed b/pa3-tests/core/object_init.py.ast.typed new file mode 100644 index 0000000..1ed066e --- /dev/null +++ b/pa3-tests/core/object_init.py.ast.typed @@ -0,0 +1,173 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 11, 4 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "ClassDef", + "location" : [ 4, 1, 11, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 5, 5, 5, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 5, 5, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 7, 5, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 14, 5, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 5, 8, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 18, 7, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 23, 7, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 8, 15, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 3 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 3 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "name" : "B" + }, + "args" : [ ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_init.py.ast.typed.s.result b/pa3-tests/core/object_init.py.ast.typed.s.result new file mode 100644 index 0000000..223b783 --- /dev/null +++ b/pa3-tests/core/object_init.py.ast.typed.s.result @@ -0,0 +1 @@ +B diff --git a/pa3-tests/core/object_method.py b/pa3-tests/core/object_method.py new file mode 100644 index 0000000..6b71299 --- /dev/null +++ b/pa3-tests/core/object_method.py @@ -0,0 +1,16 @@ +class A(object): + a:int = 42 + + def foo(self:"A", ignore:object) -> int: + return self.a + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + def bar(self:"B") -> int: + return self.foo(self.b) + +print(B().bar()) diff --git a/pa3-tests/core/object_method.py.ast.typed b/pa3-tests/core/object_method.py.ast.typed new file mode 100644 index 0000000..955c83b --- /dev/null +++ b/pa3-tests/core/object_method.py.ast.typed @@ -0,0 +1,387 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 17 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 7, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 5, 22 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "A" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 23, 4, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 23, 4, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 41, 4, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 9, 5, 21 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 5, 16, 5, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 5, 16, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 5, 21, 5, 21 ], + "name" : "a" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 7, 1, 16, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 8, 5, 8, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 8, 5, 8, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 7, 8, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 14, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 27, 10, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 5, 14, 32 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 11 ], + "name" : "bar" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 13, 13, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 18, 13, 20 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 26, 13, 28 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 14, 9, 14, 31 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 14, 16, 14, 31 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 14, 16, 14, 23 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "A" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 16, 14, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 21, 14, 23 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 25, 14, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 25, 14, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 30, 14, 30 ], + "name" : "b" + } + } ] + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 16, 7, 16, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 16, 7, 16, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 7 ], + "name" : "B" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 16, 11, 16, 13 ], + "name" : "bar" + } + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_method.py.ast.typed.s.result b/pa3-tests/core/object_method.py.ast.typed.s.result new file mode 100644 index 0000000..418c69b --- /dev/null +++ b/pa3-tests/core/object_method.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +42 diff --git a/pa3-tests/core/object_method_complex_call.py b/pa3-tests/core/object_method_complex_call.py new file mode 100644 index 0000000..d82ec1b --- /dev/null +++ b/pa3-tests/core/object_method_complex_call.py @@ -0,0 +1,19 @@ +class A(object): + a:int = 42 + + def foo(self:"A", ignore:object) -> int: + return self.a + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + def bar(self:"B") -> int: + return self.foo(self.foo(print("..."))) + + def foo(self:"B", ignore:object) -> int: + return 1 + +print(B().bar()) diff --git a/pa3-tests/core/object_method_complex_call.py.ast.typed b/pa3-tests/core/object_method_complex_call.py.ast.typed new file mode 100644 index 0000000..270f634 --- /dev/null +++ b/pa3-tests/core/object_method_complex_call.py.ast.typed @@ -0,0 +1,492 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 17 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 7, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 5, 22 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "A" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 23, 4, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 23, 4, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 41, 4, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 9, 5, 21 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 5, 16, 5, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 5, 16, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 5, 21, 5, 21 ], + "name" : "a" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 7, 1, 19, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 8, 5, 8, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 8, 5, 8, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 7, 8, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 14, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 27, 10, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 5, 14, 48 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 11 ], + "name" : "bar" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 13, 13, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 18, 13, 20 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 26, 13, 28 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 14, 9, 14, 47 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 14, 16, 14, 47 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 14, 16, 14, 23 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 16, 14, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 21, 14, 23 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 14, 25, 14, 46 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 14, 25, 14, 32 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 25, 14, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 30, 14, 32 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 14, 34, 14, 45 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 34, 14, 38 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 14, 40, 14, 44 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "..." + } ] + } ] + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 16, 5, 17, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 16, 13, 16, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 16, 13, 16, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 16, 18, 16, 20 ], + "className" : "B" + } + }, { + "kind" : "TypedVar", + "location" : [ 16, 23, 16, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 16, 23, 16, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 16, 30, 16, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 16, 41, 16, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 17, 9, 17, 16 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 17, 16, 17, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 19, 7, 19, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 19, 7, 19, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 19, 7, 19, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 7, 19, 7 ], + "name" : "B" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 19, 11, 19, 13 ], + "name" : "bar" + } + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_method_complex_call.py.ast.typed.s.result b/pa3-tests/core/object_method_complex_call.py.ast.typed.s.result new file mode 100644 index 0000000..f83c3f1 --- /dev/null +++ b/pa3-tests/core/object_method_complex_call.py.ast.typed.s.result @@ -0,0 +1,3 @@ +B +... +1 diff --git a/pa3-tests/core/object_method_nested.py b/pa3-tests/core/object_method_nested.py new file mode 100644 index 0000000..b193ecd --- /dev/null +++ b/pa3-tests/core/object_method_nested.py @@ -0,0 +1,18 @@ +class A(object): + a:int = 42 + + def foo(self:"A", ignore:object) -> int: + return self.a + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + def bar(self:"B") -> int: + def qux(p: bool) -> int: + return self.foo(p) + return qux(True) + +print(B().bar()) diff --git a/pa3-tests/core/object_method_nested.py.ast.typed b/pa3-tests/core/object_method_nested.py.ast.typed new file mode 100644 index 0000000..5480892 --- /dev/null +++ b/pa3-tests/core/object_method_nested.py.ast.typed @@ -0,0 +1,439 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 18, 17 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 7, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 5, 22 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "A" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 23, 4, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 23, 4, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 41, 4, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 9, 5, 21 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 5, 16, 5, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 5, 16, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 5, 21, 5, 21 ], + "name" : "a" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 7, 1, 18, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 8, 5, 8, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 8, 5, 8, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 7, 8, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 14, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 27, 10, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 5, 16, 25 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 11 ], + "name" : "bar" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 13, 13, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 18, 13, 20 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 26, 13, 28 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 14, 9, 15, 31 ], + "name" : { + "kind" : "Identifier", + "location" : [ 14, 13, 14, 15 ], + "name" : "qux" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 14, 17, 14, 23 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 14, 17, 14, 17 ], + "name" : "p" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 14, 20, 14, 23 ], + "className" : "bool" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 14, 29, 14, 31 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 15, 13, 15, 30 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 15, 20, 15, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 15, 20, 15, 27 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "A" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 20, 15, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 25, 15, 27 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 29, 15, 29 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "name" : "p" + } ] + } + } ] + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 16, 9, 16, 24 ], + "value" : { + "kind" : "CallExpr", + "location" : [ 16, 16, 16, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 16, 16, 18 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "bool" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "qux" + }, + "args" : [ { + "kind" : "BooleanLiteral", + "location" : [ 16, 20, 16, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } ] + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 18, 1, 18, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 1, 18, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 1, 18, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 18, 7, 18, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 18, 7, 18, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 18, 7, 18, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 7, 18, 7 ], + "name" : "B" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 18, 11, 18, 13 ], + "name" : "bar" + } + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_method_nested.py.ast.typed.s.result b/pa3-tests/core/object_method_nested.py.ast.typed.s.result new file mode 100644 index 0000000..418c69b --- /dev/null +++ b/pa3-tests/core/object_method_nested.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +42 diff --git a/pa3-tests/core/object_method_none.py b/pa3-tests/core/object_method_none.py new file mode 100644 index 0000000..cd50666 --- /dev/null +++ b/pa3-tests/core/object_method_none.py @@ -0,0 +1,17 @@ +class A(object): + a:int = 42 + + def foo(self:"A", ignore:object) -> int: + return self.a + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + def bar(self:"B") -> int: + a:A = None + return a.foo(self.b) + +print(B().bar()) diff --git a/pa3-tests/core/object_method_none.py.ast.typed b/pa3-tests/core/object_method_none.py.ast.typed new file mode 100644 index 0000000..db92330 --- /dev/null +++ b/pa3-tests/core/object_method_none.py.ast.typed @@ -0,0 +1,412 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 17, 17 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 7, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 5, 22 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "A" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 23, 4, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 23, 4, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 41, 4, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 9, 5, 21 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 5, 16, 5, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 5, 16, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 5, 21, 5, 21 ], + "name" : "a" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 7, 1, 17, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 8, 5, 8, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 8, 5, 8, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 7, 8, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 14, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 27, 10, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 5, 15, 29 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 11 ], + "name" : "bar" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 13, 13, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 18, 13, 20 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 26, 13, 28 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 14, 9, 14, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 14, 9, 14, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 14, 9, 14, 9 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 14, 11, 14, 11 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 14, 15, 14, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 15, 9, 15, 28 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 15, 16, 15, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 15, 16, 15, 20 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "A" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 16, 15, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 18, 15, 20 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 15, 22, 15, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 15, 22, 15, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 15, 27, 15, 27 ], + "name" : "b" + } + } ] + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 17, 1, 17, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 1, 17, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 17, 7, 17, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 17, 7, 17, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 17, 7, 17, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 7, 17, 7 ], + "name" : "B" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 17, 11, 17, 13 ], + "name" : "bar" + } + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_method_none.py.ast.typed.s.result b/pa3-tests/core/object_method_none.py.ast.typed.s.result new file mode 100644 index 0000000..d9d147e --- /dev/null +++ b/pa3-tests/core/object_method_none.py.ast.typed.s.result @@ -0,0 +1,3 @@ +B +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/object_method_override.py b/pa3-tests/core/object_method_override.py new file mode 100644 index 0000000..879b2ba --- /dev/null +++ b/pa3-tests/core/object_method_override.py @@ -0,0 +1,19 @@ +class A(object): + a:int = 42 + + def foo(self:"A", ignore:object) -> int: + return self.a + +class B(A): + b:bool = True + + def __init__(self:"B"): + print("B") + + def bar(self:"B") -> int: + return self.foo(self.b) + + def foo(self:"B", ignore:object) -> int: + return 1 + +print(B().bar()) diff --git a/pa3-tests/core/object_method_override.py.ast.typed b/pa3-tests/core/object_method_override.py.ast.typed new file mode 100644 index 0000000..5684f7d --- /dev/null +++ b/pa3-tests/core/object_method_override.py.ast.typed @@ -0,0 +1,441 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 17 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 7, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 5, 5, 22 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 18, 4, 20 ], + "className" : "A" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 23, 4, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 23, 4, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 41, 4, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 9, 5, 21 ], + "value" : { + "kind" : "MemberExpr", + "location" : [ 5, 16, 5, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 5, 16, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 5, 21, 5, 21 ], + "name" : "a" + } + } + } ] + } ] + }, { + "kind" : "ClassDef", + "location" : [ 7, 1, 19, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "name" : "B" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "name" : "A" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 8, 5, 8, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 8, 5, 8, 10 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 5 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 7, 8, 10 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 14, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + }, { + "kind" : "FuncDef", + "location" : [ 10, 5, 11, 19 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 16 ], + "name" : "__init__" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 18, 10, 25 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 18, 10, 21 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 23, 10, 25 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 27, 10, 27 ], + "className" : "" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "B" + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 13, 5, 14, 32 ], + "name" : { + "kind" : "Identifier", + "location" : [ 13, 9, 13, 11 ], + "name" : "bar" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 13, 13, 13, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 13, 18, 13, 20 ], + "className" : "B" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 13, 26, 13, 28 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 14, 9, 14, 31 ], + "value" : { + "kind" : "MethodCallExpr", + "location" : [ 14, 16, 14, 31 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 14, 16, 14, 23 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + }, { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 16, 14, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 21, 14, 23 ], + "name" : "foo" + } + }, + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 14, 25, 14, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "object" : { + "kind" : "Identifier", + "location" : [ 14, 25, 14, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "name" : "self" + }, + "member" : { + "kind" : "Identifier", + "location" : [ 14, 30, 14, 30 ], + "name" : "b" + } + } ] + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 16, 5, 17, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 16, 9, 16, 11 ], + "name" : "foo" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 16, 13, 16, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 16, 13, 16, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 16, 18, 16, 20 ], + "className" : "B" + } + }, { + "kind" : "TypedVar", + "location" : [ 16, 23, 16, 35 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 16, 23, 16, 28 ], + "name" : "ignore" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 16, 30, 16, 35 ], + "className" : "object" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 16, 41, 16, 43 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 17, 9, 17, 16 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 17, 16, 17, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "MethodCallExpr", + "location" : [ 19, 7, 19, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "method" : { + "kind" : "MemberExpr", + "location" : [ 19, 7, 19, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "B" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "object" : { + "kind" : "CallExpr", + "location" : [ 19, 7, 19, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "B" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 7, 19, 7 ], + "name" : "B" + }, + "args" : [ ] + }, + "member" : { + "kind" : "Identifier", + "location" : [ 19, 11, 19, 13 ], + "name" : "bar" + } + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/object_method_override.py.ast.typed.s.result b/pa3-tests/core/object_method_override.py.ast.typed.s.result new file mode 100644 index 0000000..9a6e55a --- /dev/null +++ b/pa3-tests/core/object_method_override.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +1 diff --git a/pa3-tests/core/op_add.py b/pa3-tests/core/op_add.py new file mode 100644 index 0000000..95e89ae --- /dev/null +++ b/pa3-tests/core/op_add.py @@ -0,0 +1 @@ +print(1 + 100) diff --git a/pa3-tests/core/op_add.py.ast.typed b/pa3-tests/core/op_add.py.ast.typed new file mode 100644 index 0000000..a0a2d9b --- /dev/null +++ b/pa3-tests/core/op_add.py.ast.typed @@ -0,0 +1,65 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 15 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 11, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 100 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_add.py.ast.typed.s.result b/pa3-tests/core/op_add.py.ast.typed.s.result new file mode 100644 index 0000000..398050c --- /dev/null +++ b/pa3-tests/core/op_add.py.ast.typed.s.result @@ -0,0 +1 @@ +101 diff --git a/pa3-tests/core/op_cmp_bool.py b/pa3-tests/core/op_cmp_bool.py new file mode 100644 index 0000000..7f8d4b5 --- /dev/null +++ b/pa3-tests/core/op_cmp_bool.py @@ -0,0 +1,8 @@ +print(True == True) +print(True == False) +print(False == True) +print(False == False) +print(True != True) +print(True != False) +print(False != True) +print(False != False) diff --git a/pa3-tests/core/op_cmp_bool.py.ast.typed b/pa3-tests/core/op_cmp_bool.py.ast.typed new file mode 100644 index 0000000..4c25364 --- /dev/null +++ b/pa3-tests/core/op_cmp_bool.py.ast.typed @@ -0,0 +1,443 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 22 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 1, 7, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "operator" : "==", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 1, 15, 1, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 2, 7, 2, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 2, 7, 2, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "operator" : "==", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 2, 15, 2, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 3, 1, 3, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 1, 3, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 3, 7, 3, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 3, 7, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "operator" : "==", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 3, 16, 3, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 4, 7, 4, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 4, 7, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "operator" : "==", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 4, 16, 4, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 5, 7, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 7, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "operator" : "!=", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 5, 15, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 6, 7, 6, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 6, 7, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "operator" : "!=", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 6, 15, 6, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 7, 1, 7, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 1, 7, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 7, 7, 7, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 7, 7, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "operator" : "!=", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 7, 16, 7, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 8, 7, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 7, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "operator" : "!=", + "right" : { + "kind" : "BooleanLiteral", + "location" : [ 8, 16, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_cmp_bool.py.ast.typed.s.result b/pa3-tests/core/op_cmp_bool.py.ast.typed.s.result new file mode 100644 index 0000000..12ea2d4 --- /dev/null +++ b/pa3-tests/core/op_cmp_bool.py.ast.typed.s.result @@ -0,0 +1,8 @@ +True +False +False +True +False +True +True +False diff --git a/pa3-tests/core/op_cmp_int.py b/pa3-tests/core/op_cmp_int.py new file mode 100644 index 0000000..fd70a09 --- /dev/null +++ b/pa3-tests/core/op_cmp_int.py @@ -0,0 +1,16 @@ +x:int = 42 +y:int = 7 + +print(x == y) +print(x != y) +print(x < y) +print(x <= y) +print(x > y) +print(x >= y) + +print(x == x) +print(x != x) +print(x < x) +print(x <= x) +print(x > x) +print(x >= x) diff --git a/pa3-tests/core/op_cmp_int.py.ast.typed b/pa3-tests/core/op_cmp_int.py.ast.typed new file mode 100644 index 0000000..4b3633f --- /dev/null +++ b/pa3-tests/core/op_cmp_int.py.ast.typed @@ -0,0 +1,711 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 14 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 7 + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 4, 7, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "==", + "right" : { + "kind" : "Identifier", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 5, 7, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "!=", + "right" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 6, 7, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 7, 1, 7, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 1, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 7, 7, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<=", + "right" : { + "kind" : "Identifier", + "location" : [ 7, 12, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 8, 7, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 7, 8, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">", + "right" : { + "kind" : "Identifier", + "location" : [ 8, 11, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 9, 1, 9, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 9, 1, 9, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 1, 9, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 9, 7, 9, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 9, 7, 9, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">=", + "right" : { + "kind" : "Identifier", + "location" : [ 9, 12, 9, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 11, 7, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 11, 7, 11, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "==", + "right" : { + "kind" : "Identifier", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 12, 1, 12, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 1, 12, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 1, 12, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 12, 7, 12, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 12, 7, 12, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "!=", + "right" : { + "kind" : "Identifier", + "location" : [ 12, 12, 12, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 1, 13, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 1, 13, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 13, 7, 13, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 13, 7, 13, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "Identifier", + "location" : [ 13, 11, 13, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 14, 7, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<=", + "right" : { + "kind" : "Identifier", + "location" : [ 14, 12, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 15, 7, 15, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">", + "right" : { + "kind" : "Identifier", + "location" : [ 15, 11, 15, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 16, 7, 16, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">=", + "right" : { + "kind" : "Identifier", + "location" : [ 16, 12, 16, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_cmp_int.py.ast.typed.s.result b/pa3-tests/core/op_cmp_int.py.ast.typed.s.result new file mode 100644 index 0000000..4386d2a --- /dev/null +++ b/pa3-tests/core/op_cmp_int.py.ast.typed.s.result @@ -0,0 +1,12 @@ +False +True +False +False +True +True +True +False +False +True +False +True diff --git a/pa3-tests/core/op_div_mod.py b/pa3-tests/core/op_div_mod.py new file mode 100644 index 0000000..9e41a78 --- /dev/null +++ b/pa3-tests/core/op_div_mod.py @@ -0,0 +1,5 @@ +x:int = 42 +y:int = 9 + +print(x // y) +print(x % y) diff --git a/pa3-tests/core/op_div_mod.py.ast.typed b/pa3-tests/core/op_div_mod.py.ast.typed new file mode 100644 index 0000000..eded4a3 --- /dev/null +++ b/pa3-tests/core/op_div_mod.py.ast.typed @@ -0,0 +1,171 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 5, 13 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 9 + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 4, 7, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "//", + "right" : { + "kind" : "Identifier", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 5, 1, 5, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 1, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 5, 7, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 5, 7, 5, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "%", + "right" : { + "kind" : "Identifier", + "location" : [ 5, 11, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_div_mod.py.ast.typed.s.result b/pa3-tests/core/op_div_mod.py.ast.typed.s.result new file mode 100644 index 0000000..cfbeb15 --- /dev/null +++ b/pa3-tests/core/op_div_mod.py.ast.typed.s.result @@ -0,0 +1,2 @@ +4 +6 diff --git a/pa3-tests/core/op_is.py b/pa3-tests/core/op_is.py new file mode 100644 index 0000000..4207f29 --- /dev/null +++ b/pa3-tests/core/op_is.py @@ -0,0 +1,19 @@ +class A(object): + a:int = 42 + +a1:A = None +a2:A = None +a3:A = None +a4:A = None + +a1 = A() +a2 = a1 +a3 = A() + +print(a1 is a1) +print(a1 is a2) +print(a1 is a3) +print(a1 is a4) +print(a1 is None) +print(a4 is None) +print(None is None) diff --git a/pa3-tests/core/op_is.py.ast.typed b/pa3-tests/core/op_is.py.ast.typed new file mode 100644 index 0000000..962be5e --- /dev/null +++ b/pa3-tests/core/op_is.py.ast.typed @@ -0,0 +1,598 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 20 ], + "declarations" : [ { + "kind" : "ClassDef", + "location" : [ 1, 1, 2, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 7 ], + "name" : "A" + }, + "superClass" : { + "kind" : "Identifier", + "location" : [ 1, 9, 1, 14 ], + "name" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ] + }, { + "kind" : "VarDef", + "location" : [ 4, 1, 4, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 1, 4, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 2 ], + "name" : "a1" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 4, 4, 4 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 4, 8, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 5, 1, 5, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 1, 5, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 2 ], + "name" : "a2" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 4, 5, 4 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 5, 8, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 6, 1, 6, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 6, 1, 6, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 2 ], + "name" : "a3" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 6, 4, 6, 4 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 6, 8, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 7, 1, 7, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 7, 1, 7, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 2 ], + "name" : "a4" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 4, 7, 4 ], + "className" : "A" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 7, 8, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 9, 1, 9, 8 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 9, 1, 9, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 9, 6, 9, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 6, 9, 6 ], + "name" : "A" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 10, 1, 10, 7 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a2" + } ], + "value" : { + "kind" : "Identifier", + "location" : [ 10, 6, 10, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + } + }, { + "kind" : "AssignStmt", + "location" : [ 11, 1, 11, 8 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 2 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a3" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 11, 6, 11, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 6, 11, 6 ], + "name" : "A" + }, + "args" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 1, 13, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 1, 13, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 13, 7, 13, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 13, 7, 13, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + }, + "operator" : "is", + "right" : { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 14, 7, 14, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + }, + "operator" : "is", + "right" : { + "kind" : "Identifier", + "location" : [ 14, 13, 14, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a2" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 15, 7, 15, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + }, + "operator" : "is", + "right" : { + "kind" : "Identifier", + "location" : [ 15, 13, 15, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a3" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 16, 7, 16, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + }, + "operator" : "is", + "right" : { + "kind" : "Identifier", + "location" : [ 16, 13, 16, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a4" + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 17, 1, 17, 17 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 1, 17, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 17, 7, 17, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 17, 7, 17, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a1" + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 17, 13, 17, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 18, 1, 18, 17 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 1, 18, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 1, 18, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 18, 7, 18, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 18, 7, 18, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "A" + }, + "name" : "a4" + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 18, 13, 18, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 19, 7, 19, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "NoneLiteral", + "location" : [ 19, 7, 19, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 19, 15, 19, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_is.py.ast.typed.s.result b/pa3-tests/core/op_is.py.ast.typed.s.result new file mode 100644 index 0000000..0ac4f5b --- /dev/null +++ b/pa3-tests/core/op_is.py.ast.typed.s.result @@ -0,0 +1,7 @@ +True +True +False +False +False +True +True diff --git a/pa3-tests/core/op_logical.py b/pa3-tests/core/op_logical.py new file mode 100644 index 0000000..7b55262 --- /dev/null +++ b/pa3-tests/core/op_logical.py @@ -0,0 +1,13 @@ +def f() -> bool: + print("f called") + return True + +def g() -> bool: + print("g called") + return False + +if f() or g(): # Short-circuit + if g() and f(): # Short-circuit + print("Never") + else: + print(not (f() and (g() or f()))) diff --git a/pa3-tests/core/op_logical.py.ast.typed b/pa3-tests/core/op_logical.py.ast.typed new file mode 100644 index 0000000..4aa1544 --- /dev/null +++ b/pa3-tests/core/op_logical.py.ast.typed @@ -0,0 +1,411 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 14, 2 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 3, 14 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 5 ], + "name" : "f" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 12, 1, 15 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 3, 2, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 3, 2, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 3, 2, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "f called" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 3, 3, 3, 13 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 3, 10, 3, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 5, 1, 7, 15 ], + "name" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "name" : "g" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 5, 12, 5, 15 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 6, 3, 6, 19 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 3, 6, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 3, 6, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 6, 9, 6, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "g called" + } ] + } + }, { + "kind" : "ReturnStmt", + "location" : [ 7, 3, 7, 14 ], + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 7, 10, 7, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + } + } ] + } ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 9, 1, 14, 2 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 9, 4, 9, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 9, 4, 9, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 4, 9, 4 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "f" + }, + "args" : [ ] + }, + "operator" : "or", + "right" : { + "kind" : "CallExpr", + "location" : [ 9, 11, 9, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 11, 9, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "g" + }, + "args" : [ ] + } + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 10, 3, 14, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 10, 6, 10, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 10, 6, 10, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 6, 10, 6 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "g" + }, + "args" : [ ] + }, + "operator" : "and", + "right" : { + "kind" : "CallExpr", + "location" : [ 10, 14, 10, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 14, 10, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "f" + }, + "args" : [ ] + } + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 5, 11, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 5, 11, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 5, 11, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 11, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Never" + } ] + } + } ], + "elseBody" : [ { + "kind" : "ExprStmt", + "location" : [ 13, 5, 13, 37 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 5, 13, 37 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "UnaryExpr", + "location" : [ 13, 11, 13, 36 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "operator" : "not", + "operand" : { + "kind" : "BinaryExpr", + "location" : [ 13, 16, 13, 35 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 13, 16, 13, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 16, 13, 16 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "f" + }, + "args" : [ ] + }, + "operator" : "and", + "right" : { + "kind" : "BinaryExpr", + "location" : [ 13, 25, 13, 34 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 13, 25, 13, 27 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 25, 13, 25 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "g" + }, + "args" : [ ] + }, + "operator" : "or", + "right" : { + "kind" : "CallExpr", + "location" : [ 13, 32, 13, 34 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 32, 13, 32 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "f" + }, + "args" : [ ] + } + } + } + } ] + } + } ] + } ], + "elseBody" : [ ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_logical.py.ast.typed.s.result b/pa3-tests/core/op_logical.py.ast.typed.s.result new file mode 100644 index 0000000..82c1ab2 --- /dev/null +++ b/pa3-tests/core/op_logical.py.ast.typed.s.result @@ -0,0 +1,6 @@ +f called +g called +f called +g called +f called +False diff --git a/pa3-tests/core/op_mul.py b/pa3-tests/core/op_mul.py new file mode 100644 index 0000000..cf6201d --- /dev/null +++ b/pa3-tests/core/op_mul.py @@ -0,0 +1 @@ +print(6*9*2) diff --git a/pa3-tests/core/op_mul.py.ast.typed b/pa3-tests/core/op_mul.py.ast.typed new file mode 100644 index 0000000..6ed26cc --- /dev/null +++ b/pa3-tests/core/op_mul.py.ast.typed @@ -0,0 +1,83 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 13 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + }, + "operator" : "*", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 9 + } + }, + "operator" : "*", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 11, 1, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_mul.py.ast.typed.s.result b/pa3-tests/core/op_mul.py.ast.typed.s.result new file mode 100644 index 0000000..3b20426 --- /dev/null +++ b/pa3-tests/core/op_mul.py.ast.typed.s.result @@ -0,0 +1 @@ +108 diff --git a/pa3-tests/core/op_negate.py b/pa3-tests/core/op_negate.py new file mode 100644 index 0000000..0f3b2be --- /dev/null +++ b/pa3-tests/core/op_negate.py @@ -0,0 +1,2 @@ +x:int = 42 +print(-x) diff --git a/pa3-tests/core/op_negate.py.ast.typed b/pa3-tests/core/op_negate.py.ast.typed new file mode 100644 index 0000000..4268b3b --- /dev/null +++ b/pa3-tests/core/op_negate.py.ast.typed @@ -0,0 +1,82 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 2, 10 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 9 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "UnaryExpr", + "location" : [ 2, 7, 2, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "Identifier", + "location" : [ 2, 8, 2, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_negate.py.ast.typed.s.result b/pa3-tests/core/op_negate.py.ast.typed.s.result new file mode 100644 index 0000000..6a0e60d --- /dev/null +++ b/pa3-tests/core/op_negate.py.ast.typed.s.result @@ -0,0 +1 @@ +-42 diff --git a/pa3-tests/core/op_sub.py b/pa3-tests/core/op_sub.py new file mode 100644 index 0000000..48aa45b --- /dev/null +++ b/pa3-tests/core/op_sub.py @@ -0,0 +1 @@ +print(1 - 100) diff --git a/pa3-tests/core/op_sub.py.ast.typed b/pa3-tests/core/op_sub.py.ast.typed new file mode 100644 index 0000000..2c927e8 --- /dev/null +++ b/pa3-tests/core/op_sub.py.ast.typed @@ -0,0 +1,65 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 15 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 7, 1, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, + "operator" : "-", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 11, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 100 + } + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/op_sub.py.ast.typed.s.result b/pa3-tests/core/op_sub.py.ast.typed.s.result new file mode 100644 index 0000000..d3a0ef5 --- /dev/null +++ b/pa3-tests/core/op_sub.py.ast.typed.s.result @@ -0,0 +1 @@ +-99 diff --git a/pa3-tests/core/pass.py b/pa3-tests/core/pass.py new file mode 100644 index 0000000..2ae2839 --- /dev/null +++ b/pa3-tests/core/pass.py @@ -0,0 +1 @@ +pass diff --git a/pa3-tests/core/pass.py.ast.typed b/pa3-tests/core/pass.py.ast.typed new file mode 100644 index 0000000..ceb0bbd --- /dev/null +++ b/pa3-tests/core/pass.py.ast.typed @@ -0,0 +1,11 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 5 ], + "declarations" : [ ], + "statements" : [ ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/pass.py.ast.typed.s.result b/pa3-tests/core/pass.py.ast.typed.s.result new file mode 100644 index 0000000..e69de29 diff --git a/pa3-tests/core/predef_constructors.py b/pa3-tests/core/predef_constructors.py new file mode 100644 index 0000000..0086564 --- /dev/null +++ b/pa3-tests/core/predef_constructors.py @@ -0,0 +1,4 @@ +print(object() is None) +print(int()) +print(str()) +print(bool()) diff --git a/pa3-tests/core/predef_constructors.py.ast.typed b/pa3-tests/core/predef_constructors.py.ast.typed new file mode 100644 index 0000000..3644f24 --- /dev/null +++ b/pa3-tests/core/predef_constructors.py.ast.typed @@ -0,0 +1,192 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 14 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 23 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 1, 7, 1, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "CallExpr", + "location" : [ 1, 7, 1, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 12 ], + "name" : "object" + }, + "args" : [ ] + }, + "operator" : "is", + "right" : { + "kind" : "NoneLiteral", + "location" : [ 1, 19, 1, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 2, 1, 2, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 1, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 2, 7, 2, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 7, 2, 9 ], + "name" : "int" + }, + "args" : [ ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 3, 1, 3, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 1, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 3, 7, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 7, 3, 9 ], + "name" : "str" + }, + "args" : [ ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 4, 7, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 10 ], + "name" : "bool" + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/predef_constructors.py.ast.typed.s.result b/pa3-tests/core/predef_constructors.py.ast.typed.s.result new file mode 100644 index 0000000..8add9b0 --- /dev/null +++ b/pa3-tests/core/predef_constructors.py.ast.typed.s.result @@ -0,0 +1,4 @@ +False +0 + +False diff --git a/pa3-tests/core/stmt_for_list.py b/pa3-tests/core/stmt_for_list.py new file mode 100644 index 0000000..78c5c00 --- /dev/null +++ b/pa3-tests/core/stmt_for_list.py @@ -0,0 +1,7 @@ +x:int = 0 +z:[int] = None + +z = [1, 2, 3] + +for x in z: + print(x) diff --git a/pa3-tests/core/stmt_for_list.py.ast.typed b/pa3-tests/core/stmt_for_list.py.ast.typed new file mode 100644 index 0000000..53d6834 --- /dev/null +++ b/pa3-tests/core/stmt_for_list.py.ast.typed @@ -0,0 +1,178 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 3, 2, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 4, 2, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 4, 5, 4, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 6, 4, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 6, 1, 8, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 6, 10, 6, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 7, 5, 7, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 11, 7, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/pa3-tests/core/stmt_for_list.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/pa3-tests/core/stmt_for_list_empty.py b/pa3-tests/core/stmt_for_list_empty.py new file mode 100644 index 0000000..23fba4a --- /dev/null +++ b/pa3-tests/core/stmt_for_list_empty.py @@ -0,0 +1,12 @@ +x:int = 0 +y:int = 0 +z:[int] = None +e:[int] = None + +z = [1,2,3] +e = [] + +for x in z: + for y in e: + print("Never") + print(x) diff --git a/pa3-tests/core/stmt_for_list_empty.py.ast.typed b/pa3-tests/core/stmt_for_list_empty.py.ast.typed new file mode 100644 index 0000000..ca4160c --- /dev/null +++ b/pa3-tests/core/stmt_for_list_empty.py.ast.typed @@ -0,0 +1,318 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 13, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 3, 3, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 4, 3, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 11, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "VarDef", + "location" : [ 4, 1, 4, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 1, 4, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "name" : "e" + }, + "type" : { + "kind" : "ListType", + "location" : [ 4, 3, 4, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 4, 4, 4, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 4, 11, 4, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 6, 1, 6, 11 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 6, 5, 6, 11 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 6, 6, 6, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 6, 8, 6, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 6, 10, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 7, 1, 7, 6 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "e" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 7, 5, 7, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "elements" : [ ] + } + }, { + "kind" : "ForStmt", + "location" : [ 9, 1, 13, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 9, 5, 9, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 9, 10, 9, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ForStmt", + "location" : [ 10, 5, 12, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 9, 10, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 10, 14, 10, 14 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "e" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 9, 11, 22 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 9, 11, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 11, 15, 11, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Never" + } ] + } + } ] + }, { + "kind" : "ExprStmt", + "location" : [ 12, 5, 12, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 5, 12, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 5, 12, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 12, 11, 12, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_empty.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_empty.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_empty.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/pa3-tests/core/stmt_for_list_eval.py b/pa3-tests/core/stmt_for_list_eval.py new file mode 100644 index 0000000..a77b171 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_eval.py @@ -0,0 +1,8 @@ +x:int = 0 +z:[int] = None + +z = [1, 2, 3] + +for x in z: + z = [] + print(x) diff --git a/pa3-tests/core/stmt_for_list_eval.py.ast.typed b/pa3-tests/core/stmt_for_list_eval.py.ast.typed new file mode 100644 index 0000000..c86d718 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_eval.py.ast.typed @@ -0,0 +1,202 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 3, 2, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 4, 2, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 4, 5, 4, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 6, 4, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 6, 1, 9, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 6, 10, 6, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 5, 7, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 5 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 7, 9, 7, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "elements" : [ ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 5, 8, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 5, 8, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 11, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_eval.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_eval.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_eval.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/pa3-tests/core/stmt_for_list_modify.py b/pa3-tests/core/stmt_for_list_modify.py new file mode 100644 index 0000000..3006cd2 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_modify.py @@ -0,0 +1,8 @@ +x:int = 0 +z:[int] = None + +z = [1, 2, 1] + +for x in z: + z[x] = x + print(x) diff --git a/pa3-tests/core/stmt_for_list_modify.py.ast.typed b/pa3-tests/core/stmt_for_list_modify.py.ast.typed new file mode 100644 index 0000000..fa19b60 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_modify.py.ast.typed @@ -0,0 +1,219 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 3, 2, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 4, 2, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 4, 1, 4, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 4, 5, 4, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 4, 6, 4, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 6, 1, 9, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 6, 10, 6, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 5, 7, 12 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 7, 5, 7, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 5 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 7, 7, 7, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + } ], + "value" : { + "kind" : "Identifier", + "location" : [ 7, 12, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 5, 8, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 5, 8, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 11, 8, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_modify.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_modify.py.ast.typed.s.result new file mode 100644 index 0000000..e8183f0 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_modify.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +1 +1 diff --git a/pa3-tests/core/stmt_for_list_nested.py b/pa3-tests/core/stmt_for_list_nested.py new file mode 100644 index 0000000..b69f3f0 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested.py @@ -0,0 +1,9 @@ +x:int = 0 +y:int = 0 +z:[int] = None + +z = [1, 2, 3] + +for x in z: + for y in z: + print(x * y) diff --git a/pa3-tests/core/stmt_for_list_nested.py.ast.typed b/pa3-tests/core/stmt_for_list_nested.py.ast.typed new file mode 100644 index 0000000..0521e4a --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested.py.ast.typed @@ -0,0 +1,247 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 10, 2 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 3, 3, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 4, 3, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 11, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 5, 1, 5, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 5, 5, 5, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 5, 6, 5, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 7, 1, 10, 2 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 7, 10, 7, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ForStmt", + "location" : [ 8, 5, 10, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 8, 14, 8, 14 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 9, 9, 9, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 9, 9, 9, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 9, 9, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "BinaryExpr", + "location" : [ 9, 15, 9, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 9, 15, 9, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 9, 19, 9, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "y" + } + } ] + } + } ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_nested.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_nested.py.ast.typed.s.result new file mode 100644 index 0000000..0d1fb9e --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +2 +4 +6 +3 +6 +9 diff --git a/pa3-tests/core/stmt_for_list_nested_same_var.py b/pa3-tests/core/stmt_for_list_nested_same_var.py new file mode 100644 index 0000000..0057164 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested_same_var.py @@ -0,0 +1,9 @@ +x:int = 0 +y:int = 0 +z:[int] = None + +z = [1, 2, 3] + +for x in z: + for x in z: + print(x) diff --git a/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed b/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed new file mode 100644 index 0000000..2feac51 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed @@ -0,0 +1,229 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 10, 2 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 9, 2, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 3, 3, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 4, 3, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 11, 3, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 5, 1, 5, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 5, 5, 5, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 5, 6, 5, 6 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 5, 9, 5, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 7, 1, 10, 2 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 7, 10, 7, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ForStmt", + "location" : [ 8, 5, 10, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 8, 14, 8, 14 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 9, 9, 9, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 9, 9, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 9, 9, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 9, 15, 9, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed.s.result new file mode 100644 index 0000000..a8401b1 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nested_same_var.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +1 +2 +3 +1 +2 +3 diff --git a/pa3-tests/core/stmt_for_list_none.py b/pa3-tests/core/stmt_for_list_none.py new file mode 100644 index 0000000..fd511fa --- /dev/null +++ b/pa3-tests/core/stmt_for_list_none.py @@ -0,0 +1,5 @@ +x:int = 0 +z:[int] = None + +for x in z: + print(x) diff --git a/pa3-tests/core/stmt_for_list_none.py.ast.typed b/pa3-tests/core/stmt_for_list_none.py.ast.typed new file mode 100644 index 0000000..00acc08 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_none.py.ast.typed @@ -0,0 +1,127 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 6, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 14 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 3, 2, 7 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 4, 2, 6 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 4, 1, 6, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 5, 5, 5, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 5, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 5, 11, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_none.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/pa3-tests/core/stmt_for_list_nonlocal.py b/pa3-tests/core/stmt_for_list_nonlocal.py new file mode 100644 index 0000000..e9b54a2 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nonlocal.py @@ -0,0 +1,15 @@ +x:int = 0 +def crunch(zz:[[int]]) -> object: + z:[int] = None + global x + def make_z() -> object: + nonlocal z + for z in zz: + pass # Set z to last element in zz + + make_z() + for x in z: + pass # Set x to last element in z + +crunch([[1,2],[2,3],[4,5],[6,7]]) +print(x) diff --git a/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed b/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed new file mode 100644 index 0000000..2c686f8 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed @@ -0,0 +1,408 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 15, 10 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "FuncDef", + "location" : [ 2, 1, 14, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 10 ], + "name" : "crunch" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 2, 12, 2, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 12, 2, 13 ], + "name" : "zz" + }, + "type" : { + "kind" : "ListType", + "location" : [ 2, 15, 2, 21 ], + "elementType" : { + "kind" : "ListType", + "location" : [ 2, 16, 2, 20 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 2, 17, 2, 19 ], + "className" : "int" + } + } + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 2, 27, 2, 32 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 3, 5, 3, 18 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 5, 3, 11 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 3, 7, 3, 11 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 3, 8, 3, 10 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 3, 15, 3, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + } + } + }, { + "kind" : "GlobalDecl", + "location" : [ 4, 5, 4, 12 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 4, 12, 4, 12 ], + "name" : "x" + } + }, { + "kind" : "FuncDef", + "location" : [ 5, 5, 10, 4 ], + "name" : { + "kind" : "Identifier", + "location" : [ 5, 9, 5, 14 ], + "name" : "make_z" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 5, 21, 5, 26 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "NonLocalDecl", + "location" : [ 6, 9, 6, 18 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 6, 18, 6, 18 ], + "name" : "z" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 7, 9, 10, 4 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 7, 18, 7, 19 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } + }, + "name" : "zz" + }, + "body" : [ ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 10, 5, 10, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 10, 5, 10, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "make_z" + }, + "args" : [ ] + } + }, { + "kind" : "ForStmt", + "location" : [ 11, 5, 14, 0 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 11, 9, 11, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 11, 14, 11, 14 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 33 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 33 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 6 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "crunch" + }, + "args" : [ { + "kind" : "ListExpr", + "location" : [ 14, 8, 14, 32 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } + }, + "elements" : [ { + "kind" : "ListExpr", + "location" : [ 14, 9, 14, 13 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 14, 10, 14, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 14, 12, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } ] + }, { + "kind" : "ListExpr", + "location" : [ 14, 15, 14, 19 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 14, 16, 14, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 14, 18, 14, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + }, { + "kind" : "ListExpr", + "location" : [ 14, 21, 14, 25 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 14, 22, 14, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 4 + }, { + "kind" : "IntegerLiteral", + "location" : [ 14, 24, 14, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 5 + } ] + }, { + "kind" : "ListExpr", + "location" : [ 14, 27, 14, 31 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 14, 28, 14, 28 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 6 + }, { + "kind" : "IntegerLiteral", + "location" : [ 14, 30, 14, 30 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 7 + } ] + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed.s.result new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/pa3-tests/core/stmt_for_list_nonlocal.py.ast.typed.s.result @@ -0,0 +1 @@ +7 diff --git a/pa3-tests/core/stmt_for_list_return.py b/pa3-tests/core/stmt_for_list_return.py new file mode 100644 index 0000000..35716dd --- /dev/null +++ b/pa3-tests/core/stmt_for_list_return.py @@ -0,0 +1,8 @@ +def print_list(z:[int]) -> object: + x:int = 0 + for x in z: + print(x) + if x >= 30: + return + +print_list([10,20,30,40]) diff --git a/pa3-tests/core/stmt_for_list_return.py.ast.typed b/pa3-tests/core/stmt_for_list_return.py.ast.typed new file mode 100644 index 0000000..4fca85f --- /dev/null +++ b/pa3-tests/core/stmt_for_list_return.py.ast.typed @@ -0,0 +1,241 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 26 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 8, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 14 ], + "name" : "print_list" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 1, 16, 1, 22 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 16, 1, 16 ], + "name" : "z" + }, + "type" : { + "kind" : "ListType", + "location" : [ 1, 18, 1, 22 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 1, 19, 1, 21 ], + "className" : "int" + } + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 28, 1, 33 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 2, 5, 2, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 5, 2, 9 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 5 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 7, 2, 9 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 13, 2, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 3, 5, 8, 0 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 9, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 3, 14, 3, 14 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 4, 9, 4, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 9, 4, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 4, 15, 4, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "IfStmt", + "location" : [ 5, 9, 8, 0 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 5, 12, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : ">=", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 5, 17, 5, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 30 + } + }, + "thenBody" : [ { + "kind" : "ReturnStmt", + "location" : [ 6, 13, 6, 18 ], + "value" : null + } ], + "elseBody" : [ ] + } ] + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 25 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "object" + } + }, + "name" : "print_list" + }, + "args" : [ { + "kind" : "ListExpr", + "location" : [ 8, 12, 8, 24 ], + "inferredType" : { + "kind" : "ListValueType", + "elementType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 8, 13, 8, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + }, { + "kind" : "IntegerLiteral", + "location" : [ 8, 16, 8, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 20 + }, { + "kind" : "IntegerLiteral", + "location" : [ 8, 19, 8, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 30 + }, { + "kind" : "IntegerLiteral", + "location" : [ 8, 22, 8, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 40 + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_list_return.py.ast.typed.s.result b/pa3-tests/core/stmt_for_list_return.py.ast.typed.s.result new file mode 100644 index 0000000..300ed6f --- /dev/null +++ b/pa3-tests/core/stmt_for_list_return.py.ast.typed.s.result @@ -0,0 +1,3 @@ +10 +20 +30 diff --git a/pa3-tests/core/stmt_for_str.py b/pa3-tests/core/stmt_for_str.py new file mode 100644 index 0000000..c3ab74f --- /dev/null +++ b/pa3-tests/core/stmt_for_str.py @@ -0,0 +1,5 @@ +x:str = "" +z:str = "abc" + +for x in z: + print(x) diff --git a/pa3-tests/core/stmt_for_str.py.ast.typed b/pa3-tests/core/stmt_for_str.py.ast.typed new file mode 100644 index 0000000..4b0e583 --- /dev/null +++ b/pa3-tests/core/stmt_for_str.py.ast.typed @@ -0,0 +1,121 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 6, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 4, 1, 6, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 5, 5, 5, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 5, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 5, 11, 5, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_str.py.ast.typed.s.result b/pa3-tests/core/stmt_for_str.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/pa3-tests/core/stmt_for_str.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/pa3-tests/core/stmt_for_str_empty.py b/pa3-tests/core/stmt_for_str_empty.py new file mode 100644 index 0000000..9dc60e7 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_empty.py @@ -0,0 +1,8 @@ +x:str = "" +y:str = "123" +z:str = "abc" + +for x in z: + print(x) + for x in "": + print(x) diff --git a/pa3-tests/core/stmt_for_str_empty.py.ast.typed b/pa3-tests/core/stmt_for_str_empty.py.ast.typed new file mode 100644 index 0000000..9be591f --- /dev/null +++ b/pa3-tests/core/stmt_for_str_empty.py.ast.typed @@ -0,0 +1,205 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 2 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "123" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 5, 1, 9, 2 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 5, 10, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 6, 5, 6, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 5, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 7, 5, 9, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "StringLiteral", + "location" : [ 7, 14, 7, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 15, 8, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + } ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_str_empty.py.ast.typed.s.result b/pa3-tests/core/stmt_for_str_empty.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_empty.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/pa3-tests/core/stmt_for_str_eval.py b/pa3-tests/core/stmt_for_str_eval.py new file mode 100644 index 0000000..69c2ea9 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_eval.py @@ -0,0 +1,6 @@ +x:str = "" +z:str = "abc" + +for x in z: + z = "doesn't matter" + print(x) diff --git a/pa3-tests/core/stmt_for_str_eval.py.ast.typed b/pa3-tests/core/stmt_for_str_eval.py.ast.typed new file mode 100644 index 0000000..1e64270 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_eval.py.ast.typed @@ -0,0 +1,142 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 7, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 4, 1, 7, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 4, 10, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "z" + }, + "body" : [ { + "kind" : "AssignStmt", + "location" : [ 5, 5, 5, 24 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "z" + } ], + "value" : { + "kind" : "StringLiteral", + "location" : [ 5, 9, 5, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "doesn't matter" + } + }, { + "kind" : "ExprStmt", + "location" : [ 6, 5, 6, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 5, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_str_eval.py.ast.typed.s.result b/pa3-tests/core/stmt_for_str_eval.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_eval.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/pa3-tests/core/stmt_for_str_nested.py b/pa3-tests/core/stmt_for_str_nested.py new file mode 100644 index 0000000..81f0f46 --- /dev/null +++ b/pa3-tests/core/stmt_for_str_nested.py @@ -0,0 +1,8 @@ +x:str = "" +y:str = "123" +z:str = "abc" + +for x in z: + print(x) + for x in y: + print(x) diff --git a/pa3-tests/core/stmt_for_str_nested.py.ast.typed b/pa3-tests/core/stmt_for_str_nested.py.ast.typed new file mode 100644 index 0000000..5260c3b --- /dev/null +++ b/pa3-tests/core/stmt_for_str_nested.py.ast.typed @@ -0,0 +1,205 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 9, 2 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "123" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "z" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 5, 1, 9, 2 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 5, 10, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "z" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 6, 5, 6, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 5, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 6, 11, 6, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + }, { + "kind" : "ForStmt", + "location" : [ 7, 5, 9, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 9, 7, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 7, 14, 7, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "y" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 8, 9, 8, 16 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 9, 8, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 15, 8, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + } ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_str_nested.py.ast.typed.s.result b/pa3-tests/core/stmt_for_str_nested.py.ast.typed.s.result new file mode 100644 index 0000000..c2cb64d --- /dev/null +++ b/pa3-tests/core/stmt_for_str_nested.py.ast.typed.s.result @@ -0,0 +1,12 @@ +a +1 +2 +3 +b +1 +2 +3 +c +1 +2 +3 diff --git a/pa3-tests/core/stmt_for_str_same_var.py b/pa3-tests/core/stmt_for_str_same_var.py new file mode 100644 index 0000000..438c74e --- /dev/null +++ b/pa3-tests/core/stmt_for_str_same_var.py @@ -0,0 +1,4 @@ +x:str = "xXx" + +for x in x: + print(x) diff --git a/pa3-tests/core/stmt_for_str_same_var.py.ast.typed b/pa3-tests/core/stmt_for_str_same_var.py.ast.typed new file mode 100644 index 0000000..e3870ec --- /dev/null +++ b/pa3-tests/core/stmt_for_str_same_var.py.ast.typed @@ -0,0 +1,95 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 5, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "xXx" + } + } ], + "statements" : [ { + "kind" : "ForStmt", + "location" : [ 3, 1, 5, 1 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "iterable" : { + "kind" : "Identifier", + "location" : [ 3, 10, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 4, 5, 4, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 5, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 4, 11, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + } ] + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_for_str_same_var.py.ast.typed.s.result b/pa3-tests/core/stmt_for_str_same_var.py.ast.typed.s.result new file mode 100644 index 0000000..723425f --- /dev/null +++ b/pa3-tests/core/stmt_for_str_same_var.py.ast.typed.s.result @@ -0,0 +1,3 @@ +x +X +x diff --git a/pa3-tests/core/stmt_if.py b/pa3-tests/core/stmt_if.py new file mode 100644 index 0000000..61bc605 --- /dev/null +++ b/pa3-tests/core/stmt_if.py @@ -0,0 +1,7 @@ +if False: + print("No") +elif True: + if True: + print("Yes") +else: + pass diff --git a/pa3-tests/core/stmt_if.py.ast.typed b/pa3-tests/core/stmt_if.py.ast.typed new file mode 100644 index 0000000..0b67124 --- /dev/null +++ b/pa3-tests/core/stmt_if.py.ast.typed @@ -0,0 +1,125 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 1 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "IfStmt", + "location" : [ 1, 1, 8, 1 ], + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 1, 4, 1, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : false + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 2, 5, 2, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 2, 5, 2, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 2, 5, 2, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "No" + } ] + } + } ], + "elseBody" : [ { + "kind" : "IfStmt", + "location" : [ 3, 1, 8, 1 ], + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 3, 6, 3, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "thenBody" : [ { + "kind" : "IfStmt", + "location" : [ 4, 5, 6, 0 ], + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 4, 8, 4, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "thenBody" : [ { + "kind" : "ExprStmt", + "location" : [ 5, 9, 5, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 5, 9, 5, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 5, 9, 5, 13 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 5, 15, 5, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Yes" + } ] + } + } ], + "elseBody" : [ ] + } ], + "elseBody" : [ ] + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_if.py.ast.typed.s.result b/pa3-tests/core/stmt_if.py.ast.typed.s.result new file mode 100644 index 0000000..dcd7a5d --- /dev/null +++ b/pa3-tests/core/stmt_if.py.ast.typed.s.result @@ -0,0 +1 @@ +Yes diff --git a/pa3-tests/core/stmt_return_early.py b/pa3-tests/core/stmt_return_early.py new file mode 100644 index 0000000..267eab7 --- /dev/null +++ b/pa3-tests/core/stmt_return_early.py @@ -0,0 +1,6 @@ +def f() -> int: + while True: + return 1 + return 0 + +print(f()) diff --git a/pa3-tests/core/stmt_return_early.py.ast.typed b/pa3-tests/core/stmt_return_early.py.ast.typed new file mode 100644 index 0000000..4568349 --- /dev/null +++ b/pa3-tests/core/stmt_return_early.py.ast.typed @@ -0,0 +1,113 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 6, 11 ], + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 1, 1, 4, 13 ], + "name" : { + "kind" : "Identifier", + "location" : [ 1, 5, 1, 5 ], + "name" : "f" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 1, 12, 1, 14 ], + "className" : "int" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 2, 5, 4, 4 ], + "condition" : { + "kind" : "BooleanLiteral", + "location" : [ 2, 11, 2, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "value" : true + }, + "body" : [ { + "kind" : "ReturnStmt", + "location" : [ 3, 9, 3, 16 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 16, 3, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + }, { + "kind" : "ReturnStmt", + "location" : [ 4, 5, 4, 12 ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 12, 4, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 6, 1, 6, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 6, 1, 6, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 1, 6, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 6, 7, 6, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 6, 7, 6, 7 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "f" + }, + "args" : [ ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_return_early.py.ast.typed.s.result b/pa3-tests/core/stmt_return_early.py.ast.typed.s.result new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/pa3-tests/core/stmt_return_early.py.ast.typed.s.result @@ -0,0 +1 @@ +1 diff --git a/pa3-tests/core/stmt_while.py b/pa3-tests/core/stmt_while.py new file mode 100644 index 0000000..acb4d7a --- /dev/null +++ b/pa3-tests/core/stmt_while.py @@ -0,0 +1,4 @@ +x:int = 1 +while x < 10: + print(x) + x = x + 1 diff --git a/pa3-tests/core/stmt_while.py.ast.typed b/pa3-tests/core/stmt_while.py.ast.typed new file mode 100644 index 0000000..3802a75 --- /dev/null +++ b/pa3-tests/core/stmt_while.py.ast.typed @@ -0,0 +1,143 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 5, 1 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "statements" : [ { + "kind" : "WhileStmt", + "location" : [ 2, 1, 5, 1 ], + "condition" : { + "kind" : "BinaryExpr", + "location" : [ 2, 7, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 2, 7, 2, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "<", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 11, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 10 + } + }, + "body" : [ { + "kind" : "ExprStmt", + "location" : [ 3, 5, 3, 12 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 3, 5, 3, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 3, 11, 3, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 4, 5, 4, 13 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 4, 9, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 4, 9, 4, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 4, 13, 4, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } + } ] + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/stmt_while.py.ast.typed.s.result b/pa3-tests/core/stmt_while.py.ast.typed.s.result new file mode 100644 index 0000000..0719398 --- /dev/null +++ b/pa3-tests/core/stmt_while.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/pa3-tests/core/str_cat.py b/pa3-tests/core/str_cat.py new file mode 100644 index 0000000..f28db5e --- /dev/null +++ b/pa3-tests/core/str_cat.py @@ -0,0 +1,17 @@ +a:str = "Hello" +b:str = "World" +c:str = "ChocoPy" + +def cat2(a:str, b:str) -> str: + return a + b + +def cat3(a:str, b:str, c:str) -> str: + return a + b + c + +print(cat2(a, b)) +print(cat2("", c)) +print(cat3(a, " ", c)) +print(len(a)) +print(len(cat2(a,a))) +print(len(cat2("",""))) + diff --git a/pa3-tests/core/str_cat.py.ast.typed b/pa3-tests/core/str_cat.py.ast.typed new file mode 100644 index 0000000..1db5a86 --- /dev/null +++ b/pa3-tests/core/str_cat.py.ast.typed @@ -0,0 +1,738 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 24 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Hello" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "World" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "ChocoPy" + } + }, { + "kind" : "FuncDef", + "location" : [ 5, 1, 6, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 8 ], + "name" : "cat2" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 5, 10, 5, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 10, 5, 10 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 12, 5, 14 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 5, 17, 5, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 17, 5, 17 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 19, 5, 21 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 5, 27, 5, 29 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 6, 5, 6, 16 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 6, 12, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 6, 12, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 6, 16, 6, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 8, 1, 9, 21 ], + "name" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 8 ], + "name" : "cat3" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 8, 10, 8, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 10, 8, 10 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 12, 8, 14 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 8, 17, 8, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 17, 8, 17 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 19, 8, 21 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 8, 24, 8, 28 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 24, 8, 24 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 26, 8, 28 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 8, 34, 8, 36 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 5, 9, 20 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 9, 12, 9, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 9, 12, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 9, 12, 9, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 9, 16, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 9, 20, 9, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 17 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 11, 7, 11, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 7, 11, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 11, 15, 11, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 12, 1, 12, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 1, 12, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 1, 12, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 12, 7, 12, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 7, 12, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 12, 12, 12, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + }, { + "kind" : "Identifier", + "location" : [ 12, 16, 12, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 1, 13, 22 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 1, 13, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 13, 7, 13, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 7, 13, 10 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat3" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 13, 12, 13, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "StringLiteral", + "location" : [ 13, 15, 13, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : " " + }, { + "kind" : "Identifier", + "location" : [ 13, 20, 13, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 13 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 14, 7, 14, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 11, 14, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 15, 7, 15, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 15, 11, 15, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 11, 15, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 16, 15, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 15, 18, 15, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 23 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 23 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 16, 7, 16, 22 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 16, 11, 16, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 11, 16, 14 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 16, 16, 16, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + }, { + "kind" : "StringLiteral", + "location" : [ 16, 19, 16, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } ] + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_cat.py.ast.typed.s.result b/pa3-tests/core/str_cat.py.ast.typed.s.result new file mode 100644 index 0000000..b2e262a --- /dev/null +++ b/pa3-tests/core/str_cat.py.ast.typed.s.result @@ -0,0 +1,6 @@ +HelloWorld +ChocoPy +Hello ChocoPy +5 +10 +0 diff --git a/pa3-tests/core/str_cat_2.py b/pa3-tests/core/str_cat_2.py new file mode 100644 index 0000000..f8367c0 --- /dev/null +++ b/pa3-tests/core/str_cat_2.py @@ -0,0 +1,19 @@ +a:str = "no" +b:str = "o" +c:str = "" +d:str = "" +e:str = "" + +def cat2(a:str, b:str) -> str: + return a + b + +def cat3(a:str, b:str, c:str) -> str: + return a + b + c + +c = cat2(b, a) +d = cat2(a, a) +e = cat3(a, b, cat2(b, b)) + +print(c) +print(d) +print(e) diff --git a/pa3-tests/core/str_cat_2.py.ast.typed b/pa3-tests/core/str_cat_2.py.ast.typed new file mode 100644 index 0000000..543fa96 --- /dev/null +++ b/pa3-tests/core/str_cat_2.py.ast.typed @@ -0,0 +1,638 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 19, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 12 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "no" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "o" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 4, 1, 4, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 1, 4, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "name" : "d" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 3, 4, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 4, 9, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 5, 1, 5, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 5, 1, 5, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 1, 5, 1 ], + "name" : "e" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 3, 5, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 5, 9, 5, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "FuncDef", + "location" : [ 7, 1, 8, 17 ], + "name" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 8 ], + "name" : "cat2" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 7, 10, 7, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 10, 7, 10 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 12, 7, 14 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 7, 17, 7, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 17, 7, 17 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 19, 7, 21 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 7, 27, 7, 29 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 8, 5, 8, 16 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 8, 12, 8, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 8, 12, 8, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 8, 16, 8, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 10, 1, 11, 21 ], + "name" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 8 ], + "name" : "cat3" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 10, 10, 10, 14 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 10, 10, 10 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 12, 10, 14 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 10, 17, 10, 21 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 17, 10, 17 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 19, 10, 21 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 10, 24, 10, 28 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 10, 24, 10, 24 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 10, 26, 10, 28 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 10, 34, 10, 36 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 11, 5, 11, 20 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 11, 12, 11, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "BinaryExpr", + "location" : [ 11, 12, 11, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 11, 16, 11, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 11, 20, 11, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 13, 1, 13, 14 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 13, 5, 13, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 5, 13, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 13, 10, 13, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + }, { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 14, 1, 14, 14 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "d" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 14, 5, 14, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 5, 14, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 10, 14, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 14, 13, 14, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 15, 1, 15, 26 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "e" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 15, 5, 15, 26 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 5, 15, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat3" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 10, 15, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 15, 13, 15, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + }, { + "kind" : "CallExpr", + "location" : [ 15, 16, 15, 25 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 16, 15, 19 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "cat2" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 21, 15, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + }, { + "kind" : "Identifier", + "location" : [ 15, 24, 15, 24 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 17, 1, 17, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 17, 1, 17, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 17, 1, 17, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 17, 7, 17, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 18, 1, 18, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 18, 1, 18, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 18, 1, 18, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 18, 7, 18, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "d" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 19, 1, 19, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 19, 1, 19, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 19, 1, 19, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 19, 7, 19, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "e" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_cat_2.py.ast.typed.s.result b/pa3-tests/core/str_cat_2.py.ast.typed.s.result new file mode 100644 index 0000000..2f6ff88 --- /dev/null +++ b/pa3-tests/core/str_cat_2.py.ast.typed.s.result @@ -0,0 +1,3 @@ +ono +nono +noooo diff --git a/pa3-tests/core/str_cmp.py b/pa3-tests/core/str_cmp.py new file mode 100644 index 0000000..9258cd9 --- /dev/null +++ b/pa3-tests/core/str_cmp.py @@ -0,0 +1,17 @@ +a:str = "Hello" +b:str = "World" +c:str = "ChocoPy" + +def eq(a:str, b:str) -> bool: + return a == b + +def neq(a:str, b:str) -> bool: + return a != b + +print(eq(a,a)) +print(eq(a,b)) +print(neq(a,b)) +print(neq(b,b)) +print(eq(c,a)) +print(neq(c,b)) + diff --git a/pa3-tests/core/str_cmp.py.ast.typed b/pa3-tests/core/str_cmp.py.ast.typed new file mode 100644 index 0000000..b185ac1 --- /dev/null +++ b/pa3-tests/core/str_cmp.py.ast.typed @@ -0,0 +1,659 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 16, 16 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "Hello" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "World" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "ChocoPy" + } + }, { + "kind" : "FuncDef", + "location" : [ 5, 1, 6, 18 ], + "name" : { + "kind" : "Identifier", + "location" : [ 5, 5, 5, 6 ], + "name" : "eq" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 5, 8, 5, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 8, 5, 8 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 10, 5, 12 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 5, 15, 5, 19 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 5, 15, 5, 15 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 5, 17, 5, 19 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 5, 25, 5, 28 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 6, 5, 6, 17 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 6, 12, 6, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 6, 12, 6, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "==", + "right" : { + "kind" : "Identifier", + "location" : [ 6, 17, 6, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + } + } ] + }, { + "kind" : "FuncDef", + "location" : [ 8, 1, 9, 18 ], + "name" : { + "kind" : "Identifier", + "location" : [ 8, 5, 8, 7 ], + "name" : "neq" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 8, 9, 8, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 9 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 11, 8, 13 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 8, 16, 8, 20 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 8, 16, 8, 16 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 8, 18, 8, 20 ], + "className" : "str" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 8, 26, 8, 29 ], + "className" : "bool" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 5, 9, 17 ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 9, 12, 9, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "left" : { + "kind" : "Identifier", + "location" : [ 9, 12, 9, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, + "operator" : "!=", + "right" : { + "kind" : "Identifier", + "location" : [ 9, 17, 9, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } + } + } ] + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 11, 1, 11, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 11, 1, 11, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 11, 7, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 7, 11, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "eq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 11, 10, 11, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 11, 12, 11, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 12, 1, 12, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 1, 12, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 1, 12, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 12, 7, 12, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 7, 12, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "eq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 12, 10, 12, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 12, 12, 12, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 1, 13, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 1, 13, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 13, 7, 13, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 7, 13, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "neq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 13, 11, 13, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + }, { + "kind" : "Identifier", + "location" : [ 13, 13, 13, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 14, 7, 14, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "neq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 11, 14, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + }, { + "kind" : "Identifier", + "location" : [ 14, 13, 14, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 15, 1, 15, 14 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 15, 1, 15, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 1, 15, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 15, 7, 15, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 15, 7, 15, 8 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "eq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 15, 10, 15, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + }, { + "kind" : "Identifier", + "location" : [ 15, 12, 15, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 16, 1, 16, 15 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 16, 1, 16, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 1, 16, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 16, 7, 16, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "bool" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 16, 7, 16, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "str" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "bool" + } + }, + "name" : "neq" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 16, 11, 16, 11 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + }, { + "kind" : "Identifier", + "location" : [ 16, 13, 16, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_cmp.py.ast.typed.s.result b/pa3-tests/core/str_cmp.py.ast.typed.s.result new file mode 100644 index 0000000..72232fd --- /dev/null +++ b/pa3-tests/core/str_cmp.py.ast.typed.s.result @@ -0,0 +1,6 @@ +True +False +True +False +False +True diff --git a/pa3-tests/core/str_get_element.py b/pa3-tests/core/str_get_element.py new file mode 100644 index 0000000..8681a05 --- /dev/null +++ b/pa3-tests/core/str_get_element.py @@ -0,0 +1,14 @@ +x:str = "abc" +a:str = "" +b:str = "" +c:str = "" + +def str_get(s:str, i:int) -> str: + return s[i] + +a = str_get(x, 0) +b = str_get(x, 1) +c = str_get(x, 2) +print(a) +print(b) +print(c) diff --git a/pa3-tests/core/str_get_element.py.ast.typed b/pa3-tests/core/str_get_element.py.ast.typed new file mode 100644 index 0000000..ff9c449 --- /dev/null +++ b/pa3-tests/core/str_get_element.py.ast.typed @@ -0,0 +1,462 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 14, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 3, 1, 3, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 3, 1, 3, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "name" : "b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 3, 3, 3, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 3, 9, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 4, 1, 4, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 4, 1, 4, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 1 ], + "name" : "c" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 3, 4, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 4, 9, 4, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "FuncDef", + "location" : [ 6, 1, 7, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 6, 5, 6, 11 ], + "name" : "str_get" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 6, 13, 6, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 13, 6, 13 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 6, 15, 6, 17 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 6, 20, 6, 24 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 6, 20, 6, 20 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 6, 22, 6, 24 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 6, 30, 6, 32 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 7, 5, 7, 15 ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 7, 12, 7, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 7, 12, 7, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 7, 14, 7, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 9, 1, 9, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 9, 1, 9, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 9, 5, 9, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 9, 5, 9, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 9, 13, 9, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "IntegerLiteral", + "location" : [ 9, 16, 9, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 10, 1, 10, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 10, 1, 10, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 10, 5, 10, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 10, 5, 10, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 10, 13, 10, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "IntegerLiteral", + "location" : [ 10, 16, 10, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 11, 1, 11, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 11, 1, 11, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 11, 5, 11, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 11, 5, 11, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 11, 13, 11, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "IntegerLiteral", + "location" : [ 11, 16, 11, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 2 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 12, 1, 12, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 12, 1, 12, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 12, 1, 12, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 12, 7, 12, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 13, 1, 13, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 13, 1, 13, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 13, 1, 13, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 13, 7, 13, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "b" + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 14, 1, 14, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 14, 1, 14, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 14, 1, 14, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 14, 7, 14, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "c" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_get_element.py.ast.typed.s.result b/pa3-tests/core/str_get_element.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/pa3-tests/core/str_get_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/pa3-tests/core/str_get_element_oob_1.py b/pa3-tests/core/str_get_element_oob_1.py new file mode 100644 index 0000000..b6613d1 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_1.py @@ -0,0 +1,8 @@ +x:str = "abc" +a:str = "" + +def str_get(s:str, i:int) -> str: + return s[i] + +a = str_get(x, -1) +print(a) diff --git a/pa3-tests/core/str_get_element_oob_1.py.ast.typed b/pa3-tests/core/str_get_element_oob_1.py.ast.typed new file mode 100644 index 0000000..4ce2733 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_1.py.ast.typed @@ -0,0 +1,235 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 1, 5, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 11 ], + "name" : "str_get" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 13 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 15, 4, 17 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 20, 4, 24 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 20, 4, 20 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 22, 4, 24 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 32 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 5, 5, 15 ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 5, 12, 5, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 5, 14, 5, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 1, 7, 18 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 18 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "UnaryExpr", + "location" : [ 7, 16, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 7, 17, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 7, 8, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_get_element_oob_1.py.ast.typed.s.result b/pa3-tests/core/str_get_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_1.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/str_get_element_oob_2.py b/pa3-tests/core/str_get_element_oob_2.py new file mode 100644 index 0000000..4c4e0e0 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_2.py @@ -0,0 +1,8 @@ +x:str = "abc" +a:str = "" + +def str_get(s:str, i:int) -> str: + return s[i] + +a = str_get(x, 3) +print(a) diff --git a/pa3-tests/core/str_get_element_oob_2.py.ast.typed b/pa3-tests/core/str_get_element_oob_2.py.ast.typed new file mode 100644 index 0000000..3a10e59 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_2.py.ast.typed @@ -0,0 +1,226 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 13 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "abc" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 1, 5, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 11 ], + "name" : "str_get" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 13 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 15, 4, 17 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 20, 4, 24 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 20, 4, 20 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 22, 4, 24 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 32 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 5, 5, 15 ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 5, 12, 5, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 5, 14, 5, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 1, 7, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 16, 7, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 3 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 7, 8, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_get_element_oob_2.py.ast.typed.s.result b/pa3-tests/core/str_get_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_2.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/str_get_element_oob_3.py b/pa3-tests/core/str_get_element_oob_3.py new file mode 100644 index 0000000..28e545a --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_3.py @@ -0,0 +1,8 @@ +x:str = "" +a:str = "" + +def str_get(s:str, i:int) -> str: + return s[i] + +a = str_get(x, 0) +print(a) diff --git a/pa3-tests/core/str_get_element_oob_3.py.ast.typed b/pa3-tests/core/str_get_element_oob_3.py.ast.typed new file mode 100644 index 0000000..bac1f18 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_3.py.ast.typed @@ -0,0 +1,226 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 8, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 1, 9, 1, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 10 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "a" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 5 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 2, 9, 2, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "" + } + }, { + "kind" : "FuncDef", + "location" : [ 4, 1, 5, 16 ], + "name" : { + "kind" : "Identifier", + "location" : [ 4, 5, 4, 11 ], + "name" : "str_get" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 4, 13, 4, 17 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 13, 4, 13 ], + "name" : "s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 15, 4, 17 ], + "className" : "str" + } + }, { + "kind" : "TypedVar", + "location" : [ 4, 20, 4, 24 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 4, 20, 4, 20 ], + "name" : "i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 4, 22, 4, 24 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 4, 30, 4, 32 ], + "className" : "str" + }, + "declarations" : [ ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 5, 5, 5, 15 ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 5, 12, 5, 15 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "list" : { + "kind" : "Identifier", + "location" : [ 5, 12, 5, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "s" + }, + "index" : { + "kind" : "Identifier", + "location" : [ 5, 14, 5, 14 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "i" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 7, 1, 7, 17 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 7, 1, 7, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 7, 5, 7, 17 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 7, 5, 7, 11 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "str" + }, { + "kind" : "ClassValueType", + "className" : "int" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "str" + } + }, + "name" : "str_get" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 13 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "x" + }, { + "kind" : "IntegerLiteral", + "location" : [ 7, 16, 7, 16 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } ] + } + }, { + "kind" : "ExprStmt", + "location" : [ 8, 1, 8, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 8, 1, 8, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 8, 1, 8, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 8, 7, 8, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "name" : "a" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_get_element_oob_3.py.ast.typed.s.result b/pa3-tests/core/str_get_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/pa3-tests/core/str_get_element_oob_3.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Index out of bounds +Exited with error code 3 diff --git a/pa3-tests/core/str_len.py b/pa3-tests/core/str_len.py new file mode 100644 index 0000000..829f00b --- /dev/null +++ b/pa3-tests/core/str_len.py @@ -0,0 +1 @@ +print(len("ChocoPy")) diff --git a/pa3-tests/core/str_len.py.ast.typed b/pa3-tests/core/str_len.py.ast.typed new file mode 100644 index 0000000..d76359c --- /dev/null +++ b/pa3-tests/core/str_len.py.ast.typed @@ -0,0 +1,71 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 1, 22 ], + "declarations" : [ ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 1, 1, 1, 21 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 1, 1, 1, 21 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "CallExpr", + "location" : [ 1, 7, 1, 20 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 1, 7, 1, 9 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "int" + } + }, + "name" : "len" + }, + "args" : [ { + "kind" : "StringLiteral", + "location" : [ 1, 11, 1, 19 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "str" + }, + "value" : "ChocoPy" + } ] + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/str_len.py.ast.typed.s.result b/pa3-tests/core/str_len.py.ast.typed.s.result new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/pa3-tests/core/str_len.py.ast.typed.s.result @@ -0,0 +1 @@ +7 diff --git a/pa3-tests/core/var_assign.py b/pa3-tests/core/var_assign.py new file mode 100644 index 0000000..c56b7ca --- /dev/null +++ b/pa3-tests/core/var_assign.py @@ -0,0 +1,4 @@ +x:int = 0 +y:object = 1 +x = y = 42 +print(x) diff --git a/pa3-tests/core/var_assign.py.ast.typed b/pa3-tests/core/var_assign.py.ast.typed new file mode 100644 index 0000000..83fb4c4 --- /dev/null +++ b/pa3-tests/core/var_assign.py.ast.typed @@ -0,0 +1,128 @@ +{ + "kind" : "Program", + "location" : [ 1, 1, 4, 9 ], + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 1, 1, 1, 9 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 1, 1, 1, 5 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 1, 1, 1, 1 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 1, 3, 1, 5 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 1, 9, 1, 9 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 2, 1, 2, 12 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 2, 1, 2, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 2, 1, 2, 1 ], + "name" : "y" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 2, 3, 2, 8 ], + "className" : "object" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 2, 12, 2, 12 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 1 + } + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 3, 1, 3, 10 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 3, 1, 3, 1 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + }, { + "kind" : "Identifier", + "location" : [ 3, 5, 3, 5 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "object" + }, + "name" : "y" + } ], + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 3, 9, 3, 10 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "value" : 42 + } + }, { + "kind" : "ExprStmt", + "location" : [ 4, 1, 4, 8 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 4, 1, 4, 8 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "" + }, + "function" : { + "kind" : "Identifier", + "location" : [ 4, 1, 4, 5 ], + "inferredType" : { + "kind" : "FuncType", + "parameters" : [ { + "kind" : "ClassValueType", + "className" : "object" + } ], + "returnType" : { + "kind" : "ClassValueType", + "className" : "" + } + }, + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 4, 7, 4, 7 ], + "inferredType" : { + "kind" : "ClassValueType", + "className" : "int" + }, + "name" : "x" + } ] + } + } ], + "errors" : { + "errors" : [ ], + "kind" : "Errors", + "location" : [ 0, 0, 0, 0 ] + } +} \ No newline at end of file diff --git a/pa3-tests/core/var_assign.py.ast.typed.s.result b/pa3-tests/core/var_assign.py.ast.typed.s.result new file mode 100644 index 0000000..d81cc07 --- /dev/null +++ b/pa3-tests/core/var_assign.py.ast.typed.s.result @@ -0,0 +1 @@ +42 diff --git a/pa3-tests/run-tests.sh b/pa3-tests/run-tests.sh new file mode 100755 index 0000000..24a51be --- /dev/null +++ b/pa3-tests/run-tests.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +JAVA="java -cp pa3-tests/chocopy-ref.jar:target/assignment.jar chocopy.ChocoPy" + +echo "# CORE TESTS" +${JAVA} --pass=..s --test --run --dir pa3-tests/core + +echo +echo "# BENCHMARK CORRECTNESS TESTS" +${JAVA} --pass=..s --test --run --dir pa3-tests/benchmarks + +echo +echo "# BENCHMARK PERFORMANCE TESTS" +${JAVA} --pass=..s --run --profile --dir pa3-tests/benchmarks | grep -e Reading -e Cycles