From 9f1681bb23de87471ce65951a2b7713cf43de5f9 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:11:58 +0000 Subject: [PATCH] Initial commit --- .gitignore | 149 + LICENSE | 26 + README.md | 52 + chocopy-ref.jar | Bin 0 -> 144814 bytes pom.xml | 330 ++ src/main/asm/chocopy/common/abort.s | 12 + src/main/asm/chocopy/common/alloc.s | 4 + src/main/asm/chocopy/common/alloc2.s | 27 + src/main/asm/chocopy/common/heap.init.s | 5 + src/main/asm/chocopy/common/input.s | 40 + src/main/asm/chocopy/common/len.s | 20 + src/main/asm/chocopy/common/object.__init__.s | 3 + src/main/asm/chocopy/common/print.s | 52 + src/main/java/chocopy/common/Utils.java | 54 + .../common/analysis/AbstractNodeAnalyzer.java | 174 + .../chocopy/common/analysis/NodeAnalyzer.java | 93 + .../chocopy/common/analysis/SymbolTable.java | 62 + .../common/analysis/types/ClassValueType.java | 53 + .../common/analysis/types/FuncType.java | 45 + .../common/analysis/types/ListValueType.java | 57 + .../chocopy/common/analysis/types/Type.java | 68 + .../common/analysis/types/ValueType.java | 29 + .../chocopy/common/astnodes/AssignStmt.java | 25 + .../chocopy/common/astnodes/BinaryExpr.java | 31 + .../common/astnodes/BooleanLiteral.java | 21 + .../chocopy/common/astnodes/CallExpr.java | 26 + .../chocopy/common/astnodes/ClassDef.java | 39 + .../chocopy/common/astnodes/ClassType.java | 21 + .../common/astnodes/CompilerError.java | 56 + .../chocopy/common/astnodes/Declaration.java | 17 + .../java/chocopy/common/astnodes/Errors.java | 71 + .../java/chocopy/common/astnodes/Expr.java | 43 + .../chocopy/common/astnodes/ExprStmt.java | 21 + .../java/chocopy/common/astnodes/ForStmt.java | 29 + .../java/chocopy/common/astnodes/FuncDef.java | 50 + .../chocopy/common/astnodes/GlobalDecl.java | 26 + .../chocopy/common/astnodes/Identifier.java | 24 + .../java/chocopy/common/astnodes/IfExpr.java | 26 + .../java/chocopy/common/astnodes/IfStmt.java | 35 + .../chocopy/common/astnodes/IndexExpr.java | 24 + .../common/astnodes/IntegerLiteral.java | 21 + .../chocopy/common/astnodes/ListExpr.java | 23 + .../chocopy/common/astnodes/ListType.java | 21 + .../java/chocopy/common/astnodes/Literal.java | 16 + .../chocopy/common/astnodes/MemberExpr.java | 24 + .../common/astnodes/MethodCallExpr.java | 26 + .../java/chocopy/common/astnodes/Node.java | 176 ++ .../chocopy/common/astnodes/NonLocalDecl.java | 26 + .../chocopy/common/astnodes/NoneLiteral.java | 17 + .../java/chocopy/common/astnodes/Program.java | 56 + .../chocopy/common/astnodes/ReturnStmt.java | 21 + .../java/chocopy/common/astnodes/Stmt.java | 18 + .../common/astnodes/StringLiteral.java | 21 + .../common/astnodes/TypeAnnotation.java | 11 + .../chocopy/common/astnodes/TypedVar.java | 24 + .../chocopy/common/astnodes/UnaryExpr.java | 24 + .../java/chocopy/common/astnodes/VarDef.java | 32 + .../chocopy/common/astnodes/WhileStmt.java | 25 + .../java/chocopy/common/codegen/AttrInfo.java | 16 + .../chocopy/common/codegen/ClassInfo.java | 123 + .../chocopy/common/codegen/CodeGenBase.java | 880 ++++++ .../chocopy/common/codegen/Constants.java | 116 + .../java/chocopy/common/codegen/FuncInfo.java | 206 ++ .../chocopy/common/codegen/GlobalVarInfo.java | 28 + .../java/chocopy/common/codegen/Label.java | 40 + .../chocopy/common/codegen/RiscVBackend.java | 606 ++++ .../chocopy/common/codegen/StackVarInfo.java | 27 + .../chocopy/common/codegen/SymbolInfo.java | 7 + .../java/chocopy/common/codegen/VarInfo.java | 40 + src/main/java/chocopy/pa3/CodeGenImpl.java | 187 ++ src/main/java/chocopy/pa3/StudentCodeGen.java | 34 + src/test/data/pa3/benchmarks/exp.py | 25 + src/test/data/pa3/benchmarks/exp.py.ast.typed | 562 ++++ .../pa3/benchmarks/exp.py.ast.typed.s.result | 43 + src/test/data/pa3/benchmarks/prime.py | 30 + .../data/pa3/benchmarks/prime.py.ast.typed | 658 ++++ .../benchmarks/prime.py.ast.typed.s.result | 15 + src/test/data/pa3/benchmarks/sieve.py | 107 + .../data/pa3/benchmarks/sieve.py.ast.typed | 2816 +++++++++++++++++ .../benchmarks/sieve.py.ast.typed.s.result | 15 + src/test/data/pa3/benchmarks/stdlib.py | 77 + .../data/pa3/benchmarks/stdlib.py.ast.typed | 1813 +++++++++++ .../benchmarks/stdlib.py.ast.typed.s.result | 21 + src/test/data/pa3/benchmarks/tree.py | 83 + .../data/pa3/benchmarks/tree.py.ast.typed | 2301 ++++++++++++++ .../pa3/benchmarks/tree.py.ast.typed.s.result | 4 + src/test/data/pa3/sample/call.py | 17 + src/test/data/pa3/sample/call.py.ast.typed | 386 +++ .../pa3/sample/call.py.ast.typed.s.result | 7 + src/test/data/pa3/sample/call_with_args.py | 19 + .../pa3/sample/call_with_args.py.ast.typed | 554 ++++ .../call_with_args.py.ast.typed.s.result | 9 + src/test/data/pa3/sample/error_div_zero.py | 1 + .../pa3/sample/error_div_zero.py.ast.typed | 65 + .../error_div_zero.py.ast.typed.s.result | 2 + .../data/pa3/sample/error_invalid_print.py | 1 + .../sample/error_invalid_print.py.ast.typed | 46 + .../error_invalid_print.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/error_mod_zero.py | 1 + .../pa3/sample/error_mod_zero.py.ast.typed | 65 + .../error_mod_zero.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/expr_if.py | 2 + src/test/data/pa3/sample/expr_if.py.ast.typed | 135 + .../pa3/sample/expr_if.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/id_global.py | 2 + .../data/pa3/sample/id_global.py.ast.typed | 73 + .../sample/id_global.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/id_local.py | 5 + .../data/pa3/sample/id_local.py.ast.typed | 114 + .../pa3/sample/id_local.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/input.py | 8 + src/test/data/pa3/sample/input.py.ast.in | 4 + src/test/data/pa3/sample/input.py.ast.typed | 196 ++ .../data/pa3/sample/input.py.ast.typed.in | 4 + .../pa3/sample/input.py.ast.typed.s.result | 8 + src/test/data/pa3/sample/input.py.in | 4 + src/test/data/pa3/sample/len_invalid_1.py | 3 + .../pa3/sample/len_invalid_1.py.ast.typed | 103 + .../len_invalid_1.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/len_invalid_2.py | 3 + .../pa3/sample/len_invalid_2.py.ast.typed | 97 + .../len_invalid_2.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/list_concat.py | 12 + .../data/pa3/sample/list_concat.py.ast.typed | 437 +++ .../sample/list_concat.py.ast.typed.s.result | 6 + src/test/data/pa3/sample/list_concat_2.py | 8 + .../pa3/sample/list_concat_2.py.ast.typed | 366 +++ .../list_concat_2.py.ast.typed.s.result | 9 + src/test/data/pa3/sample/list_concat_none.py | 4 + .../pa3/sample/list_concat_none.py.ast.typed | 156 + .../list_concat_none.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/list_get_element.py | 6 + .../pa3/sample/list_get_element.py.ast.typed | 259 ++ .../list_get_element.py.ast.typed.s.result | 3 + .../pa3/sample/list_get_element_complex.py | 11 + .../list_get_element_complex.py.ast.typed | 313 ++ ..._get_element_complex.py.ast.typed.s.result | 1 + .../data/pa3/sample/list_get_element_none.py | 3 + .../sample/list_get_element_none.py.ast.typed | 96 + ...ist_get_element_none.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_get_element_oob_1.py | 4 + .../list_get_element_oob_1.py.ast.typed | 156 + ...st_get_element_oob_1.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_get_element_oob_2.py | 4 + .../list_get_element_oob_2.py.ast.typed | 147 + ...st_get_element_oob_2.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_get_element_oob_3.py | 4 + .../list_get_element_oob_3.py.ast.typed | 120 + ...st_get_element_oob_3.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/list_len.py | 4 + .../data/pa3/sample/list_len.py.ast.typed | 154 + .../pa3/sample/list_len.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/list_len_empty.py | 4 + .../pa3/sample/list_len_empty.py.ast.typed | 127 + .../list_len_empty.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/list_set_element.py | 9 + .../pa3/sample/list_set_element.py.ast.typed | 382 +++ .../list_set_element.py.ast.typed.s.result | 3 + .../data/pa3/sample/list_set_element_none.py | 4 + .../sample/list_set_element_none.py.ast.typed | 81 + ...ist_set_element_none.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_set_element_oob_1.py | 7 + .../list_set_element_oob_1.py.ast.typed | 309 ++ ...st_set_element_oob_1.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_set_element_oob_2.py | 7 + .../list_set_element_oob_2.py.ast.typed | 300 ++ ...st_set_element_oob_2.py.ast.typed.s.result | 2 + .../data/pa3/sample/list_set_element_oob_3.py | 4 + .../list_set_element_oob_3.py.ast.typed | 105 + ...st_set_element_oob_3.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/literal_bool.py | 2 + .../data/pa3/sample/literal_bool.py.ast.typed | 83 + .../sample/literal_bool.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/literal_int.py | 2 + .../data/pa3/sample/literal_int.py.ast.typed | 83 + .../sample/literal_int.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/literal_str.py | 1 + .../data/pa3/sample/literal_str.py.ast.typed | 47 + .../sample/literal_str.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/nested.py | 11 + src/test/data/pa3/sample/nested.py.ast.typed | 272 ++ .../pa3/sample/nested.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/nested2.py | 14 + src/test/data/pa3/sample/nested2.py.ast.typed | 337 ++ .../pa3/sample/nested2.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/object_attr_get.py | 16 + .../pa3/sample/object_attr_get.py.ast.typed | 387 +++ .../object_attr_get.py.ast.typed.s.result | 4 + .../data/pa3/sample/object_attr_get_none.py | 16 + .../sample/object_attr_get_none.py.ast.typed | 379 +++ ...object_attr_get_none.py.ast.typed.s.result | 4 + src/test/data/pa3/sample/object_attr_set.py | 18 + .../pa3/sample/object_attr_set.py.ast.typed | 455 +++ .../object_attr_set.py.ast.typed.s.result | 4 + .../pa3/sample/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 + .../data/pa3/sample/object_attr_set_none.py | 19 + .../sample/object_attr_set_none.py.ast.typed | 447 +++ ...object_attr_set_none.py.ast.typed.s.result | 4 + src/test/data/pa3/sample/object_init.py | 11 + .../data/pa3/sample/object_init.py.ast.typed | 173 + .../sample/object_init.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/object_method.py | 16 + .../pa3/sample/object_method.py.ast.typed | 387 +++ .../object_method.py.ast.typed.s.result | 2 + .../pa3/sample/object_method_complex_call.py | 19 + .../object_method_complex_call.py.ast.typed | 492 +++ ..._method_complex_call.py.ast.typed.s.result | 3 + .../data/pa3/sample/object_method_nested.py | 18 + .../sample/object_method_nested.py.ast.typed | 439 +++ ...object_method_nested.py.ast.typed.s.result | 2 + .../data/pa3/sample/object_method_none.py | 17 + .../sample/object_method_none.py.ast.typed | 412 +++ .../object_method_none.py.ast.typed.s.result | 3 + .../data/pa3/sample/object_method_override.py | 19 + .../object_method_override.py.ast.typed | 441 +++ ...ject_method_override.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/op_add.py | 1 + src/test/data/pa3/sample/op_add.py.ast.typed | 65 + .../pa3/sample/op_add.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/op_cmp_bool.py | 8 + .../data/pa3/sample/op_cmp_bool.py.ast.typed | 443 +++ .../sample/op_cmp_bool.py.ast.typed.s.result | 8 + src/test/data/pa3/sample/op_cmp_int.py | 16 + .../data/pa3/sample/op_cmp_int.py.ast.typed | 711 +++++ .../sample/op_cmp_int.py.ast.typed.s.result | 12 + src/test/data/pa3/sample/op_div_mod.py | 5 + .../data/pa3/sample/op_div_mod.py.ast.typed | 171 + .../sample/op_div_mod.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/op_is.py | 19 + src/test/data/pa3/sample/op_is.py.ast.typed | 598 ++++ .../pa3/sample/op_is.py.ast.typed.s.result | 7 + src/test/data/pa3/sample/op_logical.py | 13 + .../data/pa3/sample/op_logical.py.ast.typed | 411 +++ .../sample/op_logical.py.ast.typed.s.result | 6 + src/test/data/pa3/sample/op_mul.py | 1 + src/test/data/pa3/sample/op_mul.py.ast.typed | 83 + .../pa3/sample/op_mul.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/op_negate.py | 2 + .../data/pa3/sample/op_negate.py.ast.typed | 82 + .../sample/op_negate.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/op_sub.py | 1 + src/test/data/pa3/sample/op_sub.py.ast.typed | 65 + .../pa3/sample/op_sub.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/pass.py | 1 + src/test/data/pa3/sample/pass.py.ast.typed | 11 + .../pa3/sample/pass.py.ast.typed.s.result | 0 .../data/pa3/sample/predef_constructors.py | 4 + .../sample/predef_constructors.py.ast.typed | 192 ++ .../predef_constructors.py.ast.typed.s.result | 4 + src/test/data/pa3/sample/stmt_for_list.py | 7 + .../pa3/sample/stmt_for_list.py.ast.typed | 178 ++ .../stmt_for_list.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_list_empty.py | 12 + .../sample/stmt_for_list_empty.py.ast.typed | 318 ++ .../stmt_for_list_empty.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_list_eval.py | 8 + .../sample/stmt_for_list_eval.py.ast.typed | 202 ++ .../stmt_for_list_eval.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_list_modify.py | 8 + .../sample/stmt_for_list_modify.py.ast.typed | 219 ++ ...stmt_for_list_modify.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_list_nested.py | 9 + .../sample/stmt_for_list_nested.py.ast.typed | 247 ++ ...stmt_for_list_nested.py.ast.typed.s.result | 9 + .../sample/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 + .../data/pa3/sample/stmt_for_list_none.py | 5 + .../sample/stmt_for_list_none.py.ast.typed | 127 + .../stmt_for_list_none.py.ast.typed.s.result | 2 + .../data/pa3/sample/stmt_for_list_nonlocal.py | 15 + .../stmt_for_list_nonlocal.py.ast.typed | 408 +++ ...mt_for_list_nonlocal.py.ast.typed.s.result | 1 + .../data/pa3/sample/stmt_for_list_return.py | 8 + .../sample/stmt_for_list_return.py.ast.typed | 241 ++ ...stmt_for_list_return.py.ast.typed.s.result | 3 + src/test/data/pa3/sample/stmt_for_str.py | 5 + .../data/pa3/sample/stmt_for_str.py.ast.typed | 121 + .../sample/stmt_for_str.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_str_empty.py | 8 + .../sample/stmt_for_str_empty.py.ast.typed | 205 ++ .../stmt_for_str_empty.py.ast.typed.s.result | 3 + src/test/data/pa3/sample/stmt_for_str_eval.py | 6 + .../pa3/sample/stmt_for_str_eval.py.ast.typed | 142 + .../stmt_for_str_eval.py.ast.typed.s.result | 3 + .../data/pa3/sample/stmt_for_str_nested.py | 8 + .../sample/stmt_for_str_nested.py.ast.typed | 205 ++ .../stmt_for_str_nested.py.ast.typed.s.result | 12 + .../data/pa3/sample/stmt_for_str_same_var.py | 4 + .../sample/stmt_for_str_same_var.py.ast.typed | 95 + ...tmt_for_str_same_var.py.ast.typed.s.result | 3 + src/test/data/pa3/sample/stmt_if.py | 7 + src/test/data/pa3/sample/stmt_if.py.ast.typed | 125 + .../pa3/sample/stmt_if.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/stmt_return_early.py | 6 + .../pa3/sample/stmt_return_early.py.ast.typed | 113 + .../stmt_return_early.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/stmt_while.py | 4 + .../data/pa3/sample/stmt_while.py.ast.typed | 143 + .../sample/stmt_while.py.ast.typed.s.result | 9 + src/test/data/pa3/sample/str_cat.py | 17 + src/test/data/pa3/sample/str_cat.py.ast.typed | 738 +++++ .../pa3/sample/str_cat.py.ast.typed.s.result | 6 + src/test/data/pa3/sample/str_cat_2.py | 19 + .../data/pa3/sample/str_cat_2.py.ast.typed | 638 ++++ .../sample/str_cat_2.py.ast.typed.s.result | 3 + src/test/data/pa3/sample/str_cmp.py | 17 + src/test/data/pa3/sample/str_cmp.py.ast.typed | 659 ++++ .../pa3/sample/str_cmp.py.ast.typed.s.result | 6 + src/test/data/pa3/sample/str_get_element.py | 14 + .../pa3/sample/str_get_element.py.ast.typed | 462 +++ .../str_get_element.py.ast.typed.s.result | 3 + .../data/pa3/sample/str_get_element_oob_1.py | 8 + .../sample/str_get_element_oob_1.py.ast.typed | 235 ++ ...tr_get_element_oob_1.py.ast.typed.s.result | 2 + .../data/pa3/sample/str_get_element_oob_2.py | 8 + .../sample/str_get_element_oob_2.py.ast.typed | 226 ++ ...tr_get_element_oob_2.py.ast.typed.s.result | 2 + .../data/pa3/sample/str_get_element_oob_3.py | 8 + .../sample/str_get_element_oob_3.py.ast.typed | 226 ++ ...tr_get_element_oob_3.py.ast.typed.s.result | 2 + src/test/data/pa3/sample/str_len.py | 1 + src/test/data/pa3/sample/str_len.py.ast.typed | 71 + .../pa3/sample/str_len.py.ast.typed.s.result | 1 + src/test/data/pa3/sample/var_assign.py | 4 + .../data/pa3/sample/var_assign.py.ast.typed | 128 + .../sample/var_assign.py.ast.typed.s.result | 1 + web/WebCompiler.py | 105 + web/css/ace.css | 0 web/css/normalize.css | 461 +++ web/css/sakura.css | 165 + web/css/venus.css | 1 + web/index.html | 177 ++ web/js/ace.js | 17 + web/js/codemirror.js | 3 + web/js/jquery-3.3.1.min.js | 2 + web/js/mode-python.js | 8 + web/js/theme-github.js | 8 + web/venus.html | 12 + web/venus.js | 3 + 342 files changed, 35807 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 chocopy-ref.jar create mode 100644 pom.xml create mode 100644 src/main/asm/chocopy/common/abort.s create mode 100644 src/main/asm/chocopy/common/alloc.s create mode 100644 src/main/asm/chocopy/common/alloc2.s create mode 100644 src/main/asm/chocopy/common/heap.init.s create mode 100644 src/main/asm/chocopy/common/input.s create mode 100644 src/main/asm/chocopy/common/len.s create mode 100644 src/main/asm/chocopy/common/object.__init__.s create mode 100644 src/main/asm/chocopy/common/print.s create mode 100644 src/main/java/chocopy/common/Utils.java create mode 100644 src/main/java/chocopy/common/analysis/AbstractNodeAnalyzer.java create mode 100644 src/main/java/chocopy/common/analysis/NodeAnalyzer.java create mode 100644 src/main/java/chocopy/common/analysis/SymbolTable.java create mode 100644 src/main/java/chocopy/common/analysis/types/ClassValueType.java create mode 100644 src/main/java/chocopy/common/analysis/types/FuncType.java create mode 100644 src/main/java/chocopy/common/analysis/types/ListValueType.java create mode 100644 src/main/java/chocopy/common/analysis/types/Type.java create mode 100644 src/main/java/chocopy/common/analysis/types/ValueType.java create mode 100644 src/main/java/chocopy/common/astnodes/AssignStmt.java create mode 100644 src/main/java/chocopy/common/astnodes/BinaryExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/BooleanLiteral.java create mode 100644 src/main/java/chocopy/common/astnodes/CallExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/ClassDef.java create mode 100644 src/main/java/chocopy/common/astnodes/ClassType.java create mode 100644 src/main/java/chocopy/common/astnodes/CompilerError.java create mode 100644 src/main/java/chocopy/common/astnodes/Declaration.java create mode 100644 src/main/java/chocopy/common/astnodes/Errors.java create mode 100644 src/main/java/chocopy/common/astnodes/Expr.java create mode 100644 src/main/java/chocopy/common/astnodes/ExprStmt.java create mode 100644 src/main/java/chocopy/common/astnodes/ForStmt.java create mode 100644 src/main/java/chocopy/common/astnodes/FuncDef.java create mode 100644 src/main/java/chocopy/common/astnodes/GlobalDecl.java create mode 100644 src/main/java/chocopy/common/astnodes/Identifier.java create mode 100644 src/main/java/chocopy/common/astnodes/IfExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/IfStmt.java create mode 100644 src/main/java/chocopy/common/astnodes/IndexExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/IntegerLiteral.java create mode 100644 src/main/java/chocopy/common/astnodes/ListExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/ListType.java create mode 100644 src/main/java/chocopy/common/astnodes/Literal.java create mode 100644 src/main/java/chocopy/common/astnodes/MemberExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/MethodCallExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/Node.java create mode 100644 src/main/java/chocopy/common/astnodes/NonLocalDecl.java create mode 100644 src/main/java/chocopy/common/astnodes/NoneLiteral.java create mode 100644 src/main/java/chocopy/common/astnodes/Program.java create mode 100644 src/main/java/chocopy/common/astnodes/ReturnStmt.java create mode 100644 src/main/java/chocopy/common/astnodes/Stmt.java create mode 100644 src/main/java/chocopy/common/astnodes/StringLiteral.java create mode 100644 src/main/java/chocopy/common/astnodes/TypeAnnotation.java create mode 100644 src/main/java/chocopy/common/astnodes/TypedVar.java create mode 100644 src/main/java/chocopy/common/astnodes/UnaryExpr.java create mode 100644 src/main/java/chocopy/common/astnodes/VarDef.java create mode 100644 src/main/java/chocopy/common/astnodes/WhileStmt.java create mode 100644 src/main/java/chocopy/common/codegen/AttrInfo.java create mode 100644 src/main/java/chocopy/common/codegen/ClassInfo.java create mode 100644 src/main/java/chocopy/common/codegen/CodeGenBase.java create mode 100644 src/main/java/chocopy/common/codegen/Constants.java create mode 100644 src/main/java/chocopy/common/codegen/FuncInfo.java create mode 100644 src/main/java/chocopy/common/codegen/GlobalVarInfo.java create mode 100644 src/main/java/chocopy/common/codegen/Label.java create mode 100644 src/main/java/chocopy/common/codegen/RiscVBackend.java create mode 100644 src/main/java/chocopy/common/codegen/StackVarInfo.java create mode 100644 src/main/java/chocopy/common/codegen/SymbolInfo.java create mode 100644 src/main/java/chocopy/common/codegen/VarInfo.java create mode 100644 src/main/java/chocopy/pa3/CodeGenImpl.java create mode 100644 src/main/java/chocopy/pa3/StudentCodeGen.java create mode 100644 src/test/data/pa3/benchmarks/exp.py create mode 100644 src/test/data/pa3/benchmarks/exp.py.ast.typed create mode 100644 src/test/data/pa3/benchmarks/exp.py.ast.typed.s.result create mode 100644 src/test/data/pa3/benchmarks/prime.py create mode 100644 src/test/data/pa3/benchmarks/prime.py.ast.typed create mode 100644 src/test/data/pa3/benchmarks/prime.py.ast.typed.s.result create mode 100644 src/test/data/pa3/benchmarks/sieve.py create mode 100644 src/test/data/pa3/benchmarks/sieve.py.ast.typed create mode 100644 src/test/data/pa3/benchmarks/sieve.py.ast.typed.s.result create mode 100644 src/test/data/pa3/benchmarks/stdlib.py create mode 100644 src/test/data/pa3/benchmarks/stdlib.py.ast.typed create mode 100644 src/test/data/pa3/benchmarks/stdlib.py.ast.typed.s.result create mode 100644 src/test/data/pa3/benchmarks/tree.py create mode 100644 src/test/data/pa3/benchmarks/tree.py.ast.typed create mode 100644 src/test/data/pa3/benchmarks/tree.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/call.py create mode 100644 src/test/data/pa3/sample/call.py.ast.typed create mode 100644 src/test/data/pa3/sample/call.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/call_with_args.py create mode 100644 src/test/data/pa3/sample/call_with_args.py.ast.typed create mode 100644 src/test/data/pa3/sample/call_with_args.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/error_div_zero.py create mode 100644 src/test/data/pa3/sample/error_div_zero.py.ast.typed create mode 100644 src/test/data/pa3/sample/error_div_zero.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/error_invalid_print.py create mode 100644 src/test/data/pa3/sample/error_invalid_print.py.ast.typed create mode 100644 src/test/data/pa3/sample/error_invalid_print.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/error_mod_zero.py create mode 100644 src/test/data/pa3/sample/error_mod_zero.py.ast.typed create mode 100644 src/test/data/pa3/sample/error_mod_zero.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/expr_if.py create mode 100644 src/test/data/pa3/sample/expr_if.py.ast.typed create mode 100644 src/test/data/pa3/sample/expr_if.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/id_global.py create mode 100644 src/test/data/pa3/sample/id_global.py.ast.typed create mode 100644 src/test/data/pa3/sample/id_global.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/id_local.py create mode 100644 src/test/data/pa3/sample/id_local.py.ast.typed create mode 100644 src/test/data/pa3/sample/id_local.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/input.py create mode 100644 src/test/data/pa3/sample/input.py.ast.in create mode 100644 src/test/data/pa3/sample/input.py.ast.typed create mode 100644 src/test/data/pa3/sample/input.py.ast.typed.in create mode 100644 src/test/data/pa3/sample/input.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/input.py.in create mode 100644 src/test/data/pa3/sample/len_invalid_1.py create mode 100644 src/test/data/pa3/sample/len_invalid_1.py.ast.typed create mode 100644 src/test/data/pa3/sample/len_invalid_1.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/len_invalid_2.py create mode 100644 src/test/data/pa3/sample/len_invalid_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/len_invalid_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_concat.py create mode 100644 src/test/data/pa3/sample/list_concat.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_concat.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_concat_2.py create mode 100644 src/test/data/pa3/sample/list_concat_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_concat_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_concat_none.py create mode 100644 src/test/data/pa3/sample/list_concat_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_concat_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element.py create mode 100644 src/test/data/pa3/sample/list_get_element.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element_complex.py create mode 100644 src/test/data/pa3/sample/list_get_element_complex.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element_complex.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element_none.py create mode 100644 src/test/data/pa3/sample/list_get_element_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element_oob_1.py create mode 100644 src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element_oob_2.py create mode 100644 src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_get_element_oob_3.py create mode 100644 src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_len.py create mode 100644 src/test/data/pa3/sample/list_len.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_len.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_len_empty.py create mode 100644 src/test/data/pa3/sample/list_len_empty.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_len_empty.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_set_element.py create mode 100644 src/test/data/pa3/sample/list_set_element.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_set_element.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_set_element_none.py create mode 100644 src/test/data/pa3/sample/list_set_element_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_set_element_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_set_element_oob_1.py create mode 100644 src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_set_element_oob_2.py create mode 100644 src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/list_set_element_oob_3.py create mode 100644 src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed create mode 100644 src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/literal_bool.py create mode 100644 src/test/data/pa3/sample/literal_bool.py.ast.typed create mode 100644 src/test/data/pa3/sample/literal_bool.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/literal_int.py create mode 100644 src/test/data/pa3/sample/literal_int.py.ast.typed create mode 100644 src/test/data/pa3/sample/literal_int.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/literal_str.py create mode 100644 src/test/data/pa3/sample/literal_str.py.ast.typed create mode 100644 src/test/data/pa3/sample/literal_str.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/nested.py create mode 100644 src/test/data/pa3/sample/nested.py.ast.typed create mode 100644 src/test/data/pa3/sample/nested.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/nested2.py create mode 100644 src/test/data/pa3/sample/nested2.py.ast.typed create mode 100644 src/test/data/pa3/sample/nested2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_attr_get.py create mode 100644 src/test/data/pa3/sample/object_attr_get.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_attr_get.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_attr_get_none.py create mode 100644 src/test/data/pa3/sample/object_attr_get_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_attr_get_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_attr_set.py create mode 100644 src/test/data/pa3/sample/object_attr_set.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_attr_set.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_attr_set_eval_order.py create mode 100644 src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_attr_set_none.py create mode 100644 src/test/data/pa3/sample/object_attr_set_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_attr_set_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_init.py create mode 100644 src/test/data/pa3/sample/object_init.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_init.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_method.py create mode 100644 src/test/data/pa3/sample/object_method.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_method.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_method_complex_call.py create mode 100644 src/test/data/pa3/sample/object_method_complex_call.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_method_complex_call.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_method_nested.py create mode 100644 src/test/data/pa3/sample/object_method_nested.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_method_nested.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_method_none.py create mode 100644 src/test/data/pa3/sample/object_method_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_method_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/object_method_override.py create mode 100644 src/test/data/pa3/sample/object_method_override.py.ast.typed create mode 100644 src/test/data/pa3/sample/object_method_override.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_add.py create mode 100644 src/test/data/pa3/sample/op_add.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_add.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_cmp_bool.py create mode 100644 src/test/data/pa3/sample/op_cmp_bool.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_cmp_bool.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_cmp_int.py create mode 100644 src/test/data/pa3/sample/op_cmp_int.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_cmp_int.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_div_mod.py create mode 100644 src/test/data/pa3/sample/op_div_mod.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_div_mod.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_is.py create mode 100644 src/test/data/pa3/sample/op_is.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_is.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_logical.py create mode 100644 src/test/data/pa3/sample/op_logical.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_logical.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_mul.py create mode 100644 src/test/data/pa3/sample/op_mul.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_mul.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_negate.py create mode 100644 src/test/data/pa3/sample/op_negate.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_negate.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/op_sub.py create mode 100644 src/test/data/pa3/sample/op_sub.py.ast.typed create mode 100644 src/test/data/pa3/sample/op_sub.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/pass.py create mode 100644 src/test/data/pa3/sample/pass.py.ast.typed create mode 100644 src/test/data/pa3/sample/pass.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/predef_constructors.py create mode 100644 src/test/data/pa3/sample/predef_constructors.py.ast.typed create mode 100644 src/test/data/pa3/sample/predef_constructors.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list.py create mode 100644 src/test/data/pa3/sample/stmt_for_list.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_empty.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_eval.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_modify.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested_same_var.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_none.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_nonlocal.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_list_return.py create mode 100644 src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_str.py create mode 100644 src/test/data/pa3/sample/stmt_for_str.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_str.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_str_empty.py create mode 100644 src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_str_eval.py create mode 100644 src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_str_nested.py create mode 100644 src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_for_str_same_var.py create mode 100644 src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_if.py create mode 100644 src/test/data/pa3/sample/stmt_if.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_if.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_return_early.py create mode 100644 src/test/data/pa3/sample/stmt_return_early.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_return_early.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/stmt_while.py create mode 100644 src/test/data/pa3/sample/stmt_while.py.ast.typed create mode 100644 src/test/data/pa3/sample/stmt_while.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_cat.py create mode 100644 src/test/data/pa3/sample/str_cat.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_cat.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_cat_2.py create mode 100644 src/test/data/pa3/sample/str_cat_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_cat_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_cmp.py create mode 100644 src/test/data/pa3/sample/str_cmp.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_cmp.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_get_element.py create mode 100644 src/test/data/pa3/sample/str_get_element.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_get_element.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_get_element_oob_1.py create mode 100644 src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_get_element_oob_2.py create mode 100644 src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_get_element_oob_3.py create mode 100644 src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/str_len.py create mode 100644 src/test/data/pa3/sample/str_len.py.ast.typed create mode 100644 src/test/data/pa3/sample/str_len.py.ast.typed.s.result create mode 100644 src/test/data/pa3/sample/var_assign.py create mode 100644 src/test/data/pa3/sample/var_assign.py.ast.typed create mode 100644 src/test/data/pa3/sample/var_assign.py.ast.typed.s.result create mode 100644 web/WebCompiler.py create mode 100644 web/css/ace.css create mode 100644 web/css/normalize.css create mode 100644 web/css/sakura.css create mode 100644 web/css/venus.css create mode 100644 web/index.html create mode 100644 web/js/ace.js create mode 100644 web/js/codemirror.js create mode 100644 web/js/jquery-3.3.1.min.js create mode 100644 web/js/mode-python.js create mode 100644 web/js/theme-github.js create mode 100644 web/venus.html create mode 100644 web/venus.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21cc758 --- /dev/null +++ b/.gitignore @@ -0,0 +1,149 @@ +.DS_Store +__pycache__ +target + +# Created by https://www.gitignore.io/api/java,eclipse,intellij,emacs,vim + +### Java ### +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +### Eclipse ### +*.pydevproject +.metadata +.gradle +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Java annotation processor (APT) +.factorypath + +# PDT-specific +.buildpath + +# sbteclipse plugin +.target + +# TeXlipse plugin +.texlipse + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ + + +### Vim ### +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist +*~ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0808d4b --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2017-2018 The Regents of the University of California + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..94d677f --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# NYU Compiler Construction CSCI-GA.2130/Spring 2021: Programming Assignment 3 + +This assignment is adapted from https://github.com/cs164berkeley/pa3-chocopy-code-generation with the authors' permission. + +See the PA3 document on Piazza for a detailed specification. + +## Quickstart + +Run the following commands to compile your code generator and run the tests: +``` +mvn clean package +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=..s --test --run --dir src/test/data/pa3/sample/ +``` + +The dots in `--pass` make the compiler skip parsing and semantic analysis and go straight to code generation. +`--pass=..s` uses your (`s` for `student`) generator to generate code from an annotated AST (the `.ast.typed` files under `src/test/data/pa3/sample/`). +With the starter code, only one test should pass. +Your main objective is to build a code generator that passes all the provided tests. + +`--pass=..r` uses the reference (`r` for `reference`) generator, which should pass all tests. + +In addition to running in test mode with `--test`, you can also observe the actual output of your (or reference) generator with: +``` +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=..s src/test/data/pa3/sample/op_add.py.ast.typed +``` + +You can also run all passes on the original `.py` file: +``` +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=rrr src/test/data/pa3/sample/op_add.py +``` + +Once you merge your semantic analysis code from assignment 2, you should be able to use `--pass=sss`. + +## Generating vs Running + +The above should be familiar from previous assignments. +A new aspect of PA3 is the distinction between generating and running the code. + +The following outputs the generated RISC-V assembly (with the usual option to save to a file with `--out`): +``` +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=rrr src/test/data/pa3/sample/op_add.py +``` + +The following (note the `--run` option) generates the assembly and then _runs it on the bundled RISC-V emulator_: +``` +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=rrr --run src/test/data/pa3/sample/op_add.py +``` diff --git a/chocopy-ref.jar b/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|>I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hr>hNcG;+)9|K|OQKJSkh=4={;Oabvu0W5If@sHNb{|E9v5d+hoAp=Sz6mlH! z)nCSWbD`G~x`zBuSHgJr)D*Nu(SZVnMFsJ;qv8|(KhSl_|0-U8TdQxLHT5F_)|!TN zdz9kD@8bXMR`lI_{(RC;zu^5;MHt zDl-o|Po@D4Jo&>ar#Cl?tF{~r+`zR1SU4Hk^4t`Wp^zjaG%O6pyJ=JzwdTyDVbsN)xa>10>g0A zL~=c^F~8l~Z_E2-$@e=R(;!je5P*pTFmGD(TkrdsK$r#k*Qh1gi0I2PfMo_on)V<4 z1p~7Mb{_XR2`P}hv6aEUpLkqy4ohDG!oC8=oBRg3(*J()e@Y15qt@>d2Oo?9S=WIX zev`N#{0H&3>HOefHrah*G-b<7>vC~)P2QK4)EDgxzK}JA`eBTDH zhSPs80Fbs7;NRR8rAGh3w+0Tn?${N1@{;Na19oExdppEZiMwW8JE6aJ1d3LGeD^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/pom.xml b/pom.xml new file mode 100644 index 0000000..72867df --- /dev/null +++ b/pom.xml @@ -0,0 +1,330 @@ + + 4.0.0 + chocopy + chocopy + jar + 2.2-SNAPSHOT + chocopy + http://maven.apache.org + + + + false + + + + + + + + de.jflex + jflex-maven-plugin + 1.6.1 + + + com.github.vbmacher + cup-maven-plugin + 11b-20160615 + + + maven-assembly-plugin + 3.1.0 + + + maven-jar-plugin + 3.1.0 + + + maven-site-plugin + 3.7.1 + + + + + + + maven-assembly-plugin + + + jar-with-dependencies + + assignment + false + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + UTF-8 + 1.8 + 1.8 + true + true + + + + + + + src/main/asm + + **/*.s + **/*.os + + + **/reference/*.s + + + + + + + + reference + + + + src/main/java/chocopy/reference/ + + + + + + + maven-jar-plugin + + + **/pa1/* + **/pa2/* + **/pa3/* + + + + + + maven-assembly-plugin + + + jar-with-dependencies + + chocopy-ref + false + + + + + de.jflex + jflex-maven-plugin + + + jflex-reference + + generate + + + + src/main/jflex/chocopy/reference/ChocoPy.jflex + + ${chocopy.debug} + true + + + + + + + com.github.vbmacher + cup-maven-plugin + + + cup-reference + + generate + + + src/main/cup/chocopy/reference/ChocoPy.cup + chocopy.reference + ChocoPyParser + ChocoPyTokens + ${chocopy.debug} + ${chocopy.debug} + ${chocopy.debug} + true + + + + + + + maven-compiler-plugin + + true + none + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + copy-dependencies + package + + copy-dependencies + + + + + + + + + + pa1 + + + + src/main/java/chocopy/pa1 + + + + + + + de.jflex + jflex-maven-plugin + + + jflex-pa1 + + generate + + + + src/main/jflex/chocopy/pa1/ChocoPy.jflex + + ${chocopy.debug} + true + + + + + + + com.github.vbmacher + cup-maven-plugin + + + cup-pa1 + + generate + + + src/main/cup/chocopy/pa1/ChocoPy.cup + chocopy.pa1 + ChocoPyParser + ChocoPyTokens + ${chocopy.debug} + ${chocopy.debug} + ${chocopy.debug} + true + + + + + + + + + pa2 + + + + src/main/java/chocopy/pa2 + + + + + pa3 + + + + src/main/java/chocopy/pa3 + + + + + + + + + venus164-repo + Repository for Venus164 + https://raw.githubusercontent.com/chocopy/venus/maven-repository/ + + + + + + net.sourceforge.argparse4j + argparse4j + 0.8.1 + + + com.fasterxml.jackson.core + jackson-databind + 2.9.10 + + + com.fasterxml.jackson.module + jackson-module-parameter-names + 2.9.10 + + + com.github.vbmacher + java-cup-runtime + 11b-20160615 + + + + de.jflex + jflex + 1.6.1 + + + org.jetbrains.kotlin + kotlin-stdlib + 1.2.71 + + + edu.berkeley.eecs.venus164 + venus164 + 0.2.4 + + + junit + junit + 4.12 + test + + + net.sf.proguard + proguard-base + 6.0.3 + + + diff --git a/src/main/asm/chocopy/common/abort.s b/src/main/asm/chocopy/common/abort.s new file mode 100644 index 0000000..fa8148a --- /dev/null +++ b/src/main/asm/chocopy/common/abort.s @@ -0,0 +1,12 @@ +# Runtime support function abort (does not return). + mv t0, a0 # Save exit code in temp + li a0, @print_string # Code for print_string ecall + ecall # Print error message in a1 + li a1, 10 # Load newline character + li a0, @print_char # Code for print_char ecall + ecall # Print newline + mv a1, t0 # Move exit code to a1 + li a0, @exit2 # Code for exit2 ecall + ecall # Exit with code +abort_17: # Infinite loop + j abort_17 # Prevent fallthrough diff --git a/src/main/asm/chocopy/common/alloc.s b/src/main/asm/chocopy/common/alloc.s new file mode 100644 index 0000000..da54abe --- /dev/null +++ b/src/main/asm/chocopy/common/alloc.s @@ -0,0 +1,4 @@ +# Runtime support function alloc. + # Prototype address is in a0. + lw a1, 4(a0) # Get size of object in words + j alloc2 # Allocate object with exact size diff --git a/src/main/asm/chocopy/common/alloc2.s b/src/main/asm/chocopy/common/alloc2.s new file mode 100644 index 0000000..9540512 --- /dev/null +++ b/src/main/asm/chocopy/common/alloc2.s @@ -0,0 +1,27 @@ +# Runtime support function alloc2 (realloc). + # Prototype address is in a0. + # Number of words to allocate is in a1. + li a2, 4 # Word size in bytes + mul a2, a1, a2 # Calculate number of bytes to allocate + add a2, gp, a2 # Estimate where GP will move + bgeu a2, s11, alloc2_15 # Go to OOM handler if too large + lw t0, @.__obj_size__(a0) # Get size of object in words + mv t2, a0 # Initialize src ptr + mv t3, gp # Initialize dest ptr +alloc2_16: # Copy-loop header + lw t1, 0(t2) # Load next word from src + sw t1, 0(t3) # Store next word to dest + addi t2, t2, 4 # Increment src + addi t3, t3, 4 # Increment dest + addi t0, t0, -1 # Decrement counter + bne t0, zero, alloc2_16 # Loop if more words left to copy + mv a0, gp # Save new object's address to return + sw a1, @.__obj_size__(a0) # Set size of new object in words + # (same as requested size) + mv gp, a2 # Set next free slot in the heap + jr ra # Return to caller +alloc2_15: # OOM handler + li a0, @error_oom # Exit code for: Out of memory + la a1, STRING["Out of memory"] # Load error message as str + addi a1, a1, @.__str__ # Load address of attribute __str__ + j abort # Abort diff --git a/src/main/asm/chocopy/common/heap.init.s b/src/main/asm/chocopy/common/heap.init.s new file mode 100644 index 0000000..5dfe9a8 --- /dev/null +++ b/src/main/asm/chocopy/common/heap.init.s @@ -0,0 +1,5 @@ +# Runtime support function heap.init. + mv a1, a0 # Move requested size to A1 + li a0, @sbrk # Code for ecall: sbrk + ecall # Request A1 bytes + jr ra # Return to caller diff --git a/src/main/asm/chocopy/common/input.s b/src/main/asm/chocopy/common/input.s new file mode 100644 index 0000000..e48d97a --- /dev/null +++ b/src/main/asm/chocopy/common/input.s @@ -0,0 +1,40 @@ +# Function input + addi sp, sp, -16 # Reserve stack + sw ra, 12(sp) # Save registers + sw fp, 8(sp) + sw s1, 4(sp) + addi fp, sp, 16 # Set fp + + li a0, @fill_line_buffer # Fill the internal line buffer. + ecall + bgez a0, input_nonempty # More input found + la a0, $str$prototype # EOF: Return empty string. + j input_done + +input_nonempty: + mv s1, a0 + addi t0, s1, 5 # Compute bytes for string (+NL+NUL), + addi t0, t0, @.__str__ # Including header. + srli a1, t0, 2 # Convert to words. + la a0, $str$prototype # Load address of string prototype. + jal ra, alloc2 # Allocate string. + sw s1, @.__len__(a0) # Store string length. + mv a2, s1 # Pass length. + mv s1, a0 # Save string object address. + addi a1, a0, @.__str__ # Pass address of string data. + li a0, @read_string # ecall to read from internal buffer. + ecall + addi a0, a0, 1 # Actual length (including NL). + sw a0, @.__len__(s1) # Store actual length. + add t0, a0, s1 + li t1, 10 # Store newline and null byte + sb t1, @.__str__-1(t0) + sb zero, @.__str__(t0) # Store null byte at end. + mv a0, s1 # Return string object. + +input_done: + lw s1, -12(fp) + lw ra, -4(fp) + lw fp, -8(fp) + addi sp, sp, 16 + jr ra \ No newline at end of file diff --git a/src/main/asm/chocopy/common/len.s b/src/main/asm/chocopy/common/len.s new file mode 100644 index 0000000..72e9bea --- /dev/null +++ b/src/main/asm/chocopy/common/len.s @@ -0,0 +1,20 @@ +# Function len + # We do not save/restore fp/ra for this function + # because we know that it does not use the stack or does not + # call other functions. + + lw a0, 0(sp) # Load arg + beq a0, zero, len_12 # None is an illegal argument + lw t0, 0(a0) # Get type tag of arg + li t1, 3 # Load type tag of `str` + beq t0, t1, len_13 # Go to len(str) + li t1, -1 # Load type tag for list objects + beq t0, t1, len_13 # Go to len(list) +len_12: # Invalid argument + li a0, @error_arg # Exit code for: Invalid argument + la a1, STRING["Invalid argument"] # Load error message as str + addi a1, a1, @.__str__ # Load address of attribute __str__ + j abort # Abort +len_13: # Get length of string + lw a0, @.__len__(a0) # Load attribute: __len__ + jr ra # Return to caller diff --git a/src/main/asm/chocopy/common/object.__init__.s b/src/main/asm/chocopy/common/object.__init__.s new file mode 100644 index 0000000..e326950 --- /dev/null +++ b/src/main/asm/chocopy/common/object.__init__.s @@ -0,0 +1,3 @@ +# Init method for type object. + mv a0, zero # `None` constant + jr ra # Return diff --git a/src/main/asm/chocopy/common/print.s b/src/main/asm/chocopy/common/print.s new file mode 100644 index 0000000..4a9d376 --- /dev/null +++ b/src/main/asm/chocopy/common/print.s @@ -0,0 +1,52 @@ +# Function print + lw a0, 0(sp) # Load arg + beq a0, zero, print_6 # None is an illegal argument + lw t0, 0(a0) # Get type tag of arg + li t1, 1 # Load type tag of `int` + beq t0, t1, print_7 # Go to print(int) + li t1, 3 # Load type tag of `str` + beq t0, t1, print_8 # Go to print(str) + li t1, 2 # Load type tag of `bool` + beq t0, t1, print_9 # Go to print(bool) +print_6: # Invalid argument + li a0, 1 # Exit code for: Invalid argument + la a1, STRING["Invalid argument"] # Load error message as str + addi a1, a1, @.__str__ # Load address of attribute __str__ + j abort # Abort + +# Printing bools +print_9: # Print bool object in A0 + lw a0, @.__bool__(a0) # Load attribute __bool__ + beq a0, zero, print_10 # Go to: print(False) + la a0, STRING["True"] # String representation: True + j print_8 # Go to: print(str) +print_10: # Print False object in A0 + la a0, STRING["False"] # String representation: False + j print_8 # Go to: print(str) + +# Printing strs. +print_8: # Print str object in A0 + addi a1, a0, @.__str__ # Load address of attribute __str__ + j print_11 # Print the null-terminated string is now in A1 + mv a0, zero # Load None + j print_5 # Go to return +print_11: # Print null-terminated string in A1 + li a0, @print_string # Code for ecall: print_string + ecall # Print string + li a1, 10 # Load newline character + li a0, @print_char # Code for ecall: print_char + ecall # Print character + j print_5 # Go to return + +# Printing ints. +print_7: # Print int object in A0 + lw a1, @.__int__(a0) # Load attribute __int__ + li a0, @print_int # Code for ecall: print_int + ecall # Print integer + li a1, 10 # Load newline character + li a0, 11 # Code for ecall: print_char + ecall # Print character + +print_5: # End of function + mv a0, zero # Load None + jr ra # Return to caller diff --git a/src/main/java/chocopy/common/Utils.java b/src/main/java/chocopy/common/Utils.java new file mode 100644 index 0000000..41360cc --- /dev/null +++ b/src/main/java/chocopy/common/Utils.java @@ -0,0 +1,54 @@ +package chocopy.common; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.util.stream.Collectors; + +/** Utility functions for general use. */ +public class Utils { + + /** + * Return resource file FILENAME's contents as a string. FILENAME can refer to a file within the + * class hierarchy, so that a text resource in file resource.txt in the chocopy.common.codegen + * package, for example, could be referred to with FILENAME chocopy/common/codegen/resource.txt. + * + *

Credit: Lucio Paiva. + */ + public static String getResourceFileAsString(String fileName) { + InputStream is = Utils.class.getClassLoader().getResourceAsStream(fileName); + if (is != null) { + BufferedReader reader = + new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); + return reader.lines().collect(Collectors.joining(System.lineSeparator())); + } + return null; + } + + /** + * Return an exception signalling a fatal error having a message formed from MSGFORMAT and ARGS, + * as for String.format. + */ + public static Error fatal(String msgFormat, Object... args) { + return new Error(String.format(msgFormat, args)); + } + + /** + * Return the string S padded with FILL to TOLEN characters. Padding is on the left if + * PADONLEFT, and otherwise on the right. If S is already at least TOLEN characters, returns S. + */ + public static String pad(String s, Character fill, int toLen, boolean padOnLeft) { + StringBuilder result = new StringBuilder(toLen); + if (!padOnLeft) { + result.append(s); + } + for (int n = s.length(); n < toLen; n += 1) { + result.append(fill); + } + if (padOnLeft) { + result.append(s); + } + return result.toString(); + } +} diff --git a/src/main/java/chocopy/common/analysis/AbstractNodeAnalyzer.java b/src/main/java/chocopy/common/analysis/AbstractNodeAnalyzer.java new file mode 100644 index 0000000..7225c2b --- /dev/null +++ b/src/main/java/chocopy/common/analysis/AbstractNodeAnalyzer.java @@ -0,0 +1,174 @@ +package chocopy.common.analysis; + +import chocopy.common.astnodes.*; + +/** + * An empty implementation of the {@link NodeAnalyzer} that simply returns does nothing and returns + * null for every AST node type. + * + *

T is the type of analysis result. + */ +public class AbstractNodeAnalyzer implements NodeAnalyzer { + @Override + public T analyze(AssignStmt node) { + return defaultAction(node); + } + + @Override + public T analyze(BinaryExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(BooleanLiteral node) { + return defaultAction(node); + } + + @Override + public T analyze(CallExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(ClassDef node) { + return defaultAction(node); + } + + @Override + public T analyze(ClassType node) { + return defaultAction(node); + } + + @Override + public T analyze(CompilerError node) { + return defaultAction(node); + } + + @Override + public T analyze(Errors node) { + return defaultAction(node); + } + + @Override + public T analyze(ExprStmt node) { + return defaultAction(node); + } + + @Override + public T analyze(ForStmt node) { + return defaultAction(node); + } + + @Override + public T analyze(FuncDef node) { + return defaultAction(node); + } + + @Override + public T analyze(GlobalDecl node) { + return defaultAction(node); + } + + @Override + public T analyze(Identifier node) { + return defaultAction(node); + } + + @Override + public T analyze(IfExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(IfStmt node) { + return defaultAction(node); + } + + @Override + public T analyze(IndexExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(IntegerLiteral node) { + return defaultAction(node); + } + + @Override + public T analyze(ListExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(ListType node) { + return defaultAction(node); + } + + @Override + public T analyze(MemberExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(MethodCallExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(NoneLiteral node) { + return defaultAction(node); + } + + @Override + public T analyze(NonLocalDecl node) { + return defaultAction(node); + } + + @Override + public T analyze(Program node) { + return defaultAction(node); + } + + @Override + public T analyze(ReturnStmt node) { + return defaultAction(node); + } + + @Override + public T analyze(StringLiteral node) { + return defaultAction(node); + } + + @Override + public T analyze(TypedVar node) { + return defaultAction(node); + } + + @Override + public T analyze(UnaryExpr node) { + return defaultAction(node); + } + + @Override + public T analyze(VarDef node) { + return defaultAction(node); + } + + @Override + public T analyze(WhileStmt node) { + return defaultAction(node); + } + + @Override + public void setDefault(T value) { + defaultValue = value; + } + + @Override + public T defaultAction(Node node) { + return defaultValue; + } + + /** Default value for non-overridden methods. */ + private T defaultValue = null; +} diff --git a/src/main/java/chocopy/common/analysis/NodeAnalyzer.java b/src/main/java/chocopy/common/analysis/NodeAnalyzer.java new file mode 100644 index 0000000..2326fbc --- /dev/null +++ b/src/main/java/chocopy/common/analysis/NodeAnalyzer.java @@ -0,0 +1,93 @@ +package chocopy.common.analysis; + +import chocopy.common.astnodes.*; + +/** + * This interface can be used to separate logic for various concrete classes in the AST class + * hierarchy. + * + *

The idea is that a phase of the analysis is encapsulated in a class that implements this + * interface, and contains an overriding of the analyze method for each concrete Node class that + * needs something other than default processing. Each concrete node class, C, implements a generic + * dispatch method that takes a NodeAnalyzer argument and calls the overloading of analyze that + * takes an argument of type C. The effect is that anode.dispatch(anAnalyzer) executes the method + * anAnalyzer.analyze that is appropriate to aNode's dynamic type. As a result each NodeAnalyzer + * subtype encapsulates all implementations of a particular action on Nodes. Thus, it inverts the + * usual OO pattern in which the implementations of analysis A for each different class are + * scattered among the class bodies themselves as overridings of a method A on the Node class. + * + *

The class AbstractNodeAnalyzer provides empty default implementations for these methods. + * + *

The type T is the type of result returned by the encapsulated analysis. + */ +public interface NodeAnalyzer { + + T analyze(AssignStmt node); + + T analyze(BinaryExpr node); + + T analyze(BooleanLiteral node); + + T analyze(CallExpr node); + + T analyze(ClassDef node); + + T analyze(ClassType node); + + T analyze(CompilerError node); + + T analyze(Errors node); + + T analyze(ExprStmt node); + + T analyze(ForStmt node); + + T analyze(FuncDef node); + + T analyze(GlobalDecl node); + + T analyze(Identifier node); + + T analyze(IfExpr node); + + T analyze(IfStmt node); + + T analyze(IndexExpr node); + + T analyze(IntegerLiteral node); + + T analyze(ListExpr node); + + T analyze(ListType node); + + T analyze(MemberExpr node); + + T analyze(MethodCallExpr node); + + T analyze(NoneLiteral node); + + T analyze(NonLocalDecl node); + + T analyze(Program node); + + T analyze(ReturnStmt node); + + T analyze(StringLiteral node); + + T analyze(TypedVar node); + + T analyze(UnaryExpr node); + + T analyze(VarDef node); + + T analyze(WhileStmt node); + + /** + * Set the default value returned by calls to analyze that are not overridden to VALUE. By + * default, this is null. + */ + void setDefault(T value); + + /** Default value for non-overridden methods. */ + T defaultAction(Node node); +} diff --git a/src/main/java/chocopy/common/analysis/SymbolTable.java b/src/main/java/chocopy/common/analysis/SymbolTable.java new file mode 100644 index 0000000..bc22ac4 --- /dev/null +++ b/src/main/java/chocopy/common/analysis/SymbolTable.java @@ -0,0 +1,62 @@ +package chocopy.common.analysis; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * A block-structured symbol table a mapping identifiers to information about them of type T in a + * given declarative region. + */ +public class SymbolTable { + + /** Contents of the current (innermost) region. */ + private final Map tab = new HashMap<>(); + /** Enclosing block. */ + private final SymbolTable parent; + + /** A table representing a region nested in that represented by PARENT0. */ + public SymbolTable(SymbolTable parent0) { + parent = parent0; + } + + /** A top-level symbol table. */ + public SymbolTable() { + this.parent = null; + } + + /** Returns the mapping of NAME in the innermost nested region containing this one. */ + public T get(String name) { + if (tab.containsKey(name)) { + return tab.get(name); + } else if (parent != null) { + return parent.get(name); + } else { + return null; + } + } + + /** + * Adds a new mapping of NAME -> VALUE to the current region, possibly shadowing mappings in the + * enclosing parent. Returns modified table. + */ + public SymbolTable put(String name, T value) { + tab.put(name, value); + return this; + } + + /** Returns whether NAME has a mapping in this region (ignoring enclosing regions. */ + public boolean declares(String name) { + return tab.containsKey(name); + } + + /** Returns all the names declared this region (ignoring enclosing regions). */ + public Set getDeclaredSymbols() { + return tab.keySet(); + } + + /** Returns the parent, or null if this is the top level. */ + public SymbolTable getParent() { + return this.parent; + } +} diff --git a/src/main/java/chocopy/common/analysis/types/ClassValueType.java b/src/main/java/chocopy/common/analysis/types/ClassValueType.java new file mode 100644 index 0000000..05c2e93 --- /dev/null +++ b/src/main/java/chocopy/common/analysis/types/ClassValueType.java @@ -0,0 +1,53 @@ +package chocopy.common.analysis.types; + +import chocopy.common.astnodes.ClassType; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Objects; + +/** Represents the semantic value of a simple class reference. */ +public class ClassValueType extends ValueType { + + /** The name of the class. */ + private final String className; + + /** A class type for the class named CLASSNAME. */ + @JsonCreator + public ClassValueType(@JsonProperty String className) { + this.className = className; + } + + /** A class type for the class referenced by CLASSTYPEANNOTATION. */ + public ClassValueType(ClassType classTypeAnnotation) { + this.className = classTypeAnnotation.className; + } + + @Override + @JsonProperty + public String className() { + return className; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassValueType classType = (ClassValueType) o; + return Objects.equals(className, classType.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + return className; + } +} diff --git a/src/main/java/chocopy/common/analysis/types/FuncType.java b/src/main/java/chocopy/common/analysis/types/FuncType.java new file mode 100644 index 0000000..69fdefc --- /dev/null +++ b/src/main/java/chocopy/common/analysis/types/FuncType.java @@ -0,0 +1,45 @@ +package chocopy.common.analysis.types; + +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.ArrayList; +import java.util.List; + +/** Semantic information for a function or method. */ +public class FuncType extends Type { + + /** Types of parameters. */ + public final List parameters; + /** Function's return type. */ + public final ValueType returnType; + + /** Create a FuncType returning RETURNTYPE0, initially parameterless. */ + public FuncType(ValueType returnType0) { + this(new ArrayList<>(), returnType0); + } + + /** + * Create a FuncType for NAME0 with formal parameter types PARAMETERS0, returning type + * RETURNTYPE0. + */ + @JsonCreator + public FuncType(List parameters0, ValueType returnType0) { + this.parameters = parameters0; + this.returnType = returnType0; + } + + @Override + public boolean isFuncType() { + return true; + } + + /** Return the type of the K-th parameter. */ + public ValueType getParamType(int k) { + return parameters.get(k); + } + + @Override + public String toString() { + return ""; + } +} diff --git a/src/main/java/chocopy/common/analysis/types/ListValueType.java b/src/main/java/chocopy/common/analysis/types/ListValueType.java new file mode 100644 index 0000000..fae59c7 --- /dev/null +++ b/src/main/java/chocopy/common/analysis/types/ListValueType.java @@ -0,0 +1,57 @@ +package chocopy.common.analysis.types; + +import chocopy.common.astnodes.ListType; +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.Objects; + +/** Represents a semantic value of a list type denotation. */ +public class ListValueType extends ValueType { + + /** This ListValueType represents [ELEMENTTYPE]. */ + public final ValueType elementType; + + /** Represents [ELEMENTTYPE]. */ + @JsonCreator + public ListValueType(Type elementType) { + this.elementType = (ValueType) elementType; + } + + /** Represents [], where is that denoted in TYPEANNOTATION. */ + public ListValueType(ListType typeAnnotation) { + elementType = ValueType.annotationToValueType(typeAnnotation.elementType); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListValueType listType = (ListValueType) o; + return Objects.equals(elementType, listType.elementType); + } + + @Override + public int hashCode() { + return Objects.hash(elementType); + } + + @Override + public String toString() { + return "[" + elementType.toString() + "]"; + } + + /** Returns true iff I represent [T]. */ + @Override + public boolean isListType() { + return true; + } + + @Override + public ValueType elementType() { + return elementType; + } +} diff --git a/src/main/java/chocopy/common/analysis/types/Type.java b/src/main/java/chocopy/common/analysis/types/Type.java new file mode 100644 index 0000000..2eddc37 --- /dev/null +++ b/src/main/java/chocopy/common/analysis/types/Type.java @@ -0,0 +1,68 @@ +package chocopy.common.analysis.types; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * Representation for the static type of symbols and expressions during type-checking. + * + *

Symbols such as variables and attributes will typically map to a {@link ValueType}. + * + *

Symbols such as classes will typically map to a more complex Type. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonSubTypes({ + @JsonSubTypes.Type(FuncType.class), + @JsonSubTypes.Type(ClassValueType.class), + @JsonSubTypes.Type(ListValueType.class) +}) +public abstract class Type { + + /** The type object. */ + public static final ClassValueType OBJECT_TYPE = new ClassValueType("object"); + /** The type int. */ + public static final ClassValueType INT_TYPE = new ClassValueType("int"); + /** The type str. */ + public static final ClassValueType STR_TYPE = new ClassValueType("str"); + /** The type bool. */ + public static final ClassValueType BOOL_TYPE = new ClassValueType("bool"); + + /** The type of None. */ + public static final ClassValueType NONE_TYPE = new ClassValueType(""); + /** The type of []. */ + public static final ClassValueType EMPTY_TYPE = new ClassValueType(""); + + /** Returns the name of the class, if this is a class type, Otherwise null. */ + public String className() { + return null; + } + + /** Return true iff this is a type that does not include the value None. */ + @JsonIgnore + public boolean isSpecialType() { + return equals(INT_TYPE) || equals(BOOL_TYPE) || equals(STR_TYPE); + } + + @JsonIgnore + public boolean isListType() { + return false; + } + + @JsonIgnore + public boolean isFuncType() { + return false; + } + + /** Return true iff this type represents a kind of assignable value. */ + @JsonIgnore + public boolean isValueType() { + return false; + } + + /** For list types, return the type of the elements; otherwise null. */ + @JsonIgnore + public ValueType elementType() { + return null; + } +} diff --git a/src/main/java/chocopy/common/analysis/types/ValueType.java b/src/main/java/chocopy/common/analysis/types/ValueType.java new file mode 100644 index 0000000..bb5d908 --- /dev/null +++ b/src/main/java/chocopy/common/analysis/types/ValueType.java @@ -0,0 +1,29 @@ +package chocopy.common.analysis.types; + +import chocopy.common.astnodes.ClassType; +import chocopy.common.astnodes.ListType; +import chocopy.common.astnodes.TypeAnnotation; + +/** + * A ValueType references types that are assigned to variables and expressions. + * + *

In particular, ValueType can be a {@link ClassValueType} (e.g. "int") or a {@link + * ListValueType} (e.g. "[int]"). + */ +public abstract class ValueType extends Type { + + /** Returns the type corresponding to ANNOTATION. */ + public static ValueType annotationToValueType(TypeAnnotation annotation) { + if (annotation instanceof ClassType) { + return new ClassValueType((ClassType) annotation); + } else { + assert annotation instanceof ListType; + return new ListValueType((ListType) annotation); + } + } + + @Override + public boolean isValueType() { + return true; + } +} diff --git a/src/main/java/chocopy/common/astnodes/AssignStmt.java b/src/main/java/chocopy/common/astnodes/AssignStmt.java new file mode 100644 index 0000000..1452463 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/AssignStmt.java @@ -0,0 +1,25 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Single and multiple assignments. */ +public class AssignStmt extends Stmt { + /** List of left-hand sides. */ + public final List targets; + /** Right-hand-side value to be assigned. */ + public final Expr value; + + /** AST for TARGETS[0] = TARGETS[1] = ... = VALUE spanning source locations [LEFT..RIGHT]. */ + public AssignStmt(Location left, Location right, List targets, Expr value) { + super(left, right); + this.targets = targets; + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/BinaryExpr.java b/src/main/java/chocopy/common/astnodes/BinaryExpr.java new file mode 100644 index 0000000..f4ce05b --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/BinaryExpr.java @@ -0,0 +1,31 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** . */ +public class BinaryExpr extends Expr { + + /** Left operand. */ + public final Expr left; + /** Operator name. */ + public final String operator; + /** Right operand. */ + public final Expr right; + + /** + * An AST for expressions of the form LEFTEXPR OP RIGHTEXPR from text in range + * [LEFTLOC..RIGHTLOC]. + */ + public BinaryExpr( + Location leftLoc, Location rightLoc, Expr leftExpr, String op, Expr rightExpr) { + super(leftLoc, rightLoc); + left = leftExpr; + operator = op; + right = rightExpr; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/BooleanLiteral.java b/src/main/java/chocopy/common/astnodes/BooleanLiteral.java new file mode 100644 index 0000000..ffce126 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/BooleanLiteral.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Literals True or False. */ +public final class BooleanLiteral extends Literal { + + /** True iff I represent True. */ + public final boolean value; + + /** An AST for the token True or False at [LEFT..RIGHT], depending on VALUE. */ + public BooleanLiteral(Location left, Location right, boolean value) { + super(left, right); + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/CallExpr.java b/src/main/java/chocopy/common/astnodes/CallExpr.java new file mode 100644 index 0000000..84f13ae --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/CallExpr.java @@ -0,0 +1,26 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** A function call. */ +public class CallExpr extends Expr { + + /** The called function. */ + public final Identifier function; + /** The actual parameter expressions. */ + public final List args; + + /** AST for FUNCTION(ARGS) at [LEFT..RIGHT]. */ + public CallExpr(Location left, Location right, Identifier function, List args) { + super(left, right); + this.function = function; + this.args = args; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/ClassDef.java b/src/main/java/chocopy/common/astnodes/ClassDef.java new file mode 100644 index 0000000..63531c8 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ClassDef.java @@ -0,0 +1,39 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** A class definition. */ +public class ClassDef extends Declaration { + + /** Name of the declared class. */ + public final Identifier name; + /** Name of the parent class. */ + public final Identifier superClass; + /** Body of the class. */ + public final List declarations; + + /** An AST for class NAME(SUPERCLASS): DECLARATIONS. spanning source locations [LEFT..RIGHT]. */ + public ClassDef( + Location left, + Location right, + Identifier name, + Identifier superClass, + List declarations) { + super(left, right); + this.name = name; + this.superClass = superClass; + this.declarations = declarations; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + @Override + public Identifier getIdentifier() { + return this.name; + } +} diff --git a/src/main/java/chocopy/common/astnodes/ClassType.java b/src/main/java/chocopy/common/astnodes/ClassType.java new file mode 100644 index 0000000..fd4cd4d --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ClassType.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** A simple class type name. */ +public final class ClassType extends TypeAnnotation { + + /** The denotation of the class in source. */ + public final String className; + + /** An AST denoting a type named CLASSNAME0 at [LEFT..RIGHT]. */ + public ClassType(Location left, Location right, String className0) { + super(left, right); + className = className0; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/CompilerError.java b/src/main/java/chocopy/common/astnodes/CompilerError.java new file mode 100644 index 0000000..81cc5bb --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/CompilerError.java @@ -0,0 +1,56 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import com.fasterxml.jackson.annotation.JsonInclude; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.Arrays; +import java.util.Objects; + +/** Represents a single error. Does not correspond to any Python source construct. */ +public class CompilerError extends Node { + + /** + * Represents an error with message MESSAGE. Iff SYNTAX, it is a syntactic error. The error + * applies to source text at [LEFT..RIGHT]. + */ + public CompilerError(Location left, Location right, String message, boolean syntax) { + super(left, right); + this.message = message; + this.syntax = syntax; + } + + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + public boolean isSyntax() { + return syntax; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompilerError that = (CompilerError) o; + return Objects.equals(message, that.message) + && Arrays.equals(getLocation(), that.getLocation()); + } + + @Override + public int hashCode() { + int result = Objects.hash(message); + result = 31 * result + Arrays.hashCode(getLocation()); + return result; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + /** The error message. */ + public final String message; + /** True if this is a syntax error. */ + private final boolean syntax; +} diff --git a/src/main/java/chocopy/common/astnodes/Declaration.java b/src/main/java/chocopy/common/astnodes/Declaration.java new file mode 100644 index 0000000..0faa921 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Declaration.java @@ -0,0 +1,17 @@ +package chocopy.common.astnodes; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Base of all AST nodes representing definitions or declarations. */ +public abstract class Declaration extends Node { + + /** A definition or declaration spanning source locations [LEFT..RIGHT]. */ + public Declaration(Location left, Location right) { + super(left, right); + } + + /** Return the identifier defined by this Declaration. */ + @JsonIgnore + public abstract Identifier getIdentifier(); +} diff --git a/src/main/java/chocopy/common/astnodes/Errors.java b/src/main/java/chocopy/common/astnodes/Errors.java new file mode 100644 index 0000000..86240dd --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Errors.java @@ -0,0 +1,71 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Collects the error messages in a Program. There is exactly one per Program node. */ +public class Errors extends Node { + + /** The accumulated error messages in the order added. */ + public final List errors; + + /** True iff multiple semantic errors allowed on a node. */ + @JsonIgnore private boolean allowMultipleErrors; + + /** + * An Errors whose list of CompilerErrors is ERRORS. The list should be modified using this.add. + */ + @JsonCreator + public Errors(List errors) { + super(null, null); + this.errors = errors; + allowMultipleErrors = true; + } + + /** Return true iff there are any errors. */ + public boolean hasErrors() { + return !this.errors.isEmpty(); + } + + /** Prevent multiple semantic errors on the same node. */ + public void suppressMultipleErrors() { + allowMultipleErrors = false; + } + + /** + * Add a new semantic error message attributed to NODE, with message String.format(MESSAGEFORM, + * ARGS). + */ + public void semError(Node node, String messageForm, Object... args) { + if (allowMultipleErrors || !node.hasError()) { + String msg = String.format(messageForm, args); + CompilerError err = new CompilerError(null, null, msg, false); + err.setLocation(node.getLocation()); + add(err); + if (!node.hasError()) { + node.setErrorMsg(msg); + } + } + } + + /** + * Add a new syntax error message attributed to the source text between LEFT and RIGHT, and with + * message String.format(MESSAGEFORM, ARGS). + */ + public void syntaxError(Location left, Location right, String messageForm, Object... args) { + add(new CompilerError(left, right, String.format(messageForm, args), true)); + } + + /** Add ERR to the list of errors. */ + public void add(CompilerError err) { + errors.add(err); + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/Expr.java b/src/main/java/chocopy/common/astnodes/Expr.java new file mode 100644 index 0000000..7372d58 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Expr.java @@ -0,0 +1,43 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.types.Type; +import com.fasterxml.jackson.annotation.JsonInclude; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** + * Base of all AST nodes representing expressions. + * + *

There is nothing in this class, but there will be many AST node types that have fields that + * are *any expression*. For those cases, having a field of this type will encompass all types of + * expressions such as binary expressions and literals that subclass this class. + */ +public abstract class Expr extends Node { + + /** A Python expression spanning source locations [LEFT..RIGHT]. */ + public Expr(Location left, Location right) { + super(left, right); + } + + /** + * The type of the value that this expression evaluates to. + * + *

This field is always null after the parsing stage, but is populated by the + * typechecker in the semantic analysis stage. + * + *

After typechecking this field may be null only for expressions that cannot be + * assigned a type. In particular, {@link NoneLiteral} expressions will not have a typed + * assigned to them. + */ + @JsonInclude(JsonInclude.Include.NON_NULL) + private Type inferredType; + + /** Set getInferredType() to TYPE, returning TYPE. */ + public Type setInferredType(Type type) { + inferredType = type; + return type; + } + + public Type getInferredType() { + return inferredType; + } +} diff --git a/src/main/java/chocopy/common/astnodes/ExprStmt.java b/src/main/java/chocopy/common/astnodes/ExprStmt.java new file mode 100644 index 0000000..5b921a0 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ExprStmt.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Statements consisting of expressions. */ +public final class ExprStmt extends Stmt { + + /** The expression I evaluate. */ + public final Expr expr; + + /** The AST for EXPR spanning source locations [LEFT..RIGHT] in a statement context. */ + public ExprStmt(Location left, Location right, Expr expr) { + super(left, right); + this.expr = expr; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/ForStmt.java b/src/main/java/chocopy/common/astnodes/ForStmt.java new file mode 100644 index 0000000..019b2d8 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ForStmt.java @@ -0,0 +1,29 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** For statements. */ +public class ForStmt extends Stmt { + /** Control variable. */ + public final Identifier identifier; + /** Source of values of control statement. */ + public final Expr iterable; + /** Repeated statements. */ + public final List body; + + /** The AST for for IDENTIFIER in ITERABLE: BODY spanning source locations [LEFT..RIGHT]. */ + public ForStmt( + Location left, Location right, Identifier identifier, Expr iterable, List body) { + super(left, right); + this.identifier = identifier; + this.iterable = iterable; + this.body = body; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/FuncDef.java b/src/main/java/chocopy/common/astnodes/FuncDef.java new file mode 100644 index 0000000..b3ca0f2 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/FuncDef.java @@ -0,0 +1,50 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Def statements. */ +public class FuncDef extends Declaration { + + /** Defined name. */ + public final Identifier name; + /** Formal parameters. */ + public final List params; + /** Return type annotation. */ + public final TypeAnnotation returnType; + /** Local-variable,inner-function, global, and nonlocal declarations. */ + public final List declarations; + /** Other statements. */ + public final List statements; + + /** + * The AST for def NAME(PARAMS) -> RETURNTYPE: DECLARATIONS STATEMENTS spanning source locations + * [LEFT..RIGHT]. + */ + public FuncDef( + Location left, + Location right, + Identifier name, + List params, + TypeAnnotation returnType, + List declarations, + List statements) { + super(left, right); + this.name = name; + this.params = params; + this.returnType = returnType; + this.declarations = declarations; + this.statements = statements; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + @Override + public Identifier getIdentifier() { + return this.name; + } +} diff --git a/src/main/java/chocopy/common/astnodes/GlobalDecl.java b/src/main/java/chocopy/common/astnodes/GlobalDecl.java new file mode 100644 index 0000000..b347d4d --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/GlobalDecl.java @@ -0,0 +1,26 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Declaration of global variable. */ +public class GlobalDecl extends Declaration { + + /** The declared variable. */ + public final Identifier variable; + + /** The AST for the declaration global VARIABLE spanning source locations [LEFT..RIGHT]. */ + public GlobalDecl(Location left, Location right, Identifier variable) { + super(left, right); + this.variable = variable; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + @Override + public Identifier getIdentifier() { + return this.variable; + } +} diff --git a/src/main/java/chocopy/common/astnodes/Identifier.java b/src/main/java/chocopy/common/astnodes/Identifier.java new file mode 100644 index 0000000..7593126 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Identifier.java @@ -0,0 +1,24 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** A simple identifier. */ +public class Identifier extends Expr { + + /** Text of the identifier. */ + public final String name; + + /** + * An AST for the variable, method, or parameter named NAME, spanning source locations + * [LEFT..RIGHT]. + */ + public Identifier(Location left, Location right, String name) { + super(left, right); + this.name = name; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/IfExpr.java b/src/main/java/chocopy/common/astnodes/IfExpr.java new file mode 100644 index 0000000..3d3d809 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/IfExpr.java @@ -0,0 +1,26 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Conditional expressions. */ +public class IfExpr extends Expr { + /** Boolean condition. */ + public final Expr condition; + /** True branch. */ + public final Expr thenExpr; + /** False branch. */ + public final Expr elseExpr; + + /** The AST for THENEXPR if CONDITION else ELSEEXPR spanning source locations [LEFT..RIGHT]. */ + public IfExpr(Location left, Location right, Expr condition, Expr thenExpr, Expr elseExpr) { + super(left, right); + this.condition = condition; + this.thenExpr = thenExpr; + this.elseExpr = elseExpr; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/IfStmt.java b/src/main/java/chocopy/common/astnodes/IfStmt.java new file mode 100644 index 0000000..185b8a1 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/IfStmt.java @@ -0,0 +1,35 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Conditional statement. */ +public class IfStmt extends Stmt { + /** Test condition. */ + public final Expr condition; + /** "True" branch. */ + public final List thenBody; + /** "False" branch. */ + public final List elseBody; + + /** + * The AST for if CONDITION: THENBODY else: ELSEBODY spanning source locations [LEFT..RIGHT]. + */ + public IfStmt( + Location left, + Location right, + Expr condition, + List thenBody, + List elseBody) { + super(left, right); + this.condition = condition; + this.thenBody = thenBody; + this.elseBody = elseBody; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/IndexExpr.java b/src/main/java/chocopy/common/astnodes/IndexExpr.java new file mode 100644 index 0000000..ce788fa --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/IndexExpr.java @@ -0,0 +1,24 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** List-indexing expression. */ +public class IndexExpr extends Expr { + + /** Indexed list. */ + public final Expr list; + /** Expression for index value. */ + public final Expr index; + + /** The AST for LIST[INDEX]. spanning source locations [LEFT..RIGHT]. */ + public IndexExpr(Location left, Location right, Expr list, Expr index) { + super(left, right); + this.list = list; + this.index = index; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/IntegerLiteral.java b/src/main/java/chocopy/common/astnodes/IntegerLiteral.java new file mode 100644 index 0000000..f2d165b --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/IntegerLiteral.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Integer numerals. */ +public final class IntegerLiteral extends Literal { + + /** Value denoted. */ + public final int value; + + /** The AST for the literal VALUE, spanning source locations [LEFT..RIGHT]. */ + public IntegerLiteral(Location left, Location right, int value) { + super(left, right); + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/ListExpr.java b/src/main/java/chocopy/common/astnodes/ListExpr.java new file mode 100644 index 0000000..eab6045 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ListExpr.java @@ -0,0 +1,23 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** List displays. */ +public final class ListExpr extends Expr { + + /** List of element expressions. */ + public final List elements; + + /** The AST for [ ELEMENTS ]. spanning source locations [LEFT..RIGHT]. */ + public ListExpr(Location left, Location right, List elements) { + super(left, right); + this.elements = elements; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/ListType.java b/src/main/java/chocopy/common/astnodes/ListType.java new file mode 100644 index 0000000..32782ad --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ListType.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Type denotation for a list type. */ +public final class ListType extends TypeAnnotation { + + /** The element of list element. */ + public final TypeAnnotation elementType; + + /** The AST for the type annotation [ ELEMENTTYPE ]. spanning source locations [LEFT..RIGHT]. */ + public ListType(Location left, Location right, TypeAnnotation elementType) { + super(left, right); + this.elementType = elementType; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/Literal.java b/src/main/java/chocopy/common/astnodes/Literal.java new file mode 100644 index 0000000..2afd1be --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Literal.java @@ -0,0 +1,16 @@ +package chocopy.common.astnodes; + +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** + * Base of all the literal nodes. + * + *

There is nothing in this class, but it is useful to isolate expressions that are constant + * literals. + */ +public abstract class Literal extends Expr { + /** A literal spanning source locations [LEFT..RIGHT]. */ + public Literal(Location left, Location right) { + super(left, right); + } +} diff --git a/src/main/java/chocopy/common/astnodes/MemberExpr.java b/src/main/java/chocopy/common/astnodes/MemberExpr.java new file mode 100644 index 0000000..a9e0a4f --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/MemberExpr.java @@ -0,0 +1,24 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Attribute accessor. */ +public class MemberExpr extends Expr { + + /** Object selected from. */ + public final Expr object; + /** Name of attribute (instance variable or method). */ + public final Identifier member; + + /** The AST for OBJECT.MEMBER. spanning source locations [LEFT..RIGHT]. */ + public MemberExpr(Location left, Location right, Expr object, Identifier member) { + super(left, right); + this.object = object; + this.member = member; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/MethodCallExpr.java b/src/main/java/chocopy/common/astnodes/MethodCallExpr.java new file mode 100644 index 0000000..ab3f424 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/MethodCallExpr.java @@ -0,0 +1,26 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Method calls. */ +public class MethodCallExpr extends Expr { + + /** Expression for the bound method to be called. */ + public final MemberExpr method; + /** Actual parameters. */ + public final List args; + + /** The AST for METHOD(ARGS). spanning source locations [LEFT..RIGHT]. */ + public MethodCallExpr(Location left, Location right, MemberExpr method, List args) { + super(left, right); + this.method = method; + this.args = args; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/Node.java b/src/main/java/chocopy/common/astnodes/Node.java new file mode 100644 index 0000000..c95f3d6 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Node.java @@ -0,0 +1,176 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.io.IOException; + +/** + * Root of the AST class hierarchy. Every node has a left and right location, indicating the start + * and end of the represented construct in the source text. + * + *

Every node can be marked with an error message, which serves two purposes: 1. It indicates + * that an error message has been issued for this Node, allowing tne program to reduce cascades of + * error messages. 2. It aids in debugging by making it convenient to see which Nodes have caused an + * error. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "kind") +/* List of all concrete subclasses of Node. */ +@JsonSubTypes({ + @JsonSubTypes.Type(AssignStmt.class), + @JsonSubTypes.Type(BinaryExpr.class), + @JsonSubTypes.Type(BooleanLiteral.class), + @JsonSubTypes.Type(CallExpr.class), + @JsonSubTypes.Type(ClassDef.class), + @JsonSubTypes.Type(ClassType.class), + @JsonSubTypes.Type(CompilerError.class), + @JsonSubTypes.Type(Errors.class), + @JsonSubTypes.Type(ExprStmt.class), + @JsonSubTypes.Type(ForStmt.class), + @JsonSubTypes.Type(FuncDef.class), + @JsonSubTypes.Type(GlobalDecl.class), + @JsonSubTypes.Type(Identifier.class), + @JsonSubTypes.Type(IfExpr.class), + @JsonSubTypes.Type(IfStmt.class), + @JsonSubTypes.Type(IndexExpr.class), + @JsonSubTypes.Type(IntegerLiteral.class), + @JsonSubTypes.Type(ListExpr.class), + @JsonSubTypes.Type(ListType.class), + @JsonSubTypes.Type(MemberExpr.class), + @JsonSubTypes.Type(MethodCallExpr.class), + @JsonSubTypes.Type(NoneLiteral.class), + @JsonSubTypes.Type(NonLocalDecl.class), + @JsonSubTypes.Type(Program.class), + @JsonSubTypes.Type(ReturnStmt.class), + @JsonSubTypes.Type(StringLiteral.class), + @JsonSubTypes.Type(TypedVar.class), + @JsonSubTypes.Type(UnaryExpr.class), + @JsonSubTypes.Type(VarDef.class), + @JsonSubTypes.Type(WhileStmt.class), +}) +public abstract class Node { + + /** Node-type indicator for JSON form. */ + public final String kind; + + /** + * Source position information: 0: line number of start, 1: column number of start, 2: line + * number of end, 3: column number of end. + */ + private final int[] location = new int[4]; + + /** + * First error message "blamed" on this Node. When non-null, indicates that an error has been + * found in this Node. + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private String errorMsg; + + /** A Node corresponding to source text between LEFT and RIGHT. */ + public Node(Location left, Location right) { + if (left != null) { + location[0] = left.getLine(); + location[1] = left.getColumn(); + } + if (right != null) { + location[2] = right.getLine(); + location[3] = right.getColumn(); + } + this.kind = getClass().getSimpleName(); + this.errorMsg = null; + } + + /** + * Return my source location as { , , , }. + * Result should not be modified, and contents will change after setLocation(). + */ + public int[] getLocation() { + return location; + } + + /** Copy LOCATION as getLocation(). */ + public void setLocation(final int[] location) { + System.arraycopy(location, 0, this.location, 0, 4); + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(String msg) { + this.errorMsg = msg; + } + + /** Return true iff I have been marked with an error message. */ + @JsonIgnore + public boolean hasError() { + return this.errorMsg != null; + } + + /** + * Invoke ANALYZER on me as a node of static type T. See the comment on NodeAnalyzer. Returns + * modified Node. + */ + public abstract T dispatch(NodeAnalyzer analyzer); + + /** Print out the AST in JSON format. */ + @Override + public String toString() { + try { + return toJSON(); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + /** Return a serialization of this node in JSON format. */ + public String toJSON() throws JsonProcessingException { + return mapper.writeValueAsString(this); + } + + /** Mapper to-and-from serialized JSON. */ + private static final ObjectMapper mapper = new ObjectMapper(); + + static { + mapper.enable(SerializationFeature.INDENT_OUTPUT); + mapper.registerModule(new ParameterNamesModule()); + } + + /** Returns a T from JSON, a JSON-serialized T value with class CLAS. */ + public static T fromJSON(String json, Class clas) throws IOException { + return mapper.readValue(json, clas); + } + + /** + * Returns the result of converting JSON, a JSon-serialization of a Node value, into the value + * it serializes. + */ + public static Node fromJSON(String json) throws IOException { + return fromJSON(json, Node.class); + } + + /** + * Returns the result of converting TREE to the value of type T that it represents, where CLAS + * reflects T. + */ + public static T fromJSON(JsonNode tree, Class clas) throws IOException { + return mapper.treeToValue(tree, clas); + } + + /** Returns the translation of serialized value SRC into the corresponding JSON tree. */ + public static JsonNode readTree(String src) throws IOException { + return mapper.readTree(src); + } +} diff --git a/src/main/java/chocopy/common/astnodes/NonLocalDecl.java b/src/main/java/chocopy/common/astnodes/NonLocalDecl.java new file mode 100644 index 0000000..ebaf78d --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/NonLocalDecl.java @@ -0,0 +1,26 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Nonlocal declaration. */ +public class NonLocalDecl extends Declaration { + + /** Name of identifier being declared. */ + public final Identifier variable; + + /** The AST for nonlocal VARIABLE spanning source locations [LEFT..RIGHT]. */ + public NonLocalDecl(Location left, Location right, Identifier variable) { + super(left, right); + this.variable = variable; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + @Override + public Identifier getIdentifier() { + return this.variable; + } +} diff --git a/src/main/java/chocopy/common/astnodes/NoneLiteral.java b/src/main/java/chocopy/common/astnodes/NoneLiteral.java new file mode 100644 index 0000000..b51a581 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/NoneLiteral.java @@ -0,0 +1,17 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** The expression 'None'. */ +public final class NoneLiteral extends Literal { + + /** The AST for None, spanning source locations [LEFT..RIGHT]. */ + public NoneLiteral(Location left, Location right) { + super(left, right); + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/Program.java b/src/main/java/chocopy/common/astnodes/Program.java new file mode 100644 index 0000000..f2d7f75 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Program.java @@ -0,0 +1,56 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.ArrayList; +import java.util.List; + +/** An entire ChocoPy program. */ +public class Program extends Node { + + /** Initial variable, class, and function declarations. */ + public final List declarations; + /** Trailing statements. */ + public final List statements; + /** Accumulated errors. */ + public final Errors errors; + + /** + * The AST for the program DECLARATIONS STATEMENTS spanning source locations [LEFT..RIGHT]. + * + *

ERRORS is the container for all error messages applying to the program. + */ + public Program( + Location left, + Location right, + List declarations, + List statements, + Errors errors) { + super(left, right); + this.declarations = declarations; + this.statements = statements; + if (errors == null) { + this.errors = new Errors(new ArrayList<>()); + } else { + this.errors = errors; + } + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + /** Returns true iff there is at least one error in the program. */ + @JsonIgnore + public boolean hasErrors() { + return errors.hasErrors(); + } + + /** A convenience method returning the list of all CompilerErrors for this program. */ + @JsonIgnore + public List getErrorList() { + return errors.errors; + } +} diff --git a/src/main/java/chocopy/common/astnodes/ReturnStmt.java b/src/main/java/chocopy/common/astnodes/ReturnStmt.java new file mode 100644 index 0000000..e665042 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/ReturnStmt.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Return from function. */ +public class ReturnStmt extends Stmt { + + /** Returned value. */ + public final Expr value; + + /** The AST for return VALUE spanning source locations [LEFT..RIGHT]. */ + public ReturnStmt(Location left, Location right, Expr value) { + super(left, right); + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/Stmt.java b/src/main/java/chocopy/common/astnodes/Stmt.java new file mode 100644 index 0000000..b87780e --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/Stmt.java @@ -0,0 +1,18 @@ +package chocopy.common.astnodes; + +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** + * Base of all AST nodes representing statements. + * + *

There is nothing in this class, but there will be some AST node types that have fields that + * are *any statement* or a list of statements. For those cases, having a field of this type will + * encompass all types of statements such as expression statements, if statements, while statements, + * etc. + */ +public abstract class Stmt extends Node { + /** A statement spanning source locations [LEFT..RIGHT]. */ + public Stmt(Location left, Location right) { + super(left, right); + } +} diff --git a/src/main/java/chocopy/common/astnodes/StringLiteral.java b/src/main/java/chocopy/common/astnodes/StringLiteral.java new file mode 100644 index 0000000..0eaf928 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/StringLiteral.java @@ -0,0 +1,21 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** String constants. */ +public final class StringLiteral extends Literal { + + /** Contents of the literal, not including quotation marks. */ + public final String value; + + /** The AST for a string literal containing VALUE, spanning source locations [LEFT..RIGHT]. */ + public StringLiteral(Location left, Location right, String value) { + super(left, right); + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/TypeAnnotation.java b/src/main/java/chocopy/common/astnodes/TypeAnnotation.java new file mode 100644 index 0000000..d90b59e --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/TypeAnnotation.java @@ -0,0 +1,11 @@ +package chocopy.common.astnodes; + +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** Base of all AST nodes representing type annotations (list or class types. */ +public abstract class TypeAnnotation extends Node { + /** An annotation spanning source locations [LEFT..RIGHT]. */ + public TypeAnnotation(Location left, Location right) { + super(left, right); + } +} diff --git a/src/main/java/chocopy/common/astnodes/TypedVar.java b/src/main/java/chocopy/common/astnodes/TypedVar.java new file mode 100644 index 0000000..98aae43 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/TypedVar.java @@ -0,0 +1,24 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** An identifier with attached type annotation. */ +public class TypedVar extends Node { + + /** The typed identifier. */ + public final Identifier identifier; + /** The declared type. */ + public final TypeAnnotation type; + + /** The AST for IDENTIFIER : TYPE. spanning source locations [LEFT..RIGHT]. */ + public TypedVar(Location left, Location right, Identifier identifier, TypeAnnotation type) { + super(left, right); + this.identifier = identifier; + this.type = type; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/UnaryExpr.java b/src/main/java/chocopy/common/astnodes/UnaryExpr.java new file mode 100644 index 0000000..199e701 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/UnaryExpr.java @@ -0,0 +1,24 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** An expression applying a unary operator. */ +public class UnaryExpr extends Expr { + + /** The text representation of the operator. */ + public final String operator; + /** The operand to which it is applied. */ + public final Expr operand; + + /** The AST for OPERATOR OPERAND spanning source locations [LEFT..RIGHT]. */ + public UnaryExpr(Location left, Location right, String operator, Expr operand) { + super(left, right); + this.operator = operator; + this.operand = operand; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/astnodes/VarDef.java b/src/main/java/chocopy/common/astnodes/VarDef.java new file mode 100644 index 0000000..61d261a --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/VarDef.java @@ -0,0 +1,32 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +/** A declaration of a variable (i.e., with type annotation). */ +public class VarDef extends Declaration { + /** The variable and its assigned type. */ + public final TypedVar var; + /** The initial value assigned. */ + public final Literal value; + + /** + * The AST for VAR = VALUE where VAR has a type annotation, and spanning source locations + * [LEFT..RIGHT]. + */ + public VarDef(Location left, Location right, TypedVar var, Literal value) { + super(left, right); + this.var = var; + this.value = value; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } + + /** The identifier defined by this declaration. */ + @Override + public Identifier getIdentifier() { + return this.var.identifier; + } +} diff --git a/src/main/java/chocopy/common/astnodes/WhileStmt.java b/src/main/java/chocopy/common/astnodes/WhileStmt.java new file mode 100644 index 0000000..9a521e1 --- /dev/null +++ b/src/main/java/chocopy/common/astnodes/WhileStmt.java @@ -0,0 +1,25 @@ +package chocopy.common.astnodes; + +import chocopy.common.analysis.NodeAnalyzer; +import java_cup.runtime.ComplexSymbolFactory.Location; + +import java.util.List; + +/** Indefinite repetition construct. */ +public class WhileStmt extends Stmt { + /** Test for whether to continue. */ + public final Expr condition; + /** Loop body. */ + public final List body; + + /** The AST for while CONDITION: BODY spanning source locations [LEFT..RIGHT]. */ + public WhileStmt(Location left, Location right, Expr condition, List body) { + super(left, right); + this.condition = condition; + this.body = body; + } + + public T dispatch(NodeAnalyzer analyzer) { + return analyzer.analyze(this); + } +} diff --git a/src/main/java/chocopy/common/codegen/AttrInfo.java b/src/main/java/chocopy/common/codegen/AttrInfo.java new file mode 100644 index 0000000..ab576e8 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/AttrInfo.java @@ -0,0 +1,16 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.Literal; + +/** Information concerning an instance variable. */ +public class AttrInfo extends VarInfo { + + /** + * A descriptor for an attribute named ATTRNAME of type VARTYPE whose initial value, if any, is + * a constant specified by INITIALVALUE (it is otherwise null). + */ + public AttrInfo(String attrName, ValueType varType, Literal initialValue) { + super(attrName, varType, initialValue); + } +} diff --git a/src/main/java/chocopy/common/codegen/ClassInfo.java b/src/main/java/chocopy/common/codegen/ClassInfo.java new file mode 100644 index 0000000..7591e96 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/ClassInfo.java @@ -0,0 +1,123 @@ +package chocopy.common.codegen; + +import java.util.ArrayList; +import java.util.List; + +/** Information for code generation a class. */ +public class ClassInfo extends SymbolInfo { + + /** Name of class. */ + protected final String className; + + /** Information about instance variables of the class. */ + public final List attributes; + /** Information about methods of the class. */ + public final List methods; + + /** + * Tag indicating type of value: 0: (reserved) 1: int 2: bool 3: str -1: [T] for any T >3: + * User-defined types. + */ + protected final int typeTag; + /** Label of area containing initial instance values. */ + protected final Label prototypeLabel; + /** Label of area containing method-dispatching table. */ + protected Label dispatchTableLabel; + + /** + * A descriptor for a class named CLASSNAME identified by runtime tag TYPETAG, and having the + * class denoted by SUPERCLASSINFO as its superclass. The latter is null iff the class is + * object. + */ + public ClassInfo(String className, int typeTag, ClassInfo superClassInfo) { + this.className = className; + this.typeTag = typeTag; + prototypeLabel = new Label(String.format("$%s$%s", className, "prototype")); + dispatchTableLabel = new Label(String.format("$%s$%s", className, "dispatchTable")); + attributes = new ArrayList<>(); + methods = new ArrayList<>(); + if (superClassInfo != null) { + attributes.addAll(superClassInfo.attributes); + methods.addAll(superClassInfo.methods); + } + } + + /** Add an attribute described by ATTRINFO. */ + public void addAttribute(AttrInfo attrInfo) { + this.attributes.add(attrInfo); + } + + /** + * Add a method described by FUNCINFO, overriding any inherited method of that name if + * necessary. + */ + public void addMethod(FuncInfo funcInfo) { + String methodName = funcInfo.getBaseName(); + int idx = this.getMethodIndex(methodName); + if (idx >= 0) { + this.methods.set(idx, funcInfo); + } else { + this.methods.add(funcInfo); + } + } + + /** Return my type tag. */ + public int getTypeTag() { + return typeTag; + } + + /** Returns the address of this class's prototype object (a label). */ + public Label getPrototypeLabel() { + return prototypeLabel; + } + + /** Returns the address of this class's dispatch table (a label). */ + public Label getDispatchTableLabel() { + return dispatchTableLabel; + } + + /** + * Returns the index of the attribute named ATTRNAME in order of definition. + * + *

This index takes into account inherited attribute and returns the index of an attribute as + * a slot index in its object layout (excluding the object header). Attributes are numbered from + * 0; the result is an index, and not a byte offset. + */ + public int getAttributeIndex(String attrName) { + for (int i = 0; i < attributes.size(); i++) { + if (attributes.get(i).getVarName().equals(attrName)) { + return i; + } + } + return -1; + } + + /** + * Returns the index of the method named METHODNAME in order of definition. + * + *

This index takes into account inherited and overridden methods and returns the index of + * the method as a slot number (not a byte offset) in the dispatch table. + */ + public int getMethodIndex(String methodName) { + for (int i = 0; i < methods.size(); i++) { + if (methods.get(i).getBaseName().equals(methodName)) { + return i; + } + } + return -1; + } + + public String getClassName() { + return className; + } + + /** Returns the list of attributes of this class, in order of the object's layout. */ + public List getAttributes() { + return attributes; + } + + /** Returns the list of methods of this class, in order of the object's dispatch table. */ + public List getMethods() { + return methods; + } +} diff --git a/src/main/java/chocopy/common/codegen/CodeGenBase.java b/src/main/java/chocopy/common/codegen/CodeGenBase.java new file mode 100644 index 0000000..cd82097 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/CodeGenBase.java @@ -0,0 +1,880 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.AbstractNodeAnalyzer; +import chocopy.common.analysis.SymbolTable; +import chocopy.common.analysis.types.Type; +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static chocopy.common.Utils.*; +import static chocopy.common.codegen.RiscVBackend.Register.*; + +/** + * The code generator for a ChocoPy program. + * + *

This class implements logic to analyze all declarations in a program and create descriptors + * for classes, functions, methods, variables (global and local), and attributes. This logic also + * builds symbol tables for globals and individual functions. + * + *

This class also implements logic to emit global variables, object prototypes and dispatch + * tables, as well as int/str/bool constants. + * + *

However, this class is abstract because it does not implement logic for emitting executable + * code in bodies of user-defined functions as well as in top-level statements. This class should be + * extended with implementations for such logic. + * + *

All non-public members of this class are `protected`, and can be overridden by sub-classes to + * extend change functionality. + * + *

The SymbolInfo classes can also be overridden. If say you want to use your own extended + * FuncInfo called MyFuncInfo (that extends FuncInfo), then override the makeFuncInfo() method of + * this class to `return new MyFuncInfo(...)` instead. This is probably not needed, though. + */ +public abstract class CodeGenBase { + + /** The location of the text resources containing common library code. */ + protected static final String LIBRARY_CODE_DIR = "chocopy/common/"; + + /** The backend that emits assembly. */ + protected final RiscVBackend backend; + + /** Convenience variable: the word size for the current back end. */ + protected final int wordSize; + + /** A counter for generating unique class type tags. */ + protected int nextTypeTag = 0; + + /** A counter used to generate unique local label names. */ + protected int nextLabelSuffix = 0; + + /** + * Predefined classes. The list "class" is a fake class; we use it only to emit a prototype + * object for empty lists. + */ + protected ClassInfo objectClass, intClass, boolClass, strClass, listClass; + + /** Predefined functions. */ + protected FuncInfo printFunc, lenFunc, inputFunc; + + /** A list of global variables, whose initial values are emitted in the backend. */ + protected final List globalVars = new ArrayList<>(); + + /** + * A list of program classes, whose prototype objects and dispatch tables are emitted in the + * backend. + */ + protected final List classes = new ArrayList<>(); + + /** + * A list of functions (including methods and nested functions) whose bodies are emitted in the + * backend. + */ + protected final List functions = new ArrayList<>(); + + /** Label for built-in routine: alloc. */ + protected final Label objectAllocLabel = new Label("alloc"); + + /** Label for built-in routine: alloc2. */ + protected final Label objectAllocResizeLabel = new Label("alloc2"); + + /** Label for built-in routine: abort. */ + protected final Label abortLabel = new Label("abort"); + + /** Label for built-in routine: heap.init. */ + protected final Label heapInitLabel = new Label("heap.init"); + + /** Error codes. */ + protected final int ERROR_ARG = 1, + ERROR_DIV_ZERO = 2, + ERROR_OOB = 3, + ERROR_NONE = 4, + ERROR_OOM = 5, + ERROR_NYI = 6; + + /** Size of heap memory. */ + protected final int HEAP_SIZE_BYTES = 1024 * 1024 * 32; + + /** Ecall numbers for intrinsic routines. */ + protected final int EXIT_ECALL = 10, + EXIT2_ECALL = 17, + PRINT_STRING_ECALL = 4, + PRINT_CHAR_ECALL = 11, + PRINT_INT_ECALL = 1, + READ_STRING_ECALL = 8, + FILL_LINE_BUFFER__ECALL = 18, + SBRK_ECALL = 9; + + /** + * The symbol table that maps global names to information about the bound global variables, + * global functions, or classes. + */ + protected final SymbolTable globalSymbols = new SymbolTable<>(); + + /** A utility for caching constants and generating labels for constants. */ + protected final Constants constants = new Constants(); + + /** The object header size, in words (includes type tag, size, and dispatch table pointer). */ + public static final int HEADER_SIZE = 3; + + /** + * Initializes a code generator for ChocoPy that uses BACKEND to emit assembly code. + * + *

The constructor creates Info objects for predefined functions, classes, methods, and + * built-in routines. + */ + public CodeGenBase(RiscVBackend backend) { + this.backend = backend; + wordSize = backend.getWordSize(); + + initClasses(); + initFunctions(); + initAsmConstants(); + } + + /** Return a fresh type tag. */ + protected int getNextTypeTag() { + return nextTypeTag++; + } + + /** Returns the next unique label suffix. */ + protected int getNextLabelSuffix() { + return nextLabelSuffix++; + } + + /** + * Return a fresh label. + * + *

This label is guaranteed to be unique amongst labels generated by invoking this method. + * All such labels have a prefix of `label_`. + * + *

This is useful to generate local labels in function bodies (e.g. for targets of jumps), + * where the name does not matter in general. + */ + protected Label generateLocalLabel() { + return new Label(String.format("label_%d", getNextLabelSuffix())); + } + + /** + * Generates assembly code for PROGRAM. + * + *

This is the main driver that calls internal methods for emitting DATA section (globals, + * constants, prototypes, etc) as well as the the CODE section (predefined functions, built-in + * routines, and user-defined functions). + */ + public void generate(Program program) { + analyzeProgram(program); + + backend.startData(); + + for (ClassInfo classInfo : this.classes) { + emitPrototype(classInfo); + } + + for (ClassInfo classInfo : this.classes) { + emitDispatchTable(classInfo); + } + + for (GlobalVarInfo global : this.globalVars) { + backend.emitGlobalLabel(global.getLabel()); + emitConstant( + global.getInitialValue(), + global.getVarType(), + String.format("Initial value of global var: %s", global.getVarName())); + } + + backend.startCode(); + + Label mainLabel = new Label("main"); + backend.emitGlobalLabel(mainLabel); + backend.emitLUI(A0, HEAP_SIZE_BYTES >> 12, "Initialize heap size (in multiples of 4KB)"); + backend.emitADD(S11, S11, A0, "Save heap size"); + backend.emitJAL(heapInitLabel, "Call heap.init routine"); + backend.emitMV(GP, A0, "Initialize heap pointer"); + backend.emitMV(S10, GP, "Set beginning of heap"); + backend.emitADD(S11, S10, S11, "Set end of heap (= start of heap + heap size)"); + backend.emitMV(RA, ZERO, "No normal return from main program."); + backend.emitMV(FP, ZERO, "No preceding frame."); + + emitTopLevel(program.statements); + + for (FuncInfo funcInfo : this.functions) { + funcInfo.emitBody(); + } + + emitStdFunc("alloc"); + emitStdFunc("alloc2"); + emitStdFunc("abort"); + emitStdFunc("heap.init"); + + emitCustomCode(); + + backend.startData(); + emitConstants(); + } + + /** Create descriptors and symbols for builtin classes and methods. */ + protected void initClasses() { + FuncInfo objectInit = + makeFuncInfo( + "object.__init__", + 0, + Type.NONE_TYPE, + globalSymbols, + null, + this::emitStdFunc); + objectInit.addParam(makeStackVarInfo("self", Type.OBJECT_TYPE, null, objectInit)); + functions.add(objectInit); + + objectClass = makeClassInfo("object", getNextTypeTag(), null); + objectClass.addMethod(objectInit); + classes.add(objectClass); + globalSymbols.put(objectClass.getClassName(), objectClass); + + intClass = makeClassInfo("int", getNextTypeTag(), objectClass); + intClass.addAttribute(makeAttrInfo("__int__", null, null)); + classes.add(intClass); + globalSymbols.put(intClass.getClassName(), intClass); + + boolClass = makeClassInfo("bool", getNextTypeTag(), objectClass); + boolClass.addAttribute(makeAttrInfo("__bool__", null, null)); + classes.add(boolClass); + globalSymbols.put(boolClass.getClassName(), boolClass); + + strClass = makeClassInfo("str", getNextTypeTag(), objectClass); + strClass.addAttribute( + makeAttrInfo("__len__", Type.INT_TYPE, new IntegerLiteral(null, null, 0))); + strClass.addAttribute(makeAttrInfo("__str__", null, null)); + classes.add(strClass); + globalSymbols.put(strClass.getClassName(), strClass); + + listClass = makeClassInfo(".list", -1, objectClass); + listClass.addAttribute( + makeAttrInfo("__len__", Type.INT_TYPE, new IntegerLiteral(null, null, 0))); + classes.add(listClass); + listClass.dispatchTableLabel = null; + } + + /** Create descriptors and symbols for builtin functions. */ + protected void initFunctions() { + printFunc = + makeFuncInfo("print", 0, Type.NONE_TYPE, globalSymbols, null, this::emitStdFunc); + printFunc.addParam(makeStackVarInfo("arg", Type.OBJECT_TYPE, null, printFunc)); + functions.add(printFunc); + globalSymbols.put(printFunc.getBaseName(), printFunc); + + lenFunc = makeFuncInfo("len", 0, Type.INT_TYPE, globalSymbols, null, this::emitStdFunc); + lenFunc.addParam(makeStackVarInfo("arg", Type.OBJECT_TYPE, null, lenFunc)); + functions.add(lenFunc); + globalSymbols.put(lenFunc.getBaseName(), lenFunc); + + inputFunc = makeFuncInfo("input", 0, Type.STR_TYPE, globalSymbols, null, this::emitStdFunc); + functions.add(inputFunc); + globalSymbols.put(inputFunc.getBaseName(), inputFunc); + } + + /* Symbolic assembler constants defined here (to add others, override + * initAsmConstants in an extension of CodeGenBase): + * ecalls: + * @sbrk + * @fill_line_buffer + * @read_string + * @print_string + * @print_char + * @print_int + * @exit2 + * Exit codes: + * @error_div_zero: Division by 0. + * @error_arg: Bad argument. + * @error_oob: Out of bounds. + * @error_none: Attempt to access attribute of None. + * @error_oom: Out of memory. + * @error_nyi: Unimplemented operation. + * Data-structure byte offsets: + * @.__obj_size__: Offset of size of object. + * @.__len__: Offset of length in chars or words. + * @.__str__: Offset of string data. + * @.__elts__: Offset of first list item. + * @.__int__: Offset of integer value. + * @.__bool__: Offset of boolean (1/0) value. + */ + + /** Define @-constants to be used in assembly code. */ + protected void initAsmConstants() { + backend.defineSym("sbrk", SBRK_ECALL); + backend.defineSym("print_string", PRINT_STRING_ECALL); + backend.defineSym("print_char", PRINT_CHAR_ECALL); + backend.defineSym("print_int", PRINT_INT_ECALL); + backend.defineSym("exit2", EXIT2_ECALL); + backend.defineSym("read_string", READ_STRING_ECALL); + backend.defineSym("fill_line_buffer", FILL_LINE_BUFFER__ECALL); + + backend.defineSym(".__obj_size__", 4); + backend.defineSym(".__len__", 12); + backend.defineSym(".__int__", 12); + backend.defineSym(".__bool__", 12); + backend.defineSym(".__str__", 16); + backend.defineSym(".__elts__", 16); + + backend.defineSym("error_div_zero", ERROR_DIV_ZERO); + backend.defineSym("error_arg", ERROR_ARG); + backend.defineSym("error_oob", ERROR_OOB); + backend.defineSym("error_none", ERROR_NONE); + backend.defineSym("error_oom", ERROR_OOM); + backend.defineSym("error_nyi", ERROR_NYI); + } + + /*-----------------------------------------------------------*/ + /* */ + /* FACTORY METHODS TO CREATE INFO OBJECTS */ + /* */ + /*-----------------------------------------------------------*/ + + /** + * A factory method that returns a descriptor for function or method FUNCNAME returning type + * RETURNTYPE at nesting level DEPTH in the region corresponding to PARENTSYMBOLTABLE. + * + *

PARENTFUNCINFO is a descriptor of the enclosing function and is null for global functions + * and methods. + * + *

EMITTER is a method that emits the function's body (usually a generic emitter for + * user-defined functions/methods, and a special emitter for pre-defined functions/methods). + * + *

Sub-classes of CodeGenBase can override this method if they wish to use a sub-class of + * FuncInfo with more functionality. + */ + protected FuncInfo makeFuncInfo( + String funcName, + int depth, + ValueType returnType, + SymbolTable parentSymbolTable, + FuncInfo parentFuncInfo, + Consumer emitter) { + return new FuncInfo( + funcName, depth, returnType, parentSymbolTable, parentFuncInfo, emitter); + } + + /** + * Return a descriptor for a class named CLASSNAME having type tag TYPETAG and superclass + * SUPERCLASSINFO (null for `object' only). + * + *

Sub-classes of CodeGenBase can override this method if they wish to use a sub-class of + * ClassInfo with more functionality. + */ + public ClassInfo makeClassInfo(String className, int typeTag, ClassInfo superClassInfo) { + return new ClassInfo(className, typeTag, superClassInfo); + } + + /** + * A factory method that returns a descriptor for an attribute named ATTRNAME of type ATTRTYPE + * and with an initial value specified by INITIALVALUE, which may be null to indicate a default + * initialization. + * + *

Sub-classes of CodeGenBase can override this method if they wish to use a sub-class of + * AttrInfo with more functionality. + */ + public AttrInfo makeAttrInfo(String attrName, ValueType attrType, Literal initialValue) { + return new AttrInfo(attrName, attrType, initialValue); + } + + /** + * A factory method that returns a descriptor for a local variable or parameter named VARNAME of + * type VARTYPE, whose initial value is specified by INITIALVALUE (if non-null) and which is + * defined immediately within the function given by FUNCINFO. + * + *

These variables are allocated on the stack in activation frames. + * + *

Sub-classes of CodeGenBase can override this method if they wish to use a sub-class of + * StackVarInfo with more functionality. + */ + public StackVarInfo makeStackVarInfo( + String varName, ValueType varType, Literal initialValue, FuncInfo funcInfo) { + return new StackVarInfo(varName, varType, initialValue, funcInfo); + } + + /** + * A factory method that returns a descriptor for a global variable with name VARNAME and type + * VARTYPE, whose initial value is specified by INITIALVALUE (if non-null). + * + *

Sub-classes of CodeGenBase can override this method if they wish to use a sub-class of + * GlobalVarInfo with more functionality. + */ + public GlobalVarInfo makeGlobalVarInfo( + String varName, ValueType varType, Literal initialValue) { + return new GlobalVarInfo(varName, varType, initialValue); + } + + /*-----------------------------------------------------------* + * * + * ANALYSIS OF AST INTO INFO OBJECTS * + * (Students can ignore these methods as all the work has * + * been done and does not need to be modified/extended) * + * * + *-----------------------------------------------------------*/ + + /** Analyze PROGRAM, creating Info objects for all symbols. Populate the global symbol table. */ + protected void analyzeProgram(Program program) { + /* Proceed in phases: + * 1. Analyze all global variable declarations. + * Do this first so that global variables are in the symbol + * table before we encounter `global x` declarations. + * 2. Analyze classes and global functions now that global variables + * are in the symbol table. + */ + for (Declaration decl : program.declarations) { + if (decl instanceof VarDef) { + VarDef varDef = (VarDef) decl; + ValueType varType = ValueType.annotationToValueType(varDef.var.type); + GlobalVarInfo globalVar = + makeGlobalVarInfo(varDef.var.identifier.name, varType, varDef.value); + + this.globalVars.add(globalVar); + + this.globalSymbols.put(globalVar.getVarName(), globalVar); + } + } + + for (Declaration decl : program.declarations) { + if (decl instanceof ClassDef) { + ClassDef classDef = (ClassDef) decl; + ClassInfo classInfo = analyzeClass(classDef); + + this.classes.add(classInfo); + + this.globalSymbols.put(classInfo.getClassName(), classInfo); + } else if (decl instanceof FuncDef) { + FuncDef funcDef = (FuncDef) decl; + FuncInfo funcInfo = analyzeFunction(null, funcDef, 0, globalSymbols, null); + + this.functions.add(funcInfo); + + this.globalSymbols.put(funcInfo.getBaseName(), funcInfo); + } + } + } + + /** + * Analyze a class definition CLASSDEF and return the resulting Info object. Also creates Info + * objects for attributes/methods and stores them in the ClassInfo. Methods are recursively + * analyzed using analyzeFunction(). + */ + protected ClassInfo analyzeClass(ClassDef classDef) { + String className = classDef.name.name; + String superClassName = classDef.superClass.name; + SymbolInfo superSymbolInfo = globalSymbols.get(superClassName); + assert superSymbolInfo instanceof ClassInfo + : "Semantic analysis should ensure that super-class is defined"; + ClassInfo superClassInfo = (ClassInfo) superSymbolInfo; + ClassInfo classInfo = makeClassInfo(className, getNextTypeTag(), superClassInfo); + + for (Declaration decl : classDef.declarations) { + if (decl instanceof VarDef) { + VarDef attrDef = (VarDef) decl; + ValueType attrType = ValueType.annotationToValueType(attrDef.var.type); + AttrInfo attrInfo = + makeAttrInfo(attrDef.var.identifier.name, attrType, attrDef.value); + + classInfo.addAttribute(attrInfo); + } else if (decl instanceof FuncDef) { + FuncDef funcDef = (FuncDef) decl; + FuncInfo methodInfo = analyzeFunction(className, funcDef, 0, globalSymbols, null); + + this.functions.add(methodInfo); + + classInfo.addMethod(methodInfo); + } + } + + return classInfo; + } + + /** + * Analyze a function or method definition FUNCDEF at nesting depth DEPTH and return the + * resulting Info object. Analyze any nested functions recursively. The FuncInfo's symbol table + * is completely populated by analyzing all the params, local vars, global and nonlocal var + * declarations. + * + *

CONTAINER is the fully qualified name of the containing function/class, or null for global + * functions. PARENTSYMBOLTABLE symbol table contains symbols inherited from outer regions (that + * of the containing function/method for nested function definitions, and the global symbol + * table for global function / method definitions). PARENTFUNCINFO is the Info object for the + * parent function/method if this definition is nested, and otherwise null. + */ + protected FuncInfo analyzeFunction( + String container, + FuncDef funcDef, + int depth, + SymbolTable parentSymbolTable, + FuncInfo parentFuncInfo) { + /* We proceed in three steps. + * 1. Create the FuncInfo object to be returned. + * 2. Populate it by analyzing all the parameters and local var + * definitions. + * 3. Now that the function's symbol table is built up, analyze + * nested function definitions. + * 4. Add the body to the function descriptor for code gen. + */ + + String funcBaseName = funcDef.name.name; + String funcQualifiedName = + container != null ? String.format("%s.%s", container, funcBaseName) : funcBaseName; + + FuncInfo funcInfo = + makeFuncInfo( + funcQualifiedName, + depth, + ValueType.annotationToValueType(funcDef.returnType), + parentSymbolTable, + parentFuncInfo, + this::emitUserDefinedFunction); + + for (TypedVar param : funcDef.params) { + ValueType paramType = ValueType.annotationToValueType(param.type); + + StackVarInfo paramInfo = + makeStackVarInfo(param.identifier.name, paramType, null, funcInfo); + + funcInfo.addParam(paramInfo); + } + + LocalDeclAnalyzer localDefs = new LocalDeclAnalyzer(funcInfo); + + for (Declaration decl : funcDef.declarations) { + decl.dispatch(localDefs); + } + + NestedFuncAnalyzer nestedFuncs = new NestedFuncAnalyzer(funcInfo); + + for (Declaration decl : funcDef.declarations) { + decl.dispatch(nestedFuncs); + } + + funcInfo.addBody(funcDef.statements); + return funcInfo; + } + + /** Analyzer for local variable declarations in a function. */ + protected class LocalDeclAnalyzer extends AbstractNodeAnalyzer { + /** The descriptor for the function being analyzed. */ + private final FuncInfo funcInfo; + + /** A new analyzer for a function with descriptor FUNCINFO0. */ + protected LocalDeclAnalyzer(FuncInfo funcInfo0) { + funcInfo = funcInfo0; + } + + @Override + public Void analyze(VarDef localVarDef) { + ValueType localVarType = ValueType.annotationToValueType(localVarDef.var.type); + StackVarInfo localVar = + makeStackVarInfo( + localVarDef.var.identifier.name, + localVarType, + localVarDef.value, + funcInfo); + funcInfo.addLocal(localVar); + return null; + } + + @Override + public Void analyze(GlobalDecl decl) { + SymbolInfo symInfo = globalSymbols.get(decl.getIdentifier().name); + assert symInfo instanceof GlobalVarInfo + : "Semantic analysis should ensure that global var exists"; + GlobalVarInfo globalVar = (GlobalVarInfo) symInfo; + funcInfo.getSymbolTable().put(globalVar.getVarName(), globalVar); + return null; + } + + @Override + public Void analyze(NonLocalDecl decl) { + assert funcInfo.getSymbolTable().get(decl.getIdentifier().name) instanceof StackVarInfo + : "Semantic analysis should ensure nonlocal var exists"; + return null; + } + } + + /** Analyzer for nested function declarations in a function. */ + protected class NestedFuncAnalyzer extends AbstractNodeAnalyzer { + /** Descriptor for the function being analyzed. */ + private final FuncInfo funcInfo; + + /** A new analyzer for a function with descriptor FUNCINFO0. */ + protected NestedFuncAnalyzer(FuncInfo funcInfo0) { + funcInfo = funcInfo0; + } + + @Override + public Void analyze(FuncDef nestedFuncDef) { + FuncInfo nestedFuncInfo = + analyzeFunction( + funcInfo.getFuncName(), + nestedFuncDef, + funcInfo.getDepth() + 1, + funcInfo.getSymbolTable(), + funcInfo); + + functions.add(nestedFuncInfo); + + funcInfo.getSymbolTable().put(nestedFuncInfo.getBaseName(), nestedFuncInfo); + return null; + } + } + + /*------------------------------------------------------------* + * * + * EMITING DATA SECTION FOR GLOBALS+PROTOTYPES+CONSTANTS * + * (Students can ignore these methods as all the work has * + * been done and does not need to be modified/extended) * + * * + *------------------------------------------------------------*/ + + /** Emit code to align next data item to word boundary. */ + protected void alignObject() { + int wordSizeLog2 = 31 - Integer.numberOfLeadingZeros(wordSize); + backend.alignNext(wordSizeLog2); + } + + /** Emit the constant section containing the prototype FOR the class defined by CLASSINFO. */ + protected void emitPrototype(ClassInfo classInfo) { + backend.emitGlobalLabel(classInfo.getPrototypeLabel()); + backend.emitWordLiteral( + classInfo.getTypeTag(), + String.format("Type tag for class: %s", classInfo.getClassName())); + backend.emitWordLiteral(classInfo.attributes.size() + HEADER_SIZE, "Object size"); + backend.emitWordAddress(classInfo.getDispatchTableLabel(), "Pointer to dispatch table"); + for (VarInfo attr : classInfo.attributes) { + String cmnt = String.format("Initial value of attribute: %s", attr.getVarName()); + emitConstant(attr.getInitialValue(), attr.getVarType(), cmnt); + } + alignObject(); + } + + /** Emit a word containing a constant int representing VALUE */ + protected void emitConstantInt(int value, String comment) { + backend.emitWordLiteral(value, comment); + } + + /** Emit a word containing a constant bool representing VALUE */ + protected void emitConstantBool(boolean value, String comment) { + backend.emitWordLiteral(value ? 1 : 0, comment); + } + + /** + * Emit a word containing a constant representing VALUE, assuming that it will be interpreted as + * a value of static type TYPE. VALUE may be null, indicating None. TYPE may be null, indicating + * object. COMMENT is an optional comment. + */ + protected void emitConstant(Literal value, ValueType type, String comment) { + if (type != null && type.equals(Type.INT_TYPE)) { + this.emitConstantInt(((IntegerLiteral) value).value, comment); + } else if (type != null && type.equals(Type.BOOL_TYPE)) { + this.emitConstantBool(((BooleanLiteral) value).value, comment); + } else { + backend.emitWordAddress(constants.fromLiteral(value), comment); + } + } + + /** Emit code for all constants. */ + protected void emitConstants() { + backend.emitGlobalLabel(constants.falseConstant); + backend.emitWordLiteral(boolClass.getTypeTag(), "Type tag for class: bool"); + backend.emitWordLiteral(boolClass.attributes.size() + HEADER_SIZE, "Object size"); + backend.emitWordAddress(boolClass.getDispatchTableLabel(), "Pointer to dispatch table"); + backend.emitWordLiteral(0, "Constant value of attribute: __bool__"); + alignObject(); + + backend.emitGlobalLabel(constants.trueConstant); + backend.emitWordLiteral(boolClass.getTypeTag(), "Type tag for class: bool"); + backend.emitWordLiteral(boolClass.attributes.size() + HEADER_SIZE, "Object size"); + backend.emitWordAddress(boolClass.getDispatchTableLabel(), "Pointer to dispatch table"); + backend.emitWordLiteral(1, "Constant value of attribute: __bool__"); + alignObject(); + + for (Map.Entry e : constants.strConstants.entrySet()) { + String value = e.getKey(); + Label label = e.getValue(); + int numWordsForCharacters = value.length() / wordSize + 1; + backend.emitGlobalLabel(label); + backend.emitWordLiteral(strClass.getTypeTag(), "Type tag for class: str"); + backend.emitWordLiteral(3 + 1 + numWordsForCharacters, "Object size"); + backend.emitWordAddress(strClass.getDispatchTableLabel(), "Pointer to dispatch table"); + this.emitConstantInt(value.length(), "Constant value of attribute: __len__"); + backend.emitString(value, "Constant value of attribute: __str__"); + alignObject(); + } + + for (Map.Entry e : constants.intConstants.entrySet()) { + Integer value = e.getKey(); + Label label = e.getValue(); + backend.emitGlobalLabel(label); + backend.emitWordLiteral(intClass.getTypeTag(), "Type tag for class: int"); + backend.emitWordLiteral(intClass.attributes.size() + HEADER_SIZE, "Object size"); + backend.emitWordAddress(intClass.getDispatchTableLabel(), "Pointer to dispatch table"); + backend.emitWordLiteral(value, "Constant value of attribute: __int__"); + alignObject(); + } + } + + /** Emit the method dispatching table for CLASSINFO. */ + protected void emitDispatchTable(ClassInfo classInfo) { + Label dispatchTableLabel = classInfo.getDispatchTableLabel(); + if (dispatchTableLabel == null) { + return; + } + backend.emitGlobalLabel(dispatchTableLabel); + for (FuncInfo method : classInfo.methods) { + String cmnt = + String.format( + "Implementation for method: %s.%s", + classInfo.getClassName(), method.getBaseName()); + backend.emitWordAddress(method.getCodeLabel(), cmnt); + } + } + + /*------------------------------------------------------------* + * * + * UTILITY METHODS TO GET BYTE OFFSETS IN OBJECT LAYOUT * + * (Students will find these methods helpful to use in * + * their sub-class when generating code for expressions) * + * * + *------------------------------------------------------------*/ + + /** Return offset of the type-tag field in an object. */ + protected int getTypeTagOffset() { + return 0 * wordSize; + } + + /** Return offset of the size field in an object. */ + protected int getObjectSizeOffset() { + return 1 * wordSize; + } + + /** Return offset of the start of the pointer to the method-dispatching table in an object. */ + protected int getDispatchTableOffset() { + return 2 * wordSize; + } + + /** Return the offset of the ATTRNAME attribute of an object of type described by CLASSINFO. */ + protected int getAttrOffset(ClassInfo classInfo, String attrName) { + int attrIndex = classInfo.getAttributeIndex(attrName); + assert attrIndex >= 0 : "Type checker ensures that attributes are valid"; + return wordSize * (HEADER_SIZE + attrIndex); + } + + /** + * Return the offset of the method named METHODNAME in the method-dispatching table for the + * class described by CLASSINFO. + */ + protected int getMethodOffset(ClassInfo classInfo, String methodName) { + int methodIndex = classInfo.getMethodIndex(methodName); + assert methodIndex >= 0 : "Type checker ensures that attributes are valid"; + return wordSize * methodIndex; + } + + /*------------------------------------------------------------* + * * + * UNIMPLEMENTED METHODS (should be extended) * + * * + *------------------------------------------------------------*/ + + /** Emits code for STATEMENTS, assumed to be at the top level. */ + protected abstract void emitTopLevel(List statements); + + /** Emits code for the body of user-defined function FUNCINFO. */ + protected abstract void emitUserDefinedFunction(FuncInfo funcInfo); + + /** + * Emits code outside the ChocoPy program. + * + *

Custom assembly routines (that may be jumpable from program statements) can be emitted + * here. + */ + protected abstract void emitCustomCode(); + + /*------------------------------------------------------------* + * * + * PREDEFINED FUNCTIONS AND ROUTINES * + * (Students may find a cursory read of these methods to * + * be useful to get an idea for how code can be emitted) * + * * + *------------------------------------------------------------*/ + + /** + * Return Risc V assembler code for function NAME from directory LIB, or null if it does not + * exist. LIB must end in '/'. + */ + protected String getStandardLibraryCode(String name, String lib) { + String simpleName = name.replace("$", "") + ".s"; + return getResourceFileAsString(lib + simpleName); + } + + /** + * Emit label and body for the function LABEL, taking the source from directory LIB (must end in + * '/'). + */ + protected void emitStdFunc(Label label, String lib) { + emitStdFunc(label, label.toString(), lib); + } + + /** + * Emit label and body for the function LABEL, taking the source from SOURCEFILE.s in directory + * LIB (must end in '/'). + */ + protected void emitStdFunc(Label label, String sourceFile, String lib) { + String source = getStandardLibraryCode(sourceFile, lib); + if (source == null) { + throw fatal("Code for %s is missing.", sourceFile); + } + backend.emitGlobalLabel(label); + backend.emit(convertLiterals(source)); + } + + /** + * Emit label and body for the function LABEL, taking the source from from the default library + * directory. + */ + protected void emitStdFunc(Label label) { + emitStdFunc(label, LIBRARY_CODE_DIR); + } + + /** + * Emit label and body for the function NAME, taking the source from from the default library + * directory. + */ + protected void emitStdFunc(String name) { + emitStdFunc(new Label(name)); + } + + /** + * Emit label and body for the function described by FUNCINFO, taking the source from from the + * default library directory. + */ + protected void emitStdFunc(FuncInfo funcInfo) { + emitStdFunc(funcInfo.getCodeLabel()); + } + + /** Pattern matching STRING["..."]. */ + private static final Pattern STRING_LITERAL_PATN = Pattern.compile("STRING\\[\"(.*?)\"\\]"); + + /** + * Return result of converting STRING["..."] notations in SOURCE to labels of string constants, + * adding those constants to the pool. + */ + private String convertLiterals(String source) { + Matcher matcher = STRING_LITERAL_PATN.matcher(source); + StringBuffer result = new StringBuffer(); + while (matcher.find()) { + String r = constants.getStrConstant(matcher.group(1)).toString(); + matcher.appendReplacement( + result, pad(r, ' ', matcher.end(0) - matcher.start(0), false)); + } + return matcher.appendTail(result).toString(); + } +} diff --git a/src/main/java/chocopy/common/codegen/Constants.java b/src/main/java/chocopy/common/codegen/Constants.java new file mode 100644 index 0000000..e0b80f4 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/Constants.java @@ -0,0 +1,116 @@ +package chocopy.common.codegen; + +import chocopy.common.astnodes.*; + +import java.util.HashMap; +import java.util.Map; + +/** + * A store for caching and re-using program constants that are represented as immutable objects. + * + *

Constants are emitted in assembly in the DATA section, and therefore are represented by their + * labels. + */ +public class Constants { + + /** A counter used to generate unique label names for constants. */ + protected int nextLabelSuffix = 0; + + /** The constant representing the boolean `False`. */ + final Label falseConstant = generateConstantLabel(); + + /** + * The constant representing the boolean `True`. This immediately follows falseConstant in + * static memory. + */ + final Label trueConstant = generateConstantLabel(); + + /** A cache for integer-valued constants. */ + final Map intConstants = new HashMap<>(); + + /** A cache for string-valued constants. */ + final Map strConstants = new HashMap<>(); + + /** + * Returns the next unique label suffix for constants. + * + * @return the next unique label suffix for constants + */ + protected int getNextLabelSuffix() { + return nextLabelSuffix++; + } + + /** + * Generates a fresh label for constants. + * + *

This label is guaranteed to be unique amongst labels generated by invoking this method. + * All such labels have a prefix of `const_`. + * + * @return a fresh label + */ + public Label generateConstantLabel() { + return new Label(String.format("const_%d", getNextLabelSuffix())); + } + + /** + * Returns the label for a `bool` constant. + * + * @param value the boolean value + * @return the label for the boolean value + */ + public Label getBoolConstant(boolean value) { + return value ? trueConstant : falseConstant; + } + + /** + * Returns the label for am `int` constant. + * + * @param value the integer value + * @return the label for the integer value + */ + public Label getIntConstant(int value) { + if (intConstants.containsKey(value)) { + return intConstants.get(value); + } else { + Label newLabel = generateConstantLabel(); + intConstants.put(value, newLabel); + return newLabel; + } + } + + /** + * Returns the label for a `str` constant. + * + * @param value the string value + * @return the label for the string value + */ + public Label getStrConstant(String value) { + if (strConstants.containsKey(value)) { + return strConstants.get(value); + } else { + Label newLabel = generateConstantLabel(); + strConstants.put(value, newLabel); + return newLabel; + } + } + + /** + * Converts a constant literal in the AST to a constant for code generation. + * + * @param literal the literal expression in the AST + * @return a {@link Label} representing a constant int/str/bool, or `null` representing the None + * literal + */ + public Label fromLiteral(Literal literal) { + if (literal instanceof IntegerLiteral) { + return getIntConstant(((IntegerLiteral) literal).value); + } else if (literal instanceof StringLiteral) { + return getStrConstant(((StringLiteral) literal).value); + } else if (literal instanceof BooleanLiteral) { + return getBoolConstant(((BooleanLiteral) literal).value); + } else { + assert literal == null || literal instanceof NoneLiteral; + return null; + } + } +} diff --git a/src/main/java/chocopy/common/codegen/FuncInfo.java b/src/main/java/chocopy/common/codegen/FuncInfo.java new file mode 100644 index 0000000..cdcb4f1 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/FuncInfo.java @@ -0,0 +1,206 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.SymbolTable; +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.Stmt; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +/** + * A descriptor for function and method definitions. + * + *

This class stores information required for code generation such as the information about a + * function's parameters, local variables, the local symbol table, the function body, and the label + * where the code for the body is generated. + */ +public class FuncInfo extends SymbolInfo { + + /** + * The fully-qualified name of the function. + * + *

All functions in a ChocoPy program have a unique fully-qualified name. Global functions + * defined with name `f` have fully-qualified name `f`. Methods `m` in a class `C` have + * fully-qualified name `C.m`. Functions `f` nested inside another function with fully-qualified + * name `F` have a fully-qualified name of `F.f`. + */ + protected final String funcName; + + /** + * The static depth of a function. + * + *

Global functions and class methods have a static depth of 0. Nested functions that are + * defined in the body of a function with static depth `D` have a static depth of `D+1`. + */ + protected final int depth; + + /** This function's return type. */ + protected final ValueType returnType; + + /** A list of parameter names. */ + protected final List params = new ArrayList<>(); + + /** A list of local variable descriptors. */ + protected final List locals = new ArrayList<>(); + + /** The function body. */ + protected final List statements = new ArrayList<>(); + + /** The local symbol table that binds identifiers seen in the function's body. */ + protected final SymbolTable symbolTable; + + /** The label of the generated code for the function's body. */ + protected final Label codeLabel; + + /** The descriptor of the enclosing function (this is only non-null for nested functions). */ + protected final FuncInfo parentFuncInfo; + + /** + * A method that is invoked to emit the function's body. + * + *

The method should accept one parameter of type `FuncInfo`. + */ + protected final Consumer emitter; + + /** + * Creates a descriptor for a function or method with fully qualified name FUNCNAME returning + * type RETURNTYPE that is at nesting depth DEPTH. The code label is formed from FUNCNAME by + * prepending a $ sign to prevent collisions. PARENTSYMBOLTABLE is the symbol table of the + * containing region. PARENTFUNCINFO is the descriptor of the enclosing function (null for + * global functions and methods). EMITTER encapsulates a method that emits the function's body + * (this is usually a generic emitter for user-defined functions/methods, and a special emitter + * for pre-defined functions/methods). + */ + public FuncInfo( + String funcName, + int depth, + ValueType returnType, + SymbolTable parentSymbolTable, + FuncInfo parentFuncInfo, + Consumer emitter) { + this.funcName = funcName; + this.codeLabel = new Label(String.format("$%s", funcName)); + this.depth = depth; + this.returnType = returnType; + this.symbolTable = new SymbolTable<>(parentSymbolTable); + this.parentFuncInfo = parentFuncInfo; + this.emitter = emitter; + } + + /** Adds parameter with descriptor PARAMINFO to this function. */ + public void addParam(StackVarInfo paramInfo) { + this.params.add(paramInfo.getVarName()); + this.symbolTable.put(paramInfo.getVarName(), paramInfo); + } + + /** Adds a local variable with descriptor STACKVARINFO to this function. */ + public void addLocal(StackVarInfo stackVarInfo) { + this.locals.add(stackVarInfo); + this.symbolTable.put(stackVarInfo.getVarName(), stackVarInfo); + } + + /** Adds STMTS to the function's body. */ + public void addBody(List stmts) { + statements.addAll(stmts); + } + + /** + * Returns the index of parameter or local variable NAME in the function's activation record. + * + *

The convention is that for a function with N params and K local vars, the i`th param is at + * index `i` and the j`th local var is at index `N+j+2`. In all, a function stores N+K+2 + * variables contiguously in its activation record, where the N+1st is the frame pointer and the + * N+2nd is the return address. + * + *

Caution: this is an index (starting at 0), and not an offset in number of bytes. + */ + public int getVarIndex(String name) { + int idx = params.indexOf(name); + if (idx >= 0) { + return idx; + } + for (int i = 0; i < locals.size(); i++) { + if (locals.get(i).getVarName().equals(name)) { + return i + params.size() + 2; + } + } + String msg = String.format("%s is not a var defined in function %s", name, funcName); + throw new IllegalArgumentException(msg); + } + + /** Returns the label corresponding to the function's body in assembly. */ + public Label getCodeLabel() { + return codeLabel; + } + + /** + * Returns the function's defined name in the program. This is the last component of the + * dot-separated fully-qualified name. + */ + public String getBaseName() { + int rightmostDotIndex = funcName.lastIndexOf('.'); + if (rightmostDotIndex == -1) { + return funcName; + } else { + return funcName.substring(rightmostDotIndex + 1); + } + } + + /** Returns the function's fully-qualified name. */ + public String getFuncName() { + return funcName; + } + + /** Returns the function's static nesting depth. */ + public int getDepth() { + return depth; + } + + /** Returns the function's parameters in order of definition. */ + public List getParams() { + return params; + } + + /** Returns the return type of this function. */ + public ValueType getReturnType() { + return returnType; + } + + /** + * Returns the function's explicitly defined local variables, excluding parameters. + * + *

This list is mainly used in generating code for initializing local variables that are not + * parameters. + */ + public List getLocals() { + return locals; + } + + /** Returns the list of statements in the function's body. */ + public List getStatements() { + return statements; + } + + /** + * Returns the function's local symbol table. + * + * @return the function's local symbol table + */ + public SymbolTable getSymbolTable() { + return symbolTable; + } + + /** + * Returns the parent function's descriptor for nested functions, and null if this function is + * not nested. + */ + public FuncInfo getParentFuncInfo() { + return parentFuncInfo; + } + + /** Emits the function's body. */ + public void emitBody() { + emitter.accept(this); + } +} diff --git a/src/main/java/chocopy/common/codegen/GlobalVarInfo.java b/src/main/java/chocopy/common/codegen/GlobalVarInfo.java new file mode 100644 index 0000000..15da167 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/GlobalVarInfo.java @@ -0,0 +1,28 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.Literal; + +/** Code-generation related information about a global variable. */ +public class GlobalVarInfo extends VarInfo { + + /** + * This variable resides in static storage tagged with LABEL. The label is prepended with "$" to + * prevent name clashes. + */ + protected final Label label; + + /** + * A descriptor for a global variable named VARNAME of type VARTYPE whose initial value is + * labeled with INITIALVALUE (null if no initialization value). + */ + public GlobalVarInfo(String varName, ValueType varType, Literal initialValue) { + super(varName, varType, initialValue); + this.label = new Label(String.format("$%s", varName)); + } + + /** Return the code location of this variable. */ + public Label getLabel() { + return label; + } +} diff --git a/src/main/java/chocopy/common/codegen/Label.java b/src/main/java/chocopy/common/codegen/Label.java new file mode 100644 index 0000000..fdb9ffc --- /dev/null +++ b/src/main/java/chocopy/common/codegen/Label.java @@ -0,0 +1,40 @@ +package chocopy.common.codegen; + +import java.util.Objects; + +/** A label in assembly. */ +public class Label { + + /** The name of the label. */ + public final String labelName; + + /** A new label with name LABELNAME. */ + public Label(String labelName) { + this.labelName = labelName; + } + + /** {@inheritDoc} */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Label label = (Label) o; + return Objects.equals(labelName, label.labelName); + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + return Objects.hash(labelName); + } + + /** {@inheritDoc} */ + @Override + public String toString() { + return labelName; + } +} diff --git a/src/main/java/chocopy/common/codegen/RiscVBackend.java b/src/main/java/chocopy/common/codegen/RiscVBackend.java new file mode 100644 index 0000000..d1c512c --- /dev/null +++ b/src/main/java/chocopy/common/codegen/RiscVBackend.java @@ -0,0 +1,606 @@ +package chocopy.common.codegen; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** RISC V assembly-language generation utilities. */ +public class RiscVBackend { + + /** Accumulator for assembly code output. */ + protected final StringWriter asmText = new StringWriter(); + + /** Allows print, println, and printf of assembly code. */ + private final PrintWriter out = new PrintWriter(asmText); + + /** The word size in bytes for RISC-V 32-bit. */ + protected static final int WORD_SIZE = 4; + + /** The RISC-V registers. */ + public enum Register { + A0("a0"), + A1("a1"), + A2("a2"), + A3("a3"), + A4("a4"), + A5("a5"), + A6("a6"), + A7("a7"), + T0("t0"), + T1("t1"), + T2("t2"), + T3("t3"), + T4("t4"), + T5("t5"), + T6("t6"), + S1("s1"), + S2("s2"), + S3("s3"), + S4("s4"), + S5("s5"), + S6("s6"), + S7("s7"), + S8("s8"), + S9("s9"), + S10("s10"), + S11("s11"), + FP("fp"), + SP("sp"), + GP("gp"), + RA("ra"), + ZERO("zero"); + + /** The name of the register used in assembly. */ + protected final String name; + + /** This register's code representation is NAME. */ + Register(String name) { + this.name = name; + } + + @Override + public String toString() { + return this.name; + } + } + + @Override + public String toString() { + return asmText.toString(); + } + + /** + * Define @NAME to have the value VALUE. Here, NAME is assumed to be an identifier consisting of + * letters, digits, underscores, and any of the characters '$' or '.', and that does not start + * with a digit. Value may be a numeral or another symbol. + */ + public void defineSym(String name, String value) { + if (name.startsWith("@")) { + emitInsn(String.format(".equiv %s, %s", name, value), null); + } else { + emitInsn(String.format(".equiv @%s, %s", name, value), null); + } + } + + /** + * Define @NAME to have the value VALUE, where value is converted to a string. See {@link + * #defineSym(java.lang.String, java.lang.String)}. + */ + public void defineSym(String name, int value) { + defineSym(name, Integer.toString(value)); + } + + /** + * Returns the word size in bytes. + * + *

This method is used instead of directly accessing the static field {@link #WORD_SIZE}, so + * that this class may be extended with alternate word sizes. + */ + public int getWordSize() { + return WORD_SIZE; + } + + /** Emit the text STR to the output stream verbatim. STR should have no trailing newline. */ + protected void emit(String str) { + out.println(str); + } + + /** Emit instruction or directive INSN along with COMMENT as a one-line comment, if non-null. */ + public void emitInsn(String insn, String comment) { + if (comment != null) { + emit(String.format(" %-40s # %s", insn, comment)); + } else { + emitInsn(insn); + } + } + + /** Emit instruction or directive INSN without a comment. */ + protected void emitInsn(String insn) { + emit(String.format(" %s", insn)); + } + + /** + * Emit a local label marker for LABEL with one-line comment COMMENT (null if missing). Invoke + * only once per unique label. + */ + public void emitLocalLabel(Label label, String comment) { + if (comment != null) { + emit(String.format("%-42s # %s", label + ":", comment)); + } else { + emit(String.format("%s:", label + ":")); + } + } + + /** Emit a global label marker for LABEL. Invoke only once per unique label. */ + public void emitGlobalLabel(Label label) { + emit(String.format("\n.globl %s", label)); + emit(String.format("%s:", label)); + } + + /** + * Emit a data word containing VALUE as an integer value. COMMENT is a emitted as a one-line + * comment, if non-null. + */ + public void emitWordLiteral(Integer value, String comment) { + emitInsn(String.format(".word %s", value), comment); + } + + /** + * Emit a data word containing the address ADDR, or 0 if LABEL is null. COMMENT is a emitted as + * a one-line comment, if non-null. + */ + public void emitWordAddress(Label addr, String comment) { + if (addr == null) { + emitWordLiteral(0, comment); + } else { + emitInsn(String.format(".word %s", addr), comment); + } + } + + /** + * Emit VALUE as an ASCII null-terminated string constant, with COMMENT as its one-line comment, + * if non-null. + */ + public void emitString(String value, String comment) { + String quoted = + value.replace("\\", "\\\\") + .replace("\n", "\\n") + .replace("\t", "\\t") + .replace("\"", "\\\""); + emitInsn(String.format(".string \"%s\"", quoted), comment); + } + + /** Mark the start of a data section. */ + public void startData() { + emit("\n.data"); + } + + /** Mark the start of a code/text section. */ + public void startCode() { + emit("\n.text"); + } + + /** Align the next instruction/word in memory to a multiple of 2**POW bytes. */ + public void alignNext(int pow) { + emitInsn(String.format(".align %d", pow)); + } + + /** Emit an ecall instruction, with one-line comment COMMENT, if non-null. */ + public void emitEcall(String comment) { + emitInsn("ecall", comment); + } + + /** + * Emit a load-address instruction with destination RD and source LABEL. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitLA(Register rd, Label label, String comment) { + emitInsn(String.format("la %s, %s", rd, label), comment); + } + + /** + * Emit a load-immediate pseudo-op to set RD to IMM. COMMENT is an optional one-line comment + * (null if missing). + */ + public void emitLI(Register rd, Integer imm, String comment) { + emitInsn(String.format("li %s, %d", rd, imm), comment); + } + + /** + * Emit a load-upper-immediate instruction to set the upper 20 bits of RD to IMM, where 0 <= IMM + * < 2**20. COMMENT is an optional one-line comment (null if missing). + */ + public void emitLUI(Register rd, Integer imm, String comment) { + emitInsn(String.format("lui %s, %d", rd, imm), comment); + } + + /** + * Emit a move instruction to set RD to the contents of RS. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitMV(Register rd, Register rs, String comment) { + emitInsn(String.format("mv %s, %s", rd, rs), comment); + } + + /** + * Emit a jump-register (computed jump) instruction to the address in RS. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitJR(Register rs, String comment) { + emitInsn(String.format("jr %s", rs), comment); + } + + /** + * Emit a jump (unconditional jump) instruction to LABEL. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitJ(Label label, String comment) { + emitInsn(String.format("j %s", label), comment); + } + + /** + * Emit a jump-and-link instruction to LABEL. COMMENT is an optional one-line comment (null if + * missing). + */ + public void emitJAL(Label label, String comment) { + emitInsn(String.format("jal %s", label), comment); + } + + /** + * Emit a computed-jump-and-link instruction to the address in RS. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitJALR(Register rs, String comment) { + emitInsn(String.format("jalr %s", rs), comment); + } + + /** + * Emit an add-immediate instruction performing RD = RS + IMM. Requires -2048 <= IMM < 2048. + * COMMENT is an optional one-line comment (null if missing). + */ + public void emitADDI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("addi %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit an add-immediate instruction performing RD = RS + IMM. Here, IMM is a string generally + * containing a symbolic assembler constant (see defineSym) representing an integer value, or an + * expression of the form @NAME+NUM or @NAME-NUM. COMMENT is an optional one-line comment (null + * if missing). + */ + public void emitADDI(Register rd, Register rs, String imm, String comment) { + emitInsn(String.format("addi %s, %s, %s", rd, rs, imm), comment); + } + + /** + * Emit an add instruction performing RD = RS1 + RS2 mod 2**32. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitADD(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("add %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a subtract instruction performing RD = RS1 - RS2 mod 2**32. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSUB(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("sub %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a multiply instruction performing RD = RS1 * RS2 mod 2**32. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitMUL(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("mul %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a signed integer divide instruction performing RD = RS1 / RS2 mod 2**32, rounding the + * result toward 0. If RS2 == 0, sets RD to -1. If RS1 == -2**31 and RS2 == -1, sets RD to + * -2**31. COMMENT is an optional one-line comment (null if missing). + */ + public void emitDIV(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("div %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a remainder instruction: RD = RS1 rem RS2 defined so that (RS1 / RS2) * RS2 + (RS1 rem + * RS2) == RS1, where / is as for emitDIV. COMMENT is an optional one-line comment (null if + * missing). + */ + public void emitREM(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("rem %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit an xor instruction: RD = RS1 ^ RS2. COMMENT is an optional one-line comment (null if + * missing). + */ + public void emitXOR(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("xor %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit an xor-immediate instruction: RD = RS ^ IMM, where -2048 <= IMM < 2048. COMMENT is an + * optional one-line comment (null if missing). + */ + public void emitXORI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("xori %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit a bitwise and instruction: RD = RS1 & RS2. COMMENT is an optional one-line comment (null + * if missing). + */ + public void emitAND(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("and %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a bitwise and-immediate instruction: RD = RS & IMM, where -2048 <= IMM < 2048. COMMENT + * is an optional one-line comment (null if missing). + */ + public void emitANDI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("andi %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit a bitwise or instruction: RD = RS1 | RS2. COMMENT is an optional one-line comment (null + * if missing). + */ + public void emitOR(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("or %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a bitwise or-immediate instruction: RD = RS | IMM, where -2048 <= IMM < 2048. COMMENT is + * an optional one-line comment (null if missing). + */ + public void emitORI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("ori %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit a logical left shift instruction: RD = RS1 << (RS2 & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSLL(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("sll %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a logical left shift instruction: RD = RS << (IMM & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSLLI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("slli %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit a logical right shift instruction: RD = RS1 >>> (RS2 & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSRL(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("srl %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a logical right shift instruction: RD = RS >>> (IMM & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSRLI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("srli %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit an arithmetic right shift instruction: RD = RS1 >> (RS2 & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSRA(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("sra %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit an arithmetic right shift instruction: RD = RS >> (IMM & 0x31). COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitSRAI(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("srai %s, %s, %d", rd, rs, imm), comment); + } + + /** + * Emit a load-word instruction: RD = MEMORY[RS + IMM]:4, where -2048 <= IMM < 2048. COMMENT is + * an optional one-line comment (null if missing). + */ + public void emitLW(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("lw %s, %d(%s)", rd, imm, rs), comment); + } + + /** + * Emit a load-word instruction: RD = MEMORY[RS + IMM]:4, where -2048 <= IMM < 2048. Here, IMM + * is symbolic constant expression (see emitADDI). COMMENT is an optional one-line comment (null + * if missing). + */ + public void emitLW(Register rd, Register rs, String imm, String comment) { + emitInsn(String.format("lw %s, %s(%s)", rd, imm, rs), comment); + } + + /** + * Emit a store-word instruction: MEMORY[RS1 + IMM]:4 = RS2, where -2048 <= IMM < 2048. COMMENT + * is an optional one-line comment (null if missing). + */ + public void emitSW(Register rs2, Register rs1, Integer imm, String comment) { + emitInsn(String.format("sw %s, %d(%s)", rs2, imm, rs1), comment); + } + + /** + * Emit a store-word instruction: MEMORY[RS1 + IMM]:4 = RS2, where -2048 <= IMM < 2048. Here, + * IMM is symbolic constant expression (see emitADDI). COMMENT is an optional one-line comment + * (null if missing). + */ + public void emitSW(Register rs2, Register rs1, String imm, String comment) { + emitInsn(String.format("sw %s, %s(%s)", rs2, imm, rs1), comment); + } + + /** + * Emit a load-word instruction for globals: RD = MEMORY[LABEL]:4. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitLW(Register rd, Label label, String comment) { + emitInsn(String.format("lw %s, %s", rd, label), comment); + } + + /** + * Emit a store-word instruction for globals: MEMORY[LABEL]:4 = RS, using TMP as a temporary + * register. COMMENT is an optional one-line comment (null if missing). + */ + public void emitSW(Register rs, Label label, Register tmp, String comment) { + emitInsn(String.format("sw %s, %s, %s", rs, label, tmp), comment); + } + + /** + * Emit a load-byte instruction: RD = MEMORY[RS + IMM]:1, where -2048 <= IMM < 2048. Sign + * extends the byte loaded. COMMENT is an optional one-line comment (null if missing). + */ + public void emitLB(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("lb %s, %d(%s)", rd, imm, rs), comment); + } + + /** + * Emit a load-byte-unsigned instruction: RD = MEMORY[RS + IMM]:1, where -2048 <= IMM < 2048. + * Zero-extends the byte loaded. COMMENT is an optional one-line comment (null if missing). + */ + public void emitLBU(Register rd, Register rs, Integer imm, String comment) { + emitInsn(String.format("lbu %s, %d(%s)", rd, imm, rs), comment); + } + + /** + * Emit a store-byte instruction: MEMORY[RS1 + IMM]:1 = RS2, where -2048 <= IMM < 2048. Assigns + * the low-order byte of RS2 to memory. COMMENT is an optional one-line comment (null if + * missing). + */ + public void emitSB(Register rs2, Register rs1, Integer imm, String comment) { + emitInsn(String.format("sb %s, %d(%s)", rs2, imm, rs1), comment); + } + + /** + * Emit a branch-if-equal instruction: if RS1 == RS2 goto LABEL. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitBEQ(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("beq %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-unequal instruction: if RS1 != RS2 goto LABEL. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitBNE(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("bne %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-greater-or-equal (signed) instruction: if RS1 >= RS2 goto LABEL. COMMENT is + * an optional one-line comment (null if missing). + */ + public void emitBGE(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("bge %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-greater-or-equal (unsigned) instruction: if RS1 >= RS2 goto LABEL. COMMENT + * is an optional one-line comment (null if missing). + */ + public void emitBGEU(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("bgeu %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-less-than (signed) instruction: if RS1 < RS2 goto LABEL. COMMENT is an + * optional one-line comment (null if missing). + */ + public void emitBLT(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("blt %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-less-than (unsigned) instruction: if RS1 < RS2 goto LABEL. COMMENT is an + * optional one-line comment (null if missing). + */ + public void emitBLTU(Register rs1, Register rs2, Label label, String comment) { + emitInsn(String.format("bltu %s, %s, %s", rs1, rs2, label), comment); + } + + /** + * Emit a branch-if-zero instruction: if RS == 0 goto LABEL. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitBEQZ(Register rs, Label label, String comment) { + emitInsn(String.format("beqz %s, %s", rs, label), comment); + } + + /** + * Emit a branch-if-not-zero instruction: if RS != 0 goto LABEL. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitBNEZ(Register rs, Label label, String comment) { + emitInsn(String.format("bnez %s, %s", rs, label), comment); + } + + /** + * Emit a branch-if-less-than-zero instruction: if RS < 0 goto LABEL. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitBLTZ(Register rs, Label label, String comment) { + emitInsn(String.format("bltz %s, %s", rs, label), comment); + } + + /** + * Emit a branch-if-greater-than-zero instruction: if RS > 0 goto LABEL. COMMENT is an optional + * one-line comment (null if missing). + */ + public void emitBGTZ(Register rs, Label label, String comment) { + emitInsn(String.format("bgtz %s, %s", rs, label), comment); + } + + /** + * Emit a branch-if-less-than-equal-to-zero instruction: if RS <= 0 goto LABEL. COMMENT is an + * optional one-line comment (null if missing). + */ + public void emitBLEZ(Register rs, Label label, String comment) { + emitInsn(String.format("blez %s, %s", rs, label), comment); + } + + /** + * Emit a branch-if-greater-than-equal-to-zero instruction: if RS >= 0 goto LABEL. COMMENT is an + * optional one-line comment (null if missing). + */ + public void emitBGEZ(Register rs, Label label, String comment) { + emitInsn(String.format("bgez %s, %s", rs, label), comment); + } + + /** + * Emit a set-less-than instruction: RD = 1 if RS1 < RS2 else 0. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitSLT(Register rd, Register rs1, Register rs2, String comment) { + emitInsn(String.format("slt %s, %s, %s", rd, rs1, rs2), comment); + } + + /** + * Emit a set-if-zero instruction: RD = 1 if RS == 0 else 0. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitSEQZ(Register rd, Register rs, String comment) { + emitInsn(String.format("seqz %s, %s", rd, rs), comment); + } + + /** + * Emit a set-if-not-zero instruction: RD = 1 if RS != 0 else 0. COMMENT is an optional one-line + * comment (null if missing). + */ + public void emitSNEZ(Register rd, Register rs, String comment) { + emitInsn(String.format("snez %s, %s", rd, rs), comment); + } +} diff --git a/src/main/java/chocopy/common/codegen/StackVarInfo.java b/src/main/java/chocopy/common/codegen/StackVarInfo.java new file mode 100644 index 0000000..609d195 --- /dev/null +++ b/src/main/java/chocopy/common/codegen/StackVarInfo.java @@ -0,0 +1,27 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.Literal; + +/** Code-generation information about a local variable or parameter. */ +public class StackVarInfo extends VarInfo { + + /** Information about the enclosing function. */ + protected final FuncInfo funcInfo; + + /** + * A descriptor for a local variable or parameter VARNAME of type VARTYPE, whose initial value + * is given by INITIALVALUE (null if no initial value), and which is nested immediately within + * the function described by FUNCINFO. + */ + public StackVarInfo( + String varName, ValueType varType, Literal initialValue, FuncInfo funcInfo) { + super(varName, varType, initialValue); + this.funcInfo = funcInfo; + } + + /** Returns the descriptor of the function in which this var is defined. */ + public FuncInfo getFuncInfo() { + return funcInfo; + } +} diff --git a/src/main/java/chocopy/common/codegen/SymbolInfo.java b/src/main/java/chocopy/common/codegen/SymbolInfo.java new file mode 100644 index 0000000..d7a864d --- /dev/null +++ b/src/main/java/chocopy/common/codegen/SymbolInfo.java @@ -0,0 +1,7 @@ +package chocopy.common.codegen; + +/** + * Abstract base class for all the Info classes that store information about a symbol during code + * generation. + */ +public abstract class SymbolInfo {} diff --git a/src/main/java/chocopy/common/codegen/VarInfo.java b/src/main/java/chocopy/common/codegen/VarInfo.java new file mode 100644 index 0000000..d213bcd --- /dev/null +++ b/src/main/java/chocopy/common/codegen/VarInfo.java @@ -0,0 +1,40 @@ +package chocopy.common.codegen; + +import chocopy.common.analysis.types.ValueType; +import chocopy.common.astnodes.Literal; + +/** Information about a variable or attribute. */ +public abstract class VarInfo extends SymbolInfo { + + /** Name of variable or attribute. */ + protected final String varName; + /** Runtime location of initial value for this variable or attribute. */ + protected final Literal initialValue; + /** Static type of the variable. */ + protected final ValueType varType; + + /** + * A descriptor for variable or attribute VARNAME with VARTYPE as its static type and + * INITIALVALUE as its initial value (or null if None). + */ + public VarInfo(String varName, ValueType varType, Literal initialValue) { + this.varName = varName; + this.varType = varType; + this.initialValue = initialValue; + } + + /** Returns the name of this variable or attribute. */ + public String getVarName() { + return varName; + } + + /** Returns the type of this variable or attribute. */ + public ValueType getVarType() { + return varType; + } + + /** Returns the initial value of this variable or attribute. */ + public Literal getInitialValue() { + return initialValue; + } +} diff --git a/src/main/java/chocopy/pa3/CodeGenImpl.java b/src/main/java/chocopy/pa3/CodeGenImpl.java new file mode 100644 index 0000000..47a31c8 --- /dev/null +++ b/src/main/java/chocopy/pa3/CodeGenImpl.java @@ -0,0 +1,187 @@ +package chocopy.pa3; + +import chocopy.common.analysis.AbstractNodeAnalyzer; +import chocopy.common.analysis.SymbolTable; +import chocopy.common.astnodes.ReturnStmt; +import chocopy.common.astnodes.Stmt; +import chocopy.common.codegen.*; + +import java.util.List; + +import static chocopy.common.codegen.RiscVBackend.Register.*; + +/** + * This is where the main implementation of PA3 will live. + * + *

A large part of the functionality has already been implemented in the base class, CodeGenBase. + * Make sure to read through that class, since you will want to use many of its fields and utility + * methods in this class when emitting code. + * + *

Also read the PDF spec for details on what the base class does and what APIs it exposes for + * its sub-class (this one). Of particular importance is knowing what all the SymbolInfo classes + * contain. + */ +public class CodeGenImpl extends CodeGenBase { + + /** A code generator emitting instructions to BACKEND. */ + public CodeGenImpl(RiscVBackend backend) { + super(backend); + } + + /** Operation on None. */ + private final Label errorNone = new Label("error.None"); + /** Division by zero. */ + private final Label errorDiv = new Label("error.Div"); + /** Index out of bounds. */ + private final Label errorOob = new Label("error.OOB"); + + /** + * Emits the top level of the program. + * + *

This method is invoked exactly once, and is surrounded by some boilerplate code that: (1) + * initializes the heap before the top-level begins and (2) exits after the top-level ends. + * + *

You only need to generate code for statements. + * + * @param statements top level statements + */ + protected void emitTopLevel(List statements) { + StmtAnalyzer stmtAnalyzer = new StmtAnalyzer(null); + backend.emitADDI( + SP, SP, -2 * backend.getWordSize(), "Saved FP and saved RA (unused at top level)."); + backend.emitSW(ZERO, SP, 0, "Top saved FP is 0."); + backend.emitSW(ZERO, SP, 4, "Top saved RA is 0."); + backend.emitADDI(FP, SP, 2 * backend.getWordSize(), "Set FP to previous SP."); + + for (Stmt stmt : statements) { + stmt.dispatch(stmtAnalyzer); + } + backend.emitLI(A0, EXIT_ECALL, "Code for ecall: exit"); + backend.emitEcall(null); + } + + /** + * Emits the code for a function described by FUNCINFO. + * + *

This method is invoked once per function and method definition. At the code generation + * stage, nested functions are emitted as separate functions of their own. So if function `bar` + * is nested within function `foo`, you only emit `foo`'s code for `foo` and only emit `bar`'s + * code for `bar`. + */ + protected void emitUserDefinedFunction(FuncInfo funcInfo) { + backend.emitGlobalLabel(funcInfo.getCodeLabel()); + StmtAnalyzer stmtAnalyzer = new StmtAnalyzer(funcInfo); + + for (Stmt stmt : funcInfo.getStatements()) { + stmt.dispatch(stmtAnalyzer); + } + + backend.emitMV(A0, ZERO, "Returning None implicitly"); + backend.emitLocalLabel(stmtAnalyzer.epilogue, "Epilogue"); + + // FIXME: {... reset fp etc. ...} + backend.emitJR(RA, "Return to caller"); + } + + /** An analyzer that encapsulates code generation for statements. */ + private class StmtAnalyzer extends AbstractNodeAnalyzer { + /* + * The symbol table has all the info you need to determine + * what a given identifier 'x' in the current scope is. You can + * use it as follows: + * SymbolInfo x = sym.get("x"); + * + * A SymbolInfo can be one the following: + * - ClassInfo: a descriptor for classes + * - FuncInfo: a descriptor for functions/methods + * - AttrInfo: a descriptor for attributes + * - GlobalVarInfo: a descriptor for global variables + * - StackVarInfo: a descriptor for variables allocated on the stack, + * such as locals and parameters + * + * Since the input program is assumed to be semantically + * valid and well-typed at this stage, you can always assume that + * the symbol table contains valid information. For example, in + * an expression `foo()` you KNOW that sym.get("foo") will either be + * a FuncInfo or ClassInfo, but not any of the other infos + * and never null. + * + * The symbol table in funcInfo has already been populated in + * the base class: CodeGenBase. You do not need to add anything to + * the symbol table. Simply query it with an identifier name to + * get a descriptor for a function, class, variable, etc. + * + * The symbol table also maps nonlocal and global vars, so you + * only need to lookup one symbol table and it will fetch the + * appropriate info for the var that is currently in scope. + */ + + /** Symbol table for my statements. */ + private final SymbolTable sym; + + /** Label of code that exits from procedure. */ + protected final Label epilogue; + + /** The descriptor for the current function, or null at the top level. */ + private final FuncInfo funcInfo; + + /** An analyzer for the function described by FUNCINFO0, which is null for the top level. */ + StmtAnalyzer(FuncInfo funcInfo0) { + funcInfo = funcInfo0; + if (funcInfo == null) { + sym = globalSymbols; + } else { + sym = funcInfo.getSymbolTable(); + } + epilogue = generateLocalLabel(); + } + + // FIXME: Example of statement. + @Override + public Void analyze(ReturnStmt stmt) { + // FIXME: Here, we emit an instruction that does nothing. Clearly, + // this is wrong, and you'll have to fix it. + // This is here just to demonstrate how to emit a + // RISC-V instruction. + backend.emitMV(ZERO, ZERO, "No-op"); + return null; + } + + // FIXME: More, of course. + + } + + /** + * Emits custom code in the CODE segment. + * + *

This method is called after emitting the top level and the function bodies for each + * function. + * + *

You can use this method to emit anything you want outside of the top level or functions, + * e.g. custom routines that you may want to call from within your code to do common tasks. This + * is not strictly needed. You might not modify this at all and still complete the assignment. + * + *

To start you off, here is an implementation of three routines that will be commonly needed + * from within the code you will generate for statements. + * + *

The routines are error handlers for operations on None, index out of bounds, and division + * by zero. They never return to their caller. Just jump to one of these routines to throw an + * error and exit the program. For example, to throw an OOB error: backend.emitJ(errorOob, "Go + * to out-of-bounds error and abort"); + */ + protected void emitCustomCode() { + emitErrorFunc(errorNone, "Operation on None"); + emitErrorFunc(errorDiv, "Division by zero"); + emitErrorFunc(errorOob, "Index out of bounds"); + } + + /** Emit an error routine labeled ERRLABEL that aborts with message MSG. */ + private void emitErrorFunc(Label errLabel, String msg) { + backend.emitGlobalLabel(errLabel); + backend.emitLI(A0, ERROR_NONE, "Exit code for: " + msg); + backend.emitLA(A1, constants.getStrConstant(msg), "Load error message as str"); + backend.emitADDI( + A1, A1, getAttrOffset(strClass, "__str__"), "Load address of attribute __str__"); + backend.emitJ(abortLabel, "Abort"); + } +} diff --git a/src/main/java/chocopy/pa3/StudentCodeGen.java b/src/main/java/chocopy/pa3/StudentCodeGen.java new file mode 100644 index 0000000..9a41bdc --- /dev/null +++ b/src/main/java/chocopy/pa3/StudentCodeGen.java @@ -0,0 +1,34 @@ +package chocopy.pa3; + +import chocopy.common.astnodes.Program; +import chocopy.common.codegen.CodeGenBase; +import chocopy.common.codegen.RiscVBackend; + +/** Interface to code generator. */ +public class StudentCodeGen { + + /** + * Perform code generation from PROGRAM, assumed to be well-typed, to RISC-V, returning the + * assembly code. DEBUG iff --debug was on the command line. + */ + public static String process(Program program, boolean debug) { + /* Emit code into a ByteOutputStream, and convert to a string. + * If you need instructions not provided by RiscVBackend, simply + * use an extension of it. */ + try { + RiscVBackend backend = new RiscVBackend(); + CodeGenBase cgen = new CodeGenImpl(backend); + cgen.generate(program); + + return backend.toString(); + } catch (IllegalStateException | IllegalArgumentException e) { + System.err.println( + "Error performing code generation. " + + "Re-run with --debug to see stack trace."); + if (debug) { + e.printStackTrace(); + } + return null; + } + } +} diff --git a/src/test/data/pa3/benchmarks/exp.py b/src/test/data/pa3/benchmarks/exp.py new file mode 100644 index 0000000..3915517 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/exp.py.ast.typed b/src/test/data/pa3/benchmarks/exp.py.ast.typed new file mode 100644 index 0000000..39a7fa1 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/exp.py.ast.typed.s.result b/src/test/data/pa3/benchmarks/exp.py.ast.typed.s.result new file mode 100644 index 0000000..6bce2e5 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/prime.py b/src/test/data/pa3/benchmarks/prime.py new file mode 100644 index 0000000..7568705 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/prime.py.ast.typed b/src/test/data/pa3/benchmarks/prime.py.ast.typed new file mode 100644 index 0000000..a3062b6 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/prime.py.ast.typed.s.result b/src/test/data/pa3/benchmarks/prime.py.ast.typed.s.result new file mode 100644 index 0000000..6beaeaa --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/sieve.py b/src/test/data/pa3/benchmarks/sieve.py new file mode 100644 index 0000000..b6aa977 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/sieve.py.ast.typed b/src/test/data/pa3/benchmarks/sieve.py.ast.typed new file mode 100644 index 0000000..1c0eb6c --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/sieve.py.ast.typed.s.result b/src/test/data/pa3/benchmarks/sieve.py.ast.typed.s.result new file mode 100644 index 0000000..6beaeaa --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/stdlib.py b/src/test/data/pa3/benchmarks/stdlib.py new file mode 100644 index 0000000..e7323bd --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/stdlib.py.ast.typed b/src/test/data/pa3/benchmarks/stdlib.py.ast.typed new file mode 100644 index 0000000..72079ff --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/stdlib.py.ast.typed.s.result b/src/test/data/pa3/benchmarks/stdlib.py.ast.typed.s.result new file mode 100644 index 0000000..3a07fa4 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/tree.py b/src/test/data/pa3/benchmarks/tree.py new file mode 100644 index 0000000..9f337fd --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/tree.py.ast.typed b/src/test/data/pa3/benchmarks/tree.py.ast.typed new file mode 100644 index 0000000..a8d3cb3 --- /dev/null +++ b/src/test/data/pa3/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/src/test/data/pa3/benchmarks/tree.py.ast.typed.s.result b/src/test/data/pa3/benchmarks/tree.py.ast.typed.s.result new file mode 100644 index 0000000..bc9d65b --- /dev/null +++ b/src/test/data/pa3/benchmarks/tree.py.ast.typed.s.result @@ -0,0 +1,4 @@ +175 +15 +23 +42 diff --git a/src/test/data/pa3/sample/call.py b/src/test/data/pa3/sample/call.py new file mode 100644 index 0000000..6b9ba64 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/call.py.ast.typed b/src/test/data/pa3/sample/call.py.ast.typed new file mode 100644 index 0000000..dd6d3f1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/call.py.ast.typed.s.result b/src/test/data/pa3/sample/call.py.ast.typed.s.result new file mode 100644 index 0000000..ff1eea8 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/call_with_args.py b/src/test/data/pa3/sample/call_with_args.py new file mode 100644 index 0000000..bc9b16a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/call_with_args.py.ast.typed b/src/test/data/pa3/sample/call_with_args.py.ast.typed new file mode 100644 index 0000000..0ff917c --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/call_with_args.py.ast.typed.s.result b/src/test/data/pa3/sample/call_with_args.py.ast.typed.s.result new file mode 100644 index 0000000..816ee29 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/error_div_zero.py b/src/test/data/pa3/sample/error_div_zero.py new file mode 100644 index 0000000..f4481c6 --- /dev/null +++ b/src/test/data/pa3/sample/error_div_zero.py @@ -0,0 +1 @@ +print(42 // 0) diff --git a/src/test/data/pa3/sample/error_div_zero.py.ast.typed b/src/test/data/pa3/sample/error_div_zero.py.ast.typed new file mode 100644 index 0000000..c498a39 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/error_div_zero.py.ast.typed.s.result b/src/test/data/pa3/sample/error_div_zero.py.ast.typed.s.result new file mode 100644 index 0000000..3233f6d --- /dev/null +++ b/src/test/data/pa3/sample/error_div_zero.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Division by zero +Exited with error code 2 diff --git a/src/test/data/pa3/sample/error_invalid_print.py b/src/test/data/pa3/sample/error_invalid_print.py new file mode 100644 index 0000000..ca057e5 --- /dev/null +++ b/src/test/data/pa3/sample/error_invalid_print.py @@ -0,0 +1 @@ +print(None) diff --git a/src/test/data/pa3/sample/error_invalid_print.py.ast.typed b/src/test/data/pa3/sample/error_invalid_print.py.ast.typed new file mode 100644 index 0000000..311e64a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/error_invalid_print.py.ast.typed.s.result b/src/test/data/pa3/sample/error_invalid_print.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/src/test/data/pa3/sample/error_invalid_print.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/src/test/data/pa3/sample/error_mod_zero.py b/src/test/data/pa3/sample/error_mod_zero.py new file mode 100644 index 0000000..09cfbef --- /dev/null +++ b/src/test/data/pa3/sample/error_mod_zero.py @@ -0,0 +1 @@ +print(42 % 0) diff --git a/src/test/data/pa3/sample/error_mod_zero.py.ast.typed b/src/test/data/pa3/sample/error_mod_zero.py.ast.typed new file mode 100644 index 0000000..371eb36 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/error_mod_zero.py.ast.typed.s.result b/src/test/data/pa3/sample/error_mod_zero.py.ast.typed.s.result new file mode 100644 index 0000000..3233f6d --- /dev/null +++ b/src/test/data/pa3/sample/error_mod_zero.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Division by zero +Exited with error code 2 diff --git a/src/test/data/pa3/sample/expr_if.py b/src/test/data/pa3/sample/expr_if.py new file mode 100644 index 0000000..e0f0764 --- /dev/null +++ b/src/test/data/pa3/sample/expr_if.py @@ -0,0 +1,2 @@ +print(3 if True else 4) +print(3 if False else 4) diff --git a/src/test/data/pa3/sample/expr_if.py.ast.typed b/src/test/data/pa3/sample/expr_if.py.ast.typed new file mode 100644 index 0000000..3b06e26 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/expr_if.py.ast.typed.s.result b/src/test/data/pa3/sample/expr_if.py.ast.typed.s.result new file mode 100644 index 0000000..b944734 --- /dev/null +++ b/src/test/data/pa3/sample/expr_if.py.ast.typed.s.result @@ -0,0 +1,2 @@ +3 +4 diff --git a/src/test/data/pa3/sample/id_global.py b/src/test/data/pa3/sample/id_global.py new file mode 100644 index 0000000..d72c7d2 --- /dev/null +++ b/src/test/data/pa3/sample/id_global.py @@ -0,0 +1,2 @@ +x:int = 42 +print(x) diff --git a/src/test/data/pa3/sample/id_global.py.ast.typed b/src/test/data/pa3/sample/id_global.py.ast.typed new file mode 100644 index 0000000..9605936 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/id_global.py.ast.typed.s.result b/src/test/data/pa3/sample/id_global.py.ast.typed.s.result new file mode 100644 index 0000000..d81cc07 --- /dev/null +++ b/src/test/data/pa3/sample/id_global.py.ast.typed.s.result @@ -0,0 +1 @@ +42 diff --git a/src/test/data/pa3/sample/id_local.py b/src/test/data/pa3/sample/id_local.py new file mode 100644 index 0000000..ff6dec8 --- /dev/null +++ b/src/test/data/pa3/sample/id_local.py @@ -0,0 +1,5 @@ +def f() -> int: + x:int = 1 + return x + +print(f()) diff --git a/src/test/data/pa3/sample/id_local.py.ast.typed b/src/test/data/pa3/sample/id_local.py.ast.typed new file mode 100644 index 0000000..472aa17 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/id_local.py.ast.typed.s.result b/src/test/data/pa3/sample/id_local.py.ast.typed.s.result new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/src/test/data/pa3/sample/id_local.py.ast.typed.s.result @@ -0,0 +1 @@ +1 diff --git a/src/test/data/pa3/sample/input.py b/src/test/data/pa3/sample/input.py new file mode 100644 index 0000000..a47c902 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/input.py.ast.in b/src/test/data/pa3/sample/input.py.ast.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/src/test/data/pa3/sample/input.py.ast.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/src/test/data/pa3/sample/input.py.ast.typed b/src/test/data/pa3/sample/input.py.ast.typed new file mode 100644 index 0000000..edf0a5d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/input.py.ast.typed.in b/src/test/data/pa3/sample/input.py.ast.typed.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/src/test/data/pa3/sample/input.py.ast.typed.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/src/test/data/pa3/sample/input.py.ast.typed.s.result b/src/test/data/pa3/sample/input.py.ast.typed.s.result new file mode 100644 index 0000000..86e7fe4 --- /dev/null +++ b/src/test/data/pa3/sample/input.py.ast.typed.s.result @@ -0,0 +1,8 @@ +First line. + +Next line is blank. + + + +Last line. + diff --git a/src/test/data/pa3/sample/input.py.in b/src/test/data/pa3/sample/input.py.in new file mode 100644 index 0000000..2638e9f --- /dev/null +++ b/src/test/data/pa3/sample/input.py.in @@ -0,0 +1,4 @@ +First line. +Next line is blank. + +Last line. diff --git a/src/test/data/pa3/sample/len_invalid_1.py b/src/test/data/pa3/sample/len_invalid_1.py new file mode 100644 index 0000000..1dfa598 --- /dev/null +++ b/src/test/data/pa3/sample/len_invalid_1.py @@ -0,0 +1,3 @@ +x:[int] = None + +print(len(x)) diff --git a/src/test/data/pa3/sample/len_invalid_1.py.ast.typed b/src/test/data/pa3/sample/len_invalid_1.py.ast.typed new file mode 100644 index 0000000..170d7ee --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/len_invalid_1.py.ast.typed.s.result b/src/test/data/pa3/sample/len_invalid_1.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/src/test/data/pa3/sample/len_invalid_1.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/src/test/data/pa3/sample/len_invalid_2.py b/src/test/data/pa3/sample/len_invalid_2.py new file mode 100644 index 0000000..de46502 --- /dev/null +++ b/src/test/data/pa3/sample/len_invalid_2.py @@ -0,0 +1,3 @@ +x:int = 1 + +print(len(x)) diff --git a/src/test/data/pa3/sample/len_invalid_2.py.ast.typed b/src/test/data/pa3/sample/len_invalid_2.py.ast.typed new file mode 100644 index 0000000..afc264d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/len_invalid_2.py.ast.typed.s.result b/src/test/data/pa3/sample/len_invalid_2.py.ast.typed.s.result new file mode 100644 index 0000000..cfb08fa --- /dev/null +++ b/src/test/data/pa3/sample/len_invalid_2.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Invalid argument +Exited with error code 1 diff --git a/src/test/data/pa3/sample/list_concat.py b/src/test/data/pa3/sample/list_concat.py new file mode 100644 index 0000000..d2ef21d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_concat.py.ast.typed b/src/test/data/pa3/sample/list_concat.py.ast.typed new file mode 100644 index 0000000..38ba198 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_concat.py.ast.typed.s.result b/src/test/data/pa3/sample/list_concat.py.ast.typed.s.result new file mode 100644 index 0000000..b414108 --- /dev/null +++ b/src/test/data/pa3/sample/list_concat.py.ast.typed.s.result @@ -0,0 +1,6 @@ +1 +2 +3 +4 +5 +6 diff --git a/src/test/data/pa3/sample/list_concat_2.py b/src/test/data/pa3/sample/list_concat_2.py new file mode 100644 index 0000000..ed0826c --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_concat_2.py.ast.typed b/src/test/data/pa3/sample/list_concat_2.py.ast.typed new file mode 100644 index 0000000..f5a28b0 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_concat_2.py.ast.typed.s.result b/src/test/data/pa3/sample/list_concat_2.py.ast.typed.s.result new file mode 100644 index 0000000..0719398 --- /dev/null +++ b/src/test/data/pa3/sample/list_concat_2.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/src/test/data/pa3/sample/list_concat_none.py b/src/test/data/pa3/sample/list_concat_none.py new file mode 100644 index 0000000..ad0a310 --- /dev/null +++ b/src/test/data/pa3/sample/list_concat_none.py @@ -0,0 +1,4 @@ +x:[int] = None +y:[int] = None + +print(len(x+y)) diff --git a/src/test/data/pa3/sample/list_concat_none.py.ast.typed b/src/test/data/pa3/sample/list_concat_none.py.ast.typed new file mode 100644 index 0000000..5c50b2a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_concat_none.py.ast.typed.s.result b/src/test/data/pa3/sample/list_concat_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/src/test/data/pa3/sample/list_concat_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/src/test/data/pa3/sample/list_get_element.py b/src/test/data/pa3/sample/list_get_element.py new file mode 100644 index 0000000..54a3835 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element.py.ast.typed b/src/test/data/pa3/sample/list_get_element.py.ast.typed new file mode 100644 index 0000000..71a94cb --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/src/test/data/pa3/sample/list_get_element_complex.py b/src/test/data/pa3/sample/list_get_element_complex.py new file mode 100644 index 0000000..fe03e8d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_complex.py.ast.typed b/src/test/data/pa3/sample/list_get_element_complex.py.ast.typed new file mode 100644 index 0000000..f3c48bb --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_complex.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element_complex.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_complex.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/src/test/data/pa3/sample/list_get_element_none.py b/src/test/data/pa3/sample/list_get_element_none.py new file mode 100644 index 0000000..871b395 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_none.py @@ -0,0 +1,3 @@ +x:[int] = None + +print(x[0]) diff --git a/src/test/data/pa3/sample/list_get_element_none.py.ast.typed b/src/test/data/pa3/sample/list_get_element_none.py.ast.typed new file mode 100644 index 0000000..a95c813 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_none.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/src/test/data/pa3/sample/list_get_element_oob_1.py b/src/test/data/pa3/sample/list_get_element_oob_1.py new file mode 100644 index 0000000..7b0e490 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_oob_1.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(x[-1]) diff --git a/src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed b/src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed new file mode 100644 index 0000000..c5e9254 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_oob_2.py b/src/test/data/pa3/sample/list_get_element_oob_2.py new file mode 100644 index 0000000..ba070b2 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_oob_2.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(x[3]) diff --git a/src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed b/src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed new file mode 100644 index 0000000..070d13b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_oob_3.py b/src/test/data/pa3/sample/list_get_element_oob_3.py new file mode 100644 index 0000000..827aae5 --- /dev/null +++ b/src/test/data/pa3/sample/list_get_element_oob_3.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +print(x[0]) diff --git a/src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed b/src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed new file mode 100644 index 0000000..aaeb34f --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed.s.result b/src/test/data/pa3/sample/list_get_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_len.py b/src/test/data/pa3/sample/list_len.py new file mode 100644 index 0000000..95ba341 --- /dev/null +++ b/src/test/data/pa3/sample/list_len.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [1, 2, 3] +print(len(x)) diff --git a/src/test/data/pa3/sample/list_len.py.ast.typed b/src/test/data/pa3/sample/list_len.py.ast.typed new file mode 100644 index 0000000..5a34893 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_len.py.ast.typed.s.result b/src/test/data/pa3/sample/list_len.py.ast.typed.s.result new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/src/test/data/pa3/sample/list_len.py.ast.typed.s.result @@ -0,0 +1 @@ +3 diff --git a/src/test/data/pa3/sample/list_len_empty.py b/src/test/data/pa3/sample/list_len_empty.py new file mode 100644 index 0000000..52bd178 --- /dev/null +++ b/src/test/data/pa3/sample/list_len_empty.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +print(len(x)) diff --git a/src/test/data/pa3/sample/list_len_empty.py.ast.typed b/src/test/data/pa3/sample/list_len_empty.py.ast.typed new file mode 100644 index 0000000..4b70475 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_len_empty.py.ast.typed.s.result b/src/test/data/pa3/sample/list_len_empty.py.ast.typed.s.result new file mode 100644 index 0000000..573541a --- /dev/null +++ b/src/test/data/pa3/sample/list_len_empty.py.ast.typed.s.result @@ -0,0 +1 @@ +0 diff --git a/src/test/data/pa3/sample/list_set_element.py b/src/test/data/pa3/sample/list_set_element.py new file mode 100644 index 0000000..c678fe9 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element.py.ast.typed b/src/test/data/pa3/sample/list_set_element.py.ast.typed new file mode 100644 index 0000000..69649ee --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element.py.ast.typed.s.result b/src/test/data/pa3/sample/list_set_element.py.ast.typed.s.result new file mode 100644 index 0000000..4578bc1 --- /dev/null +++ b/src/test/data/pa3/sample/list_set_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +4 +5 +6 diff --git a/src/test/data/pa3/sample/list_set_element_none.py b/src/test/data/pa3/sample/list_set_element_none.py new file mode 100644 index 0000000..281c7b4 --- /dev/null +++ b/src/test/data/pa3/sample/list_set_element_none.py @@ -0,0 +1,4 @@ +x:[int] = None + +x[0] = 1 + diff --git a/src/test/data/pa3/sample/list_set_element_none.py.ast.typed b/src/test/data/pa3/sample/list_set_element_none.py.ast.typed new file mode 100644 index 0000000..fd16a97 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_none.py.ast.typed.s.result b/src/test/data/pa3/sample/list_set_element_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/src/test/data/pa3/sample/list_set_element_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/src/test/data/pa3/sample/list_set_element_oob_1.py b/src/test/data/pa3/sample/list_set_element_oob_1.py new file mode 100644 index 0000000..efd92ca --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed b/src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed new file mode 100644 index 0000000..ed84b22 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed.s.result b/src/test/data/pa3/sample/list_set_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_2.py b/src/test/data/pa3/sample/list_set_element_oob_2.py new file mode 100644 index 0000000..301cea1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed b/src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed new file mode 100644 index 0000000..5c06dca --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed.s.result b/src/test/data/pa3/sample/list_set_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_3.py b/src/test/data/pa3/sample/list_set_element_oob_3.py new file mode 100644 index 0000000..281c93c --- /dev/null +++ b/src/test/data/pa3/sample/list_set_element_oob_3.py @@ -0,0 +1,4 @@ +x:[int] = None + +x = [] +x[0] = 4 diff --git a/src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed b/src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed new file mode 100644 index 0000000..ec34032 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed.s.result b/src/test/data/pa3/sample/list_set_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/literal_bool.py b/src/test/data/pa3/sample/literal_bool.py new file mode 100644 index 0000000..54b7f1f --- /dev/null +++ b/src/test/data/pa3/sample/literal_bool.py @@ -0,0 +1,2 @@ +print(True) +print(False) diff --git a/src/test/data/pa3/sample/literal_bool.py.ast.typed b/src/test/data/pa3/sample/literal_bool.py.ast.typed new file mode 100644 index 0000000..436e5f7 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/literal_bool.py.ast.typed.s.result b/src/test/data/pa3/sample/literal_bool.py.ast.typed.s.result new file mode 100644 index 0000000..1cc8b5e --- /dev/null +++ b/src/test/data/pa3/sample/literal_bool.py.ast.typed.s.result @@ -0,0 +1,2 @@ +True +False diff --git a/src/test/data/pa3/sample/literal_int.py b/src/test/data/pa3/sample/literal_int.py new file mode 100644 index 0000000..3e78541 --- /dev/null +++ b/src/test/data/pa3/sample/literal_int.py @@ -0,0 +1,2 @@ +print(42) +print(65999) diff --git a/src/test/data/pa3/sample/literal_int.py.ast.typed b/src/test/data/pa3/sample/literal_int.py.ast.typed new file mode 100644 index 0000000..eed7bda --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/literal_int.py.ast.typed.s.result b/src/test/data/pa3/sample/literal_int.py.ast.typed.s.result new file mode 100644 index 0000000..454025b --- /dev/null +++ b/src/test/data/pa3/sample/literal_int.py.ast.typed.s.result @@ -0,0 +1,2 @@ +42 +65999 diff --git a/src/test/data/pa3/sample/literal_str.py b/src/test/data/pa3/sample/literal_str.py new file mode 100644 index 0000000..ad35e5a --- /dev/null +++ b/src/test/data/pa3/sample/literal_str.py @@ -0,0 +1 @@ +print("Hello World") diff --git a/src/test/data/pa3/sample/literal_str.py.ast.typed b/src/test/data/pa3/sample/literal_str.py.ast.typed new file mode 100644 index 0000000..9b924a5 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/literal_str.py.ast.typed.s.result b/src/test/data/pa3/sample/literal_str.py.ast.typed.s.result new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/src/test/data/pa3/sample/literal_str.py.ast.typed.s.result @@ -0,0 +1 @@ +Hello World diff --git a/src/test/data/pa3/sample/nested.py b/src/test/data/pa3/sample/nested.py new file mode 100644 index 0000000..3faa85b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/nested.py.ast.typed b/src/test/data/pa3/sample/nested.py.ast.typed new file mode 100644 index 0000000..ecdc57d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/nested.py.ast.typed.s.result b/src/test/data/pa3/sample/nested.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/src/test/data/pa3/sample/nested.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/src/test/data/pa3/sample/nested2.py b/src/test/data/pa3/sample/nested2.py new file mode 100644 index 0000000..abafcce --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/nested2.py.ast.typed b/src/test/data/pa3/sample/nested2.py.ast.typed new file mode 100644 index 0000000..8955e9f --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/nested2.py.ast.typed.s.result b/src/test/data/pa3/sample/nested2.py.ast.typed.s.result new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/src/test/data/pa3/sample/nested2.py.ast.typed.s.result @@ -0,0 +1 @@ +2 diff --git a/src/test/data/pa3/sample/object_attr_get.py b/src/test/data/pa3/sample/object_attr_get.py new file mode 100644 index 0000000..a6bed67 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_get.py.ast.typed b/src/test/data/pa3/sample/object_attr_get.py.ast.typed new file mode 100644 index 0000000..f87f054 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_get.py.ast.typed.s.result b/src/test/data/pa3/sample/object_attr_get.py.ast.typed.s.result new file mode 100644 index 0000000..79171bc --- /dev/null +++ b/src/test/data/pa3/sample/object_attr_get.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +42 +42 +True diff --git a/src/test/data/pa3/sample/object_attr_get_none.py b/src/test/data/pa3/sample/object_attr_get_none.py new file mode 100644 index 0000000..270bb16 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_get_none.py.ast.typed b/src/test/data/pa3/sample/object_attr_get_none.py.ast.typed new file mode 100644 index 0000000..2787984 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_get_none.py.ast.typed.s.result b/src/test/data/pa3/sample/object_attr_get_none.py.ast.typed.s.result new file mode 100644 index 0000000..80d81d1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set.py b/src/test/data/pa3/sample/object_attr_set.py new file mode 100644 index 0000000..4183999 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set.py.ast.typed b/src/test/data/pa3/sample/object_attr_set.py.ast.typed new file mode 100644 index 0000000..4ea6427 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set.py.ast.typed.s.result b/src/test/data/pa3/sample/object_attr_set.py.ast.typed.s.result new file mode 100644 index 0000000..abf1b17 --- /dev/null +++ b/src/test/data/pa3/sample/object_attr_set.py.ast.typed.s.result @@ -0,0 +1,4 @@ +B +1 +1 +False diff --git a/src/test/data/pa3/sample/object_attr_set_eval_order.py b/src/test/data/pa3/sample/object_attr_set_eval_order.py new file mode 100644 index 0000000..162559d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed b/src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed new file mode 100644 index 0000000..16ae244 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed.s.result b/src/test/data/pa3/sample/object_attr_set_eval_order.py.ast.typed.s.result new file mode 100644 index 0000000..3f82dac --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set_none.py b/src/test/data/pa3/sample/object_attr_set_none.py new file mode 100644 index 0000000..bfd3184 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set_none.py.ast.typed b/src/test/data/pa3/sample/object_attr_set_none.py.ast.typed new file mode 100644 index 0000000..e6f5695 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_attr_set_none.py.ast.typed.s.result b/src/test/data/pa3/sample/object_attr_set_none.py.ast.typed.s.result new file mode 100644 index 0000000..80d81d1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_init.py b/src/test/data/pa3/sample/object_init.py new file mode 100644 index 0000000..e48a5cd --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_init.py.ast.typed b/src/test/data/pa3/sample/object_init.py.ast.typed new file mode 100644 index 0000000..1ed066e --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_init.py.ast.typed.s.result b/src/test/data/pa3/sample/object_init.py.ast.typed.s.result new file mode 100644 index 0000000..223b783 --- /dev/null +++ b/src/test/data/pa3/sample/object_init.py.ast.typed.s.result @@ -0,0 +1 @@ +B diff --git a/src/test/data/pa3/sample/object_method.py b/src/test/data/pa3/sample/object_method.py new file mode 100644 index 0000000..6b71299 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method.py.ast.typed b/src/test/data/pa3/sample/object_method.py.ast.typed new file mode 100644 index 0000000..955c83b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method.py.ast.typed.s.result b/src/test/data/pa3/sample/object_method.py.ast.typed.s.result new file mode 100644 index 0000000..418c69b --- /dev/null +++ b/src/test/data/pa3/sample/object_method.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +42 diff --git a/src/test/data/pa3/sample/object_method_complex_call.py b/src/test/data/pa3/sample/object_method_complex_call.py new file mode 100644 index 0000000..d82ec1b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_complex_call.py.ast.typed b/src/test/data/pa3/sample/object_method_complex_call.py.ast.typed new file mode 100644 index 0000000..270f634 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_complex_call.py.ast.typed.s.result b/src/test/data/pa3/sample/object_method_complex_call.py.ast.typed.s.result new file mode 100644 index 0000000..f83c3f1 --- /dev/null +++ b/src/test/data/pa3/sample/object_method_complex_call.py.ast.typed.s.result @@ -0,0 +1,3 @@ +B +... +1 diff --git a/src/test/data/pa3/sample/object_method_nested.py b/src/test/data/pa3/sample/object_method_nested.py new file mode 100644 index 0000000..b193ecd --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_nested.py.ast.typed b/src/test/data/pa3/sample/object_method_nested.py.ast.typed new file mode 100644 index 0000000..5480892 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_nested.py.ast.typed.s.result b/src/test/data/pa3/sample/object_method_nested.py.ast.typed.s.result new file mode 100644 index 0000000..418c69b --- /dev/null +++ b/src/test/data/pa3/sample/object_method_nested.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +42 diff --git a/src/test/data/pa3/sample/object_method_none.py b/src/test/data/pa3/sample/object_method_none.py new file mode 100644 index 0000000..cd50666 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_none.py.ast.typed b/src/test/data/pa3/sample/object_method_none.py.ast.typed new file mode 100644 index 0000000..db92330 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_none.py.ast.typed.s.result b/src/test/data/pa3/sample/object_method_none.py.ast.typed.s.result new file mode 100644 index 0000000..d9d147e --- /dev/null +++ b/src/test/data/pa3/sample/object_method_none.py.ast.typed.s.result @@ -0,0 +1,3 @@ +B +Operation on None +Exited with error code 4 diff --git a/src/test/data/pa3/sample/object_method_override.py b/src/test/data/pa3/sample/object_method_override.py new file mode 100644 index 0000000..879b2ba --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_override.py.ast.typed b/src/test/data/pa3/sample/object_method_override.py.ast.typed new file mode 100644 index 0000000..5684f7d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/object_method_override.py.ast.typed.s.result b/src/test/data/pa3/sample/object_method_override.py.ast.typed.s.result new file mode 100644 index 0000000..9a6e55a --- /dev/null +++ b/src/test/data/pa3/sample/object_method_override.py.ast.typed.s.result @@ -0,0 +1,2 @@ +B +1 diff --git a/src/test/data/pa3/sample/op_add.py b/src/test/data/pa3/sample/op_add.py new file mode 100644 index 0000000..95e89ae --- /dev/null +++ b/src/test/data/pa3/sample/op_add.py @@ -0,0 +1 @@ +print(1 + 100) diff --git a/src/test/data/pa3/sample/op_add.py.ast.typed b/src/test/data/pa3/sample/op_add.py.ast.typed new file mode 100644 index 0000000..a0a2d9b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_add.py.ast.typed.s.result b/src/test/data/pa3/sample/op_add.py.ast.typed.s.result new file mode 100644 index 0000000..398050c --- /dev/null +++ b/src/test/data/pa3/sample/op_add.py.ast.typed.s.result @@ -0,0 +1 @@ +101 diff --git a/src/test/data/pa3/sample/op_cmp_bool.py b/src/test/data/pa3/sample/op_cmp_bool.py new file mode 100644 index 0000000..7f8d4b5 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_cmp_bool.py.ast.typed b/src/test/data/pa3/sample/op_cmp_bool.py.ast.typed new file mode 100644 index 0000000..4c25364 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_cmp_bool.py.ast.typed.s.result b/src/test/data/pa3/sample/op_cmp_bool.py.ast.typed.s.result new file mode 100644 index 0000000..12ea2d4 --- /dev/null +++ b/src/test/data/pa3/sample/op_cmp_bool.py.ast.typed.s.result @@ -0,0 +1,8 @@ +True +False +False +True +False +True +True +False diff --git a/src/test/data/pa3/sample/op_cmp_int.py b/src/test/data/pa3/sample/op_cmp_int.py new file mode 100644 index 0000000..fd70a09 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_cmp_int.py.ast.typed b/src/test/data/pa3/sample/op_cmp_int.py.ast.typed new file mode 100644 index 0000000..4b3633f --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_cmp_int.py.ast.typed.s.result b/src/test/data/pa3/sample/op_cmp_int.py.ast.typed.s.result new file mode 100644 index 0000000..4386d2a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_div_mod.py b/src/test/data/pa3/sample/op_div_mod.py new file mode 100644 index 0000000..9e41a78 --- /dev/null +++ b/src/test/data/pa3/sample/op_div_mod.py @@ -0,0 +1,5 @@ +x:int = 42 +y:int = 9 + +print(x // y) +print(x % y) diff --git a/src/test/data/pa3/sample/op_div_mod.py.ast.typed b/src/test/data/pa3/sample/op_div_mod.py.ast.typed new file mode 100644 index 0000000..eded4a3 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_div_mod.py.ast.typed.s.result b/src/test/data/pa3/sample/op_div_mod.py.ast.typed.s.result new file mode 100644 index 0000000..cfbeb15 --- /dev/null +++ b/src/test/data/pa3/sample/op_div_mod.py.ast.typed.s.result @@ -0,0 +1,2 @@ +4 +6 diff --git a/src/test/data/pa3/sample/op_is.py b/src/test/data/pa3/sample/op_is.py new file mode 100644 index 0000000..4207f29 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_is.py.ast.typed b/src/test/data/pa3/sample/op_is.py.ast.typed new file mode 100644 index 0000000..962be5e --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_is.py.ast.typed.s.result b/src/test/data/pa3/sample/op_is.py.ast.typed.s.result new file mode 100644 index 0000000..0ac4f5b --- /dev/null +++ b/src/test/data/pa3/sample/op_is.py.ast.typed.s.result @@ -0,0 +1,7 @@ +True +True +False +False +False +True +True diff --git a/src/test/data/pa3/sample/op_logical.py b/src/test/data/pa3/sample/op_logical.py new file mode 100644 index 0000000..7b55262 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_logical.py.ast.typed b/src/test/data/pa3/sample/op_logical.py.ast.typed new file mode 100644 index 0000000..4aa1544 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_logical.py.ast.typed.s.result b/src/test/data/pa3/sample/op_logical.py.ast.typed.s.result new file mode 100644 index 0000000..82c1ab2 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_mul.py b/src/test/data/pa3/sample/op_mul.py new file mode 100644 index 0000000..cf6201d --- /dev/null +++ b/src/test/data/pa3/sample/op_mul.py @@ -0,0 +1 @@ +print(6*9*2) diff --git a/src/test/data/pa3/sample/op_mul.py.ast.typed b/src/test/data/pa3/sample/op_mul.py.ast.typed new file mode 100644 index 0000000..6ed26cc --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_mul.py.ast.typed.s.result b/src/test/data/pa3/sample/op_mul.py.ast.typed.s.result new file mode 100644 index 0000000..3b20426 --- /dev/null +++ b/src/test/data/pa3/sample/op_mul.py.ast.typed.s.result @@ -0,0 +1 @@ +108 diff --git a/src/test/data/pa3/sample/op_negate.py b/src/test/data/pa3/sample/op_negate.py new file mode 100644 index 0000000..0f3b2be --- /dev/null +++ b/src/test/data/pa3/sample/op_negate.py @@ -0,0 +1,2 @@ +x:int = 42 +print(-x) diff --git a/src/test/data/pa3/sample/op_negate.py.ast.typed b/src/test/data/pa3/sample/op_negate.py.ast.typed new file mode 100644 index 0000000..4268b3b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_negate.py.ast.typed.s.result b/src/test/data/pa3/sample/op_negate.py.ast.typed.s.result new file mode 100644 index 0000000..6a0e60d --- /dev/null +++ b/src/test/data/pa3/sample/op_negate.py.ast.typed.s.result @@ -0,0 +1 @@ +-42 diff --git a/src/test/data/pa3/sample/op_sub.py b/src/test/data/pa3/sample/op_sub.py new file mode 100644 index 0000000..48aa45b --- /dev/null +++ b/src/test/data/pa3/sample/op_sub.py @@ -0,0 +1 @@ +print(1 - 100) diff --git a/src/test/data/pa3/sample/op_sub.py.ast.typed b/src/test/data/pa3/sample/op_sub.py.ast.typed new file mode 100644 index 0000000..2c927e8 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/op_sub.py.ast.typed.s.result b/src/test/data/pa3/sample/op_sub.py.ast.typed.s.result new file mode 100644 index 0000000..d3a0ef5 --- /dev/null +++ b/src/test/data/pa3/sample/op_sub.py.ast.typed.s.result @@ -0,0 +1 @@ +-99 diff --git a/src/test/data/pa3/sample/pass.py b/src/test/data/pa3/sample/pass.py new file mode 100644 index 0000000..2ae2839 --- /dev/null +++ b/src/test/data/pa3/sample/pass.py @@ -0,0 +1 @@ +pass diff --git a/src/test/data/pa3/sample/pass.py.ast.typed b/src/test/data/pa3/sample/pass.py.ast.typed new file mode 100644 index 0000000..ceb0bbd --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/pass.py.ast.typed.s.result b/src/test/data/pa3/sample/pass.py.ast.typed.s.result new file mode 100644 index 0000000..e69de29 diff --git a/src/test/data/pa3/sample/predef_constructors.py b/src/test/data/pa3/sample/predef_constructors.py new file mode 100644 index 0000000..0086564 --- /dev/null +++ b/src/test/data/pa3/sample/predef_constructors.py @@ -0,0 +1,4 @@ +print(object() is None) +print(int()) +print(str()) +print(bool()) diff --git a/src/test/data/pa3/sample/predef_constructors.py.ast.typed b/src/test/data/pa3/sample/predef_constructors.py.ast.typed new file mode 100644 index 0000000..3644f24 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/predef_constructors.py.ast.typed.s.result b/src/test/data/pa3/sample/predef_constructors.py.ast.typed.s.result new file mode 100644 index 0000000..8add9b0 --- /dev/null +++ b/src/test/data/pa3/sample/predef_constructors.py.ast.typed.s.result @@ -0,0 +1,4 @@ +False +0 + +False diff --git a/src/test/data/pa3/sample/stmt_for_list.py b/src/test/data/pa3/sample/stmt_for_list.py new file mode 100644 index 0000000..78c5c00 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list.py.ast.typed new file mode 100644 index 0000000..53d6834 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/src/test/data/pa3/sample/stmt_for_list_empty.py b/src/test/data/pa3/sample/stmt_for_list_empty.py new file mode 100644 index 0000000..23fba4a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed new file mode 100644 index 0000000..ca4160c --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_empty.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/src/test/data/pa3/sample/stmt_for_list_eval.py b/src/test/data/pa3/sample/stmt_for_list_eval.py new file mode 100644 index 0000000..a77b171 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed new file mode 100644 index 0000000..c86d718 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed.s.result new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_eval.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/src/test/data/pa3/sample/stmt_for_list_modify.py b/src/test/data/pa3/sample/stmt_for_list_modify.py new file mode 100644 index 0000000..3006cd2 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed new file mode 100644 index 0000000..fa19b60 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed.s.result new file mode 100644 index 0000000..e8183f0 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_modify.py.ast.typed.s.result @@ -0,0 +1,3 @@ +1 +1 +1 diff --git a/src/test/data/pa3/sample/stmt_for_list_nested.py b/src/test/data/pa3/sample/stmt_for_list_nested.py new file mode 100644 index 0000000..b69f3f0 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed new file mode 100644 index 0000000..0521e4a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_nested.py.ast.typed.s.result new file mode 100644 index 0000000..0d1fb9e --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py b/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py new file mode 100644 index 0000000..0057164 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed new file mode 100644 index 0000000..2feac51 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_nested_same_var.py.ast.typed.s.result new file mode 100644 index 0000000..a8401b1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_none.py b/src/test/data/pa3/sample/stmt_for_list_none.py new file mode 100644 index 0000000..fd511fa --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_none.py @@ -0,0 +1,5 @@ +x:int = 0 +z:[int] = None + +for x in z: + print(x) diff --git a/src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed new file mode 100644 index 0000000..00acc08 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed.s.result new file mode 100644 index 0000000..ae52477 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_none.py.ast.typed.s.result @@ -0,0 +1,2 @@ +Operation on None +Exited with error code 4 diff --git a/src/test/data/pa3/sample/stmt_for_list_nonlocal.py b/src/test/data/pa3/sample/stmt_for_list_nonlocal.py new file mode 100644 index 0000000..e9b54a2 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed new file mode 100644 index 0000000..2c686f8 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed.s.result new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_nonlocal.py.ast.typed.s.result @@ -0,0 +1 @@ +7 diff --git a/src/test/data/pa3/sample/stmt_for_list_return.py b/src/test/data/pa3/sample/stmt_for_list_return.py new file mode 100644 index 0000000..35716dd --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed b/src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed new file mode 100644 index 0000000..4fca85f --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed.s.result new file mode 100644 index 0000000..300ed6f --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_list_return.py.ast.typed.s.result @@ -0,0 +1,3 @@ +10 +20 +30 diff --git a/src/test/data/pa3/sample/stmt_for_str.py b/src/test/data/pa3/sample/stmt_for_str.py new file mode 100644 index 0000000..c3ab74f --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str.py @@ -0,0 +1,5 @@ +x:str = "" +z:str = "abc" + +for x in z: + print(x) diff --git a/src/test/data/pa3/sample/stmt_for_str.py.ast.typed b/src/test/data/pa3/sample/stmt_for_str.py.ast.typed new file mode 100644 index 0000000..4b0e583 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_str.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/src/test/data/pa3/sample/stmt_for_str_empty.py b/src/test/data/pa3/sample/stmt_for_str_empty.py new file mode 100644 index 0000000..9dc60e7 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed b/src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed new file mode 100644 index 0000000..9be591f --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str_empty.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/src/test/data/pa3/sample/stmt_for_str_eval.py b/src/test/data/pa3/sample/stmt_for_str_eval.py new file mode 100644 index 0000000..69c2ea9 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed b/src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed new file mode 100644 index 0000000..1e64270 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str_eval.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/src/test/data/pa3/sample/stmt_for_str_nested.py b/src/test/data/pa3/sample/stmt_for_str_nested.py new file mode 100644 index 0000000..81f0f46 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed b/src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed new file mode 100644 index 0000000..5260c3b --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_str_nested.py.ast.typed.s.result new file mode 100644 index 0000000..c2cb64d --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_same_var.py b/src/test/data/pa3/sample/stmt_for_str_same_var.py new file mode 100644 index 0000000..438c74e --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str_same_var.py @@ -0,0 +1,4 @@ +x:str = "xXx" + +for x in x: + print(x) diff --git a/src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed b/src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed new file mode 100644 index 0000000..e3870ec --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed.s.result new file mode 100644 index 0000000..723425f --- /dev/null +++ b/src/test/data/pa3/sample/stmt_for_str_same_var.py.ast.typed.s.result @@ -0,0 +1,3 @@ +x +X +x diff --git a/src/test/data/pa3/sample/stmt_if.py b/src/test/data/pa3/sample/stmt_if.py new file mode 100644 index 0000000..61bc605 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_if.py @@ -0,0 +1,7 @@ +if False: + print("No") +elif True: + if True: + print("Yes") +else: + pass diff --git a/src/test/data/pa3/sample/stmt_if.py.ast.typed b/src/test/data/pa3/sample/stmt_if.py.ast.typed new file mode 100644 index 0000000..0b67124 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_if.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_if.py.ast.typed.s.result new file mode 100644 index 0000000..dcd7a5d --- /dev/null +++ b/src/test/data/pa3/sample/stmt_if.py.ast.typed.s.result @@ -0,0 +1 @@ +Yes diff --git a/src/test/data/pa3/sample/stmt_return_early.py b/src/test/data/pa3/sample/stmt_return_early.py new file mode 100644 index 0000000..267eab7 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_return_early.py @@ -0,0 +1,6 @@ +def f() -> int: + while True: + return 1 + return 0 + +print(f()) diff --git a/src/test/data/pa3/sample/stmt_return_early.py.ast.typed b/src/test/data/pa3/sample/stmt_return_early.py.ast.typed new file mode 100644 index 0000000..4568349 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_return_early.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_return_early.py.ast.typed.s.result new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/src/test/data/pa3/sample/stmt_return_early.py.ast.typed.s.result @@ -0,0 +1 @@ +1 diff --git a/src/test/data/pa3/sample/stmt_while.py b/src/test/data/pa3/sample/stmt_while.py new file mode 100644 index 0000000..acb4d7a --- /dev/null +++ b/src/test/data/pa3/sample/stmt_while.py @@ -0,0 +1,4 @@ +x:int = 1 +while x < 10: + print(x) + x = x + 1 diff --git a/src/test/data/pa3/sample/stmt_while.py.ast.typed b/src/test/data/pa3/sample/stmt_while.py.ast.typed new file mode 100644 index 0000000..3802a75 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/stmt_while.py.ast.typed.s.result b/src/test/data/pa3/sample/stmt_while.py.ast.typed.s.result new file mode 100644 index 0000000..0719398 --- /dev/null +++ b/src/test/data/pa3/sample/stmt_while.py.ast.typed.s.result @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/src/test/data/pa3/sample/str_cat.py b/src/test/data/pa3/sample/str_cat.py new file mode 100644 index 0000000..f28db5e --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cat.py.ast.typed b/src/test/data/pa3/sample/str_cat.py.ast.typed new file mode 100644 index 0000000..1db5a86 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cat.py.ast.typed.s.result b/src/test/data/pa3/sample/str_cat.py.ast.typed.s.result new file mode 100644 index 0000000..b2e262a --- /dev/null +++ b/src/test/data/pa3/sample/str_cat.py.ast.typed.s.result @@ -0,0 +1,6 @@ +HelloWorld +ChocoPy +Hello ChocoPy +5 +10 +0 diff --git a/src/test/data/pa3/sample/str_cat_2.py b/src/test/data/pa3/sample/str_cat_2.py new file mode 100644 index 0000000..f8367c0 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cat_2.py.ast.typed b/src/test/data/pa3/sample/str_cat_2.py.ast.typed new file mode 100644 index 0000000..543fa96 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cat_2.py.ast.typed.s.result b/src/test/data/pa3/sample/str_cat_2.py.ast.typed.s.result new file mode 100644 index 0000000..2f6ff88 --- /dev/null +++ b/src/test/data/pa3/sample/str_cat_2.py.ast.typed.s.result @@ -0,0 +1,3 @@ +ono +nono +noooo diff --git a/src/test/data/pa3/sample/str_cmp.py b/src/test/data/pa3/sample/str_cmp.py new file mode 100644 index 0000000..9258cd9 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cmp.py.ast.typed b/src/test/data/pa3/sample/str_cmp.py.ast.typed new file mode 100644 index 0000000..b185ac1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_cmp.py.ast.typed.s.result b/src/test/data/pa3/sample/str_cmp.py.ast.typed.s.result new file mode 100644 index 0000000..72232fd --- /dev/null +++ b/src/test/data/pa3/sample/str_cmp.py.ast.typed.s.result @@ -0,0 +1,6 @@ +True +False +True +False +False +True diff --git a/src/test/data/pa3/sample/str_get_element.py b/src/test/data/pa3/sample/str_get_element.py new file mode 100644 index 0000000..8681a05 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element.py.ast.typed b/src/test/data/pa3/sample/str_get_element.py.ast.typed new file mode 100644 index 0000000..ff9c449 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element.py.ast.typed.s.result b/src/test/data/pa3/sample/str_get_element.py.ast.typed.s.result new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/src/test/data/pa3/sample/str_get_element.py.ast.typed.s.result @@ -0,0 +1,3 @@ +a +b +c diff --git a/src/test/data/pa3/sample/str_get_element_oob_1.py b/src/test/data/pa3/sample/str_get_element_oob_1.py new file mode 100644 index 0000000..b6613d1 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed b/src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed new file mode 100644 index 0000000..4ce2733 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed.s.result b/src/test/data/pa3/sample/str_get_element_oob_1.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_2.py b/src/test/data/pa3/sample/str_get_element_oob_2.py new file mode 100644 index 0000000..4c4e0e0 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed b/src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed new file mode 100644 index 0000000..3a10e59 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed.s.result b/src/test/data/pa3/sample/str_get_element_oob_2.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_3.py b/src/test/data/pa3/sample/str_get_element_oob_3.py new file mode 100644 index 0000000..28e545a --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed b/src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed new file mode 100644 index 0000000..bac1f18 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed.s.result b/src/test/data/pa3/sample/str_get_element_oob_3.py.ast.typed.s.result new file mode 100644 index 0000000..144d019 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_len.py b/src/test/data/pa3/sample/str_len.py new file mode 100644 index 0000000..829f00b --- /dev/null +++ b/src/test/data/pa3/sample/str_len.py @@ -0,0 +1 @@ +print(len("ChocoPy")) diff --git a/src/test/data/pa3/sample/str_len.py.ast.typed b/src/test/data/pa3/sample/str_len.py.ast.typed new file mode 100644 index 0000000..d76359c --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/str_len.py.ast.typed.s.result b/src/test/data/pa3/sample/str_len.py.ast.typed.s.result new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/src/test/data/pa3/sample/str_len.py.ast.typed.s.result @@ -0,0 +1 @@ +7 diff --git a/src/test/data/pa3/sample/var_assign.py b/src/test/data/pa3/sample/var_assign.py new file mode 100644 index 0000000..c56b7ca --- /dev/null +++ b/src/test/data/pa3/sample/var_assign.py @@ -0,0 +1,4 @@ +x:int = 0 +y:object = 1 +x = y = 42 +print(x) diff --git a/src/test/data/pa3/sample/var_assign.py.ast.typed b/src/test/data/pa3/sample/var_assign.py.ast.typed new file mode 100644 index 0000000..83fb4c4 --- /dev/null +++ b/src/test/data/pa3/sample/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/src/test/data/pa3/sample/var_assign.py.ast.typed.s.result b/src/test/data/pa3/sample/var_assign.py.ast.typed.s.result new file mode 100644 index 0000000..d81cc07 --- /dev/null +++ b/src/test/data/pa3/sample/var_assign.py.ast.typed.s.result @@ -0,0 +1 @@ +42 diff --git a/web/WebCompiler.py b/web/WebCompiler.py new file mode 100644 index 0000000..b9c01fc --- /dev/null +++ b/web/WebCompiler.py @@ -0,0 +1,105 @@ +import http.server +import socketserver +import json +import sys, subprocess, os, platform + +classpath_separator = ';' if platform.system() == 'Windows' else ':' + +def read_file(fn): + with open(fn,'r') as f: + return f.read() + + +def write_file(fn, x): + with open(fn,'w') as f: + return f.write(x) + +def file_exists(fn): + return os.path.exists(fn) + +class WebCompiler(http.server.SimpleHTTPRequestHandler): + def do_POST(self): + if self.path == "/compile": + content_len = int(self.headers.get('Content-Length', 0)) + try: + request_json = self.rfile.read(content_len) + + # Process request + try: + request = json.loads(request_json) + code = request["input"] + passes = request["passes"] + code_file = ".tmp.py" + result_file = ".tmp.py.out" + + + except Exception as e: + self.send_response(400) + self.send_header("Content-type", "text/plain") + self.end_headers() + self.wfile.write(str(e).encode('utf-8')) + return + + # Verify that JARs exist + ref_jar = "../chocopy-ref.jar" + classpath = ref_jar + + if file_exists(ref_jar): + fat_jar = "../target/assignment.jar" + classpath = classpath + classpath_separator + fat_jar + else: + fat_jar = "../target/chocopy-ref.jar" + classpath = fat_jar + + if not file_exists(fat_jar): + raise Exception("Could not find file %s or %s" % (ref_jar, fat_jar)) + + + + # Compile + write_file(code_file, code) + + stat = subprocess.run(["java", "-cp", classpath, + "chocopy.ChocoPy", "--pass", passes, + code_file, "--json", "--out", result_file], capture_output=True) + + if stat.returncode not in [0, 2]: + raise Exception(stat.stderr.decode('utf-8')) + + result_json = read_file(result_file) + + # Clean up temps + os.remove(code_file) + os.remove(result_file) + + # Send response + self.send_response(200) + self.send_header("Content-type", "application/json") + self.end_headers() + self.wfile.write(str(result_json).encode('utf-8')) + + except Exception as e: + self.send_response(500) + self.send_header("Content-type", "text/plain") + self.end_headers() + self.wfile.write(str(e).encode('utf-8')) + return + + + else: + self.send_response(404) + self.end_headers() + return + + +if __name__ == '__main__': + PORT = int(sys.argv[1]) if len(sys.argv) > 1 else 8000 + + Handler = WebCompiler + + with socketserver.TCPServer(("", PORT), Handler) as httpd: + print("serving at port", PORT) + try: + httpd.serve_forever() + except KeyboardInterrupt: + pass diff --git a/web/css/ace.css b/web/css/ace.css new file mode 100644 index 0000000..e69de29 diff --git a/web/css/normalize.css b/web/css/normalize.css new file mode 100644 index 0000000..9b77e0e --- /dev/null +++ b/web/css/normalize.css @@ -0,0 +1,461 @@ +/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ + +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Correct the line height in all browsers. + * 3. Prevent adjustments of font size after orientation changes in + * IE on Windows Phone and in iOS. + */ + +/* Document + ========================================================================== */ + +html { + font-family: sans-serif; /* 1 */ + line-height: 1.15; /* 2 */ + -ms-text-size-adjust: 100%; /* 3 */ + -webkit-text-size-adjust: 100%; /* 3 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + +/** + * Add the correct display in IE 9-. + */ + +article, +aside, +footer, +header, +nav, +section { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in IE. + */ + +figcaption, +figure, +main { /* 1 */ + display: block; +} + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; /* 1 */ + -webkit-text-decoration-skip: objects; /* 2 */ +} + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ + +a:active, +a:hover { + outline-width: 0; +} + +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, +strong { + font-weight: inherit; +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +audio, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { + -webkit-appearance: button; /* 2 */ +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Remove the default vertical scrollbar in IE. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, /* 1 */ +menu { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Scripting + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + +/* Hidden + ========================================================================== */ + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} diff --git a/web/css/sakura.css b/web/css/sakura.css new file mode 100644 index 0000000..2c590ec --- /dev/null +++ b/web/css/sakura.css @@ -0,0 +1,165 @@ +/* Sakura.css v1.0.0 + * ================ + * Minimal css theme. + * Project: https://github.com/oxalorg/sakura + */ +/* Body */ +html { + font-size: 62.5%; + font-family: Georgia, serif; } + +body { + font-size: 1.9rem; + line-height: 1.618; + max-width: 48em; + margin: auto; + color: #4a4a4a; + background-color: #f9f9f9; + padding: 13px; } + +@media (max-width: 684px) { + body { + font-size: 1.53rem; } } + +@media (max-width: 382px) { + body { + font-size: 1.35rem; } } + +h1, h2, h3, h4, h5, h6 { + line-height: 1.1; + font-family: Helvetica, Verdana, Geneva, sans-serif; + font-weight: 700; + overflow-wrap: break-word; + word-wrap: break-word; + -ms-word-break: break-all; + word-break: break-word; + -ms-hyphens: auto; + -moz-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; } + +h1 { + font-size: 2.35em; } + +h2 { + font-size: 2.00em; } + +h3 { + font-size: 1.75em; } + +h4 { + font-size: 1.5em; } + +h5 { + font-size: 1.25em; } + +h6 { + font-size: 1em; } + +small, sub, sup { + font-size: 75%; } + +hr { + border-color: #2c8898; } + +a { + text-decoration: none; + color: #2c8898; } + a:hover { + color: #982c61; + border-bottom: 2px solid #4a4a4a; } + +ul { + padding-left: 1.4em; } + +li { + margin-bottom: 0.4em; } + +blockquote { + font-style: italic; + margin-left: 1.5em; + padding-left: 1em; + border-left: 3px solid #2c8898; } + +img { + max-width: 100%; } + +/* Pre and Code */ +pre { + background-color: #f1f1f1; + display: block; + padding: 1em; + overflow-x: auto; } + +code { + font-size: 0.9em; + padding: 0 0.5em; + background-color: #f1f1f1; + white-space: pre-wrap; } + +pre > code { + padding: 0; + background-color: transparent; + white-space: pre; } + +/* Tables */ +table { + text-align: justify; + width: 100%; + border-collapse: collapse; } + +td, th { + padding: 0.5em; + border-bottom: 1px solid #f1f1f1; } + +/* Buttons, forms and input */ +input, textarea { + border: 1px solid #4a4a4a; } + input:focus, textarea:focus { + border: 1px solid #2c8898; } + +textarea { + width: 100%; } + +.button, button, input[type="submit"], input[type="reset"], input[type="button"] { + display: inline-block; + padding: 5px 10px; + text-align: center; + text-decoration: none; + white-space: nowrap; + background-color: #2c8898; + color: #f9f9f9; + border-radius: 1px; + border: 1px solid #2c8898; + cursor: pointer; + box-sizing: border-box; } + .button[disabled], button[disabled], input[type="submit"][disabled], input[type="reset"][disabled], input[type="button"][disabled] { + cursor: default; + opacity: .5; } + .button:focus, .button:hover, button:focus, button:hover, input[type="submit"]:focus, input[type="submit"]:hover, input[type="reset"]:focus, input[type="reset"]:hover, input[type="button"]:focus, input[type="button"]:hover { + background-color: #982c61; + border-color: #982c61; + color: #f9f9f9; + outline: 0; } + +textarea, select, input[type] { + color: #4a4a4a; + padding: 6px 10px; + /* The 6px vertically centers text on FF, ignored by Webkit */ + margin-bottom: 10px; + background-color: #f1f1f1; + border: 1px solid #f1f1f1; + border-radius: 4px; + box-shadow: none; + box-sizing: border-box; } + textarea:focus, select:focus, input[type]:focus { + border: 1px solid #2c8898; + outline: 0; } + +input[type="checkbox"]:focus { + outline: 1px dotted #2c8898; } + +label, legend, fieldset { + display: block; + margin-bottom: .5rem; + font-weight: 600; } diff --git a/web/css/venus.css b/web/css/venus.css new file mode 100644 index 0000000..d5c99dc --- /dev/null +++ b/web/css/venus.css @@ -0,0 +1 @@ +/*! bulma.io v0.4.2 | MIT License | github.com/jgthms/bulma */@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}/*! minireset.css v0.0.2 | MIT License | github.com/jgthms/minireset.css */blockquote,body,dd,dl,dt,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,html,iframe,legend,li,ol,p,pre,textarea,ul{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{-webkit-box-sizing:border-box;box-sizing:border-box}*{-webkit-box-sizing:inherit;box-sizing:inherit}:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}audio,embed,img,object,video{max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0;text-align:left}html{background-color:#fff;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility}article,aside,figure,footer,header,hgroup,section{display:block}body,button,input,select,textarea{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif}code,pre{-moz-osx-font-smoothing:auto;-webkit-font-smoothing:auto;font-family:monospace}body{color:#4a4a4a;font-size:1rem;font-weight:400;line-height:1.5;overflow-x:hidden}a{color:#00d1b2;cursor:pointer;text-decoration:none;-webkit-transition:none 86ms ease-out;transition:none 86ms ease-out}a:hover{color:#363636}code{background-color:#f5f5f5;color:#ff3860;font-size:.8em;font-weight:400;padding:.25em .5em .25em}hr{background-color:#dbdbdb;border:none;display:block;height:1px;margin:1.5rem 0}img{max-width:100%}input[type=checkbox],input[type=radio]{vertical-align:baseline}small{font-size:.875em}span{font-style:inherit;font-weight:inherit}strong{color:#363636;font-weight:700}pre{background-color:#f5f5f5;color:#4a4a4a;font-size:.8em;white-space:pre;word-wrap:normal}pre code{-webkit-overflow-scrolling:touch;background:0 0;color:inherit;display:block;font-size:1em;overflow-x:auto;padding:1.25rem 1.5rem}table{width:100%}table td,table th{text-align:left;vertical-align:top}table th{color:#363636}.is-block{display:block}@media screen and (max-width:768px){.is-block-mobile{display:block!important}}@media screen and (min-width:769px),print{.is-block-tablet{display:block!important}}@media screen and (min-width:769px) and (max-width:999px){.is-block-tablet-only{display:block!important}}@media screen and (max-width:999px){.is-block-touch{display:block!important}}@media screen and (min-width:1000px){.is-block-desktop{display:block!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-block-desktop-only{display:block!important}}@media screen and (min-width:1192px){.is-block-widescreen{display:block!important}}.is-flex{display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width:768px){.is-flex-mobile{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (min-width:769px),print{.is-flex-tablet{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (min-width:769px) and (max-width:999px){.is-flex-tablet-only{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (max-width:999px){.is-flex-touch{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (min-width:1000px){.is-flex-desktop{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-flex-desktop-only{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}@media screen and (min-width:1192px){.is-flex-widescreen{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}}.is-inline{display:inline}@media screen and (max-width:768px){.is-inline-mobile{display:inline!important}}@media screen and (min-width:769px),print{.is-inline-tablet{display:inline!important}}@media screen and (min-width:769px) and (max-width:999px){.is-inline-tablet-only{display:inline!important}}@media screen and (max-width:999px){.is-inline-touch{display:inline!important}}@media screen and (min-width:1000px){.is-inline-desktop{display:inline!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-inline-desktop-only{display:inline!important}}@media screen and (min-width:1192px){.is-inline-widescreen{display:inline!important}}.is-inline-block{display:inline-block}@media screen and (max-width:768px){.is-inline-block-mobile{display:inline-block!important}}@media screen and (min-width:769px),print{.is-inline-block-tablet{display:inline-block!important}}@media screen and (min-width:769px) and (max-width:999px){.is-inline-block-tablet-only{display:inline-block!important}}@media screen and (max-width:999px){.is-inline-block-touch{display:inline-block!important}}@media screen and (min-width:1000px){.is-inline-block-desktop{display:inline-block!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-inline-block-desktop-only{display:inline-block!important}}@media screen and (min-width:1192px){.is-inline-block-widescreen{display:inline-block!important}}.is-inline-flex{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}@media screen and (max-width:768px){.is-inline-flex-mobile{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (min-width:769px),print{.is-inline-flex-tablet{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (min-width:769px) and (max-width:999px){.is-inline-flex-tablet-only{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (max-width:999px){.is-inline-flex-touch{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (min-width:1000px){.is-inline-flex-desktop{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-inline-flex-desktop-only{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media screen and (min-width:1192px){.is-inline-flex-widescreen{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.is-clearfix:after{clear:both;content:" ";display:table}.is-pulled-left{float:left}.is-pulled-right{float:right}.is-clipped{overflow:hidden!important}.is-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.has-text-centered{text-align:center}.has-text-left{text-align:left}.has-text-right{text-align:right}.has-text-white{color:#fff}a.has-text-white:focus,a.has-text-white:hover{color:#e6e6e6}.has-text-black{color:#0a0a0a}a.has-text-black:focus,a.has-text-black:hover{color:#000}.has-text-light{color:#f5f5f5}a.has-text-light:focus,a.has-text-light:hover{color:#dbdbdb}.has-text-dark{color:#363636}a.has-text-dark:focus,a.has-text-dark:hover{color:#1c1c1c}.has-text-primary{color:#00d1b2}a.has-text-primary:focus,a.has-text-primary:hover{color:#009e86}.has-text-info{color:#3273dc}a.has-text-info:focus,a.has-text-info:hover{color:#205bbc}.has-text-success{color:#23d160}a.has-text-success:focus,a.has-text-success:hover{color:#1ca64c}.has-text-warning{color:#ffdd57}a.has-text-warning:focus,a.has-text-warning:hover{color:#ffd324}.has-text-danger{color:#ff3860}a.has-text-danger:focus,a.has-text-danger:hover{color:#ff0537}.is-hidden{display:none!important}@media screen and (max-width:768px){.is-hidden-mobile{display:none!important}}@media screen and (min-width:769px),print{.is-hidden-tablet{display:none!important}}@media screen and (min-width:769px) and (max-width:999px){.is-hidden-tablet-only{display:none!important}}@media screen and (max-width:999px){.is-hidden-touch{display:none!important}}@media screen and (min-width:1000px){.is-hidden-desktop{display:none!important}}@media screen and (min-width:1000px) and (max-width:1191px){.is-hidden-desktop-only{display:none!important}}@media screen and (min-width:1192px){.is-hidden-widescreen{display:none!important}}.is-marginless{margin:0!important}.is-paddingless{padding:0!important}.is-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.box{background-color:#fff;border-radius:5px;-webkit-box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);display:block;padding:1.25rem}.box:not(:last-child){margin-bottom:1.5rem}a.box:focus,a.box:hover{-webkit-box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px #00d1b2;box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px #00d1b2}a.box:active{-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2),0 0 0 1px #00d1b2;box-shadow:inset 0 1px 2px rgba(10,10,10,.2),0 0 0 1px #00d1b2}.button{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.25em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.375em - 1px);padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);padding-top:calc(.375em - 1px);position:relative;vertical-align:top;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;border-color:#dbdbdb;color:#363636;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:.75em;padding-right:.75em;text-align:center;white-space:nowrap}.button.is-active,.button.is-focused,.button:active,.button:focus{outline:0}.button[disabled]{cursor:not-allowed}.button strong{color:inherit}.button .icon,.button .icon.is-large,.button .icon.is-medium,.button .icon.is-small{height:1.5em;width:1.5em}.button .icon:first-child:not(:last-child){margin-left:calc(-.375em - 1px);margin-right:.1875em}.button .icon:last-child:not(:first-child){margin-left:.1875em;margin-right:calc(-.375em - 1px)}.button .icon:first-child:last-child{margin-left:calc(-.375em - 1px);margin-right:calc(-.375em - 1px)}.button.is-hovered,.button:hover{border-color:#b5b5b5;color:#363636}.button.is-focused,.button:focus{border-color:#00d1b2;-webkit-box-shadow:0 0 .5em rgba(0,209,178,.25);box-shadow:0 0 .5em rgba(0,209,178,.25);color:#363636}.button.is-active,.button:active{border-color:#4a4a4a;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#363636}.button.is-link{background-color:transparent;border-color:transparent;color:#4a4a4a;text-decoration:underline}.button.is-link.is-active,.button.is-link.is-focused,.button.is-link.is-hovered,.button.is-link:active,.button.is-link:focus,.button.is-link:hover{background-color:#f5f5f5;color:#363636}.button.is-link[disabled]{background-color:transparent;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-white{background-color:#fff;border-color:transparent;color:#0a0a0a}.button.is-white.is-hovered,.button.is-white:hover{background-color:#f9f9f9;border-color:transparent;color:#0a0a0a}.button.is-white.is-focused,.button.is-white:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(255,255,255,.25);box-shadow:0 0 .5em rgba(255,255,255,.25);color:#0a0a0a}.button.is-white.is-active,.button.is-white:active{background-color:#f2f2f2;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#0a0a0a}.button.is-white[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-white.is-inverted{background-color:#0a0a0a;color:#fff}.button.is-white.is-inverted:hover{background-color:#000}.button.is-white.is-inverted[disabled]{background-color:#0a0a0a;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-white.is-loading:after{border-color:transparent transparent #0a0a0a #0a0a0a!important}.button.is-white.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-white.is-outlined:focus,.button.is-white.is-outlined:hover{background-color:#fff;border-color:#fff;color:#0a0a0a}.button.is-white.is-outlined.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-white.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-white.is-inverted.is-outlined{background-color:transparent;border-color:#0a0a0a;color:#0a0a0a}.button.is-white.is-inverted.is-outlined:focus,.button.is-white.is-inverted.is-outlined:hover{background-color:#0a0a0a;color:#fff}.button.is-white.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#0a0a0a;-webkit-box-shadow:none;box-shadow:none;color:#0a0a0a}.button.is-black{background-color:#0a0a0a;border-color:transparent;color:#fff}.button.is-black.is-hovered,.button.is-black:hover{background-color:#040404;border-color:transparent;color:#fff}.button.is-black.is-focused,.button.is-black:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(10,10,10,.25);box-shadow:0 0 .5em rgba(10,10,10,.25);color:#fff}.button.is-black.is-active,.button.is-black:active{background-color:#000;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#fff}.button.is-black[disabled]{background-color:#0a0a0a;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-black.is-inverted{background-color:#fff;color:#0a0a0a}.button.is-black.is-inverted:hover{background-color:#f2f2f2}.button.is-black.is-inverted[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#0a0a0a}.button.is-black.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-black.is-outlined{background-color:transparent;border-color:#0a0a0a;color:#0a0a0a}.button.is-black.is-outlined:focus,.button.is-black.is-outlined:hover{background-color:#0a0a0a;border-color:#0a0a0a;color:#fff}.button.is-black.is-outlined.is-loading:after{border-color:transparent transparent #0a0a0a #0a0a0a!important}.button.is-black.is-outlined[disabled]{background-color:transparent;border-color:#0a0a0a;-webkit-box-shadow:none;box-shadow:none;color:#0a0a0a}.button.is-black.is-inverted.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-black.is-inverted.is-outlined:focus,.button.is-black.is-inverted.is-outlined:hover{background-color:#fff;color:#0a0a0a}.button.is-black.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-light{background-color:#f5f5f5;border-color:transparent;color:#363636}.button.is-light.is-hovered,.button.is-light:hover{background-color:#eee;border-color:transparent;color:#363636}.button.is-light.is-focused,.button.is-light:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(245,245,245,.25);box-shadow:0 0 .5em rgba(245,245,245,.25);color:#363636}.button.is-light.is-active,.button.is-light:active{background-color:#e8e8e8;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#363636}.button.is-light[disabled]{background-color:#f5f5f5;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-light.is-inverted{background-color:#363636;color:#f5f5f5}.button.is-light.is-inverted:hover{background-color:#292929}.button.is-light.is-inverted[disabled]{background-color:#363636;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#f5f5f5}.button.is-light.is-loading:after{border-color:transparent transparent #363636 #363636!important}.button.is-light.is-outlined{background-color:transparent;border-color:#f5f5f5;color:#f5f5f5}.button.is-light.is-outlined:focus,.button.is-light.is-outlined:hover{background-color:#f5f5f5;border-color:#f5f5f5;color:#363636}.button.is-light.is-outlined.is-loading:after{border-color:transparent transparent #f5f5f5 #f5f5f5!important}.button.is-light.is-outlined[disabled]{background-color:transparent;border-color:#f5f5f5;-webkit-box-shadow:none;box-shadow:none;color:#f5f5f5}.button.is-light.is-inverted.is-outlined{background-color:transparent;border-color:#363636;color:#363636}.button.is-light.is-inverted.is-outlined:focus,.button.is-light.is-inverted.is-outlined:hover{background-color:#363636;color:#f5f5f5}.button.is-light.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#363636;-webkit-box-shadow:none;box-shadow:none;color:#363636}.button.is-dark{background-color:#363636;border-color:transparent;color:#f5f5f5}.button.is-dark.is-hovered,.button.is-dark:hover{background-color:#2f2f2f;border-color:transparent;color:#f5f5f5}.button.is-dark.is-focused,.button.is-dark:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(54,54,54,.25);box-shadow:0 0 .5em rgba(54,54,54,.25);color:#f5f5f5}.button.is-dark.is-active,.button.is-dark:active{background-color:#292929;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#f5f5f5}.button.is-dark[disabled]{background-color:#363636;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-dark.is-inverted{background-color:#f5f5f5;color:#363636}.button.is-dark.is-inverted:hover{background-color:#e8e8e8}.button.is-dark.is-inverted[disabled]{background-color:#f5f5f5;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#363636}.button.is-dark.is-loading:after{border-color:transparent transparent #f5f5f5 #f5f5f5!important}.button.is-dark.is-outlined{background-color:transparent;border-color:#363636;color:#363636}.button.is-dark.is-outlined:focus,.button.is-dark.is-outlined:hover{background-color:#363636;border-color:#363636;color:#f5f5f5}.button.is-dark.is-outlined.is-loading:after{border-color:transparent transparent #363636 #363636!important}.button.is-dark.is-outlined[disabled]{background-color:transparent;border-color:#363636;-webkit-box-shadow:none;box-shadow:none;color:#363636}.button.is-dark.is-inverted.is-outlined{background-color:transparent;border-color:#f5f5f5;color:#f5f5f5}.button.is-dark.is-inverted.is-outlined:focus,.button.is-dark.is-inverted.is-outlined:hover{background-color:#f5f5f5;color:#363636}.button.is-dark.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#f5f5f5;-webkit-box-shadow:none;box-shadow:none;color:#f5f5f5}.button.is-primary{background-color:#00d1b2;border-color:transparent;color:#fff}.button.is-primary.is-hovered,.button.is-primary:hover{background-color:#00c4a7;border-color:transparent;color:#fff}.button.is-primary.is-focused,.button.is-primary:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(0,209,178,.25);box-shadow:0 0 .5em rgba(0,209,178,.25);color:#fff}.button.is-primary.is-active,.button.is-primary:active{background-color:#00b89c;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#fff}.button.is-primary[disabled]{background-color:#00d1b2;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-primary.is-inverted{background-color:#fff;color:#00d1b2}.button.is-primary.is-inverted:hover{background-color:#f2f2f2}.button.is-primary.is-inverted[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#00d1b2}.button.is-primary.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-primary.is-outlined{background-color:transparent;border-color:#00d1b2;color:#00d1b2}.button.is-primary.is-outlined:focus,.button.is-primary.is-outlined:hover{background-color:#00d1b2;border-color:#00d1b2;color:#fff}.button.is-primary.is-outlined.is-loading:after{border-color:transparent transparent #00d1b2 #00d1b2!important}.button.is-primary.is-outlined[disabled]{background-color:transparent;border-color:#00d1b2;-webkit-box-shadow:none;box-shadow:none;color:#00d1b2}.button.is-primary.is-inverted.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-primary.is-inverted.is-outlined:focus,.button.is-primary.is-inverted.is-outlined:hover{background-color:#fff;color:#00d1b2}.button.is-primary.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-info{background-color:#3273dc;border-color:transparent;color:#fff}.button.is-info.is-hovered,.button.is-info:hover{background-color:#276cda;border-color:transparent;color:#fff}.button.is-info.is-focused,.button.is-info:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(50,115,220,.25);box-shadow:0 0 .5em rgba(50,115,220,.25);color:#fff}.button.is-info.is-active,.button.is-info:active{background-color:#2366d1;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#fff}.button.is-info[disabled]{background-color:#3273dc;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-info.is-inverted{background-color:#fff;color:#3273dc}.button.is-info.is-inverted:hover{background-color:#f2f2f2}.button.is-info.is-inverted[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#3273dc}.button.is-info.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-info.is-outlined{background-color:transparent;border-color:#3273dc;color:#3273dc}.button.is-info.is-outlined:focus,.button.is-info.is-outlined:hover{background-color:#3273dc;border-color:#3273dc;color:#fff}.button.is-info.is-outlined.is-loading:after{border-color:transparent transparent #3273dc #3273dc!important}.button.is-info.is-outlined[disabled]{background-color:transparent;border-color:#3273dc;-webkit-box-shadow:none;box-shadow:none;color:#3273dc}.button.is-info.is-inverted.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-info.is-inverted.is-outlined:focus,.button.is-info.is-inverted.is-outlined:hover{background-color:#fff;color:#3273dc}.button.is-info.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-success{background-color:#23d160;border-color:transparent;color:#fff}.button.is-success.is-hovered,.button.is-success:hover{background-color:#22c65b;border-color:transparent;color:#fff}.button.is-success.is-focused,.button.is-success:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(35,209,96,.25);box-shadow:0 0 .5em rgba(35,209,96,.25);color:#fff}.button.is-success.is-active,.button.is-success:active{background-color:#20bc56;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#fff}.button.is-success[disabled]{background-color:#23d160;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-success.is-inverted{background-color:#fff;color:#23d160}.button.is-success.is-inverted:hover{background-color:#f2f2f2}.button.is-success.is-inverted[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#23d160}.button.is-success.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-success.is-outlined{background-color:transparent;border-color:#23d160;color:#23d160}.button.is-success.is-outlined:focus,.button.is-success.is-outlined:hover{background-color:#23d160;border-color:#23d160;color:#fff}.button.is-success.is-outlined.is-loading:after{border-color:transparent transparent #23d160 #23d160!important}.button.is-success.is-outlined[disabled]{background-color:transparent;border-color:#23d160;-webkit-box-shadow:none;box-shadow:none;color:#23d160}.button.is-success.is-inverted.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-success.is-inverted.is-outlined:focus,.button.is-success.is-inverted.is-outlined:hover{background-color:#fff;color:#23d160}.button.is-success.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-warning{background-color:#ffdd57;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-warning.is-hovered,.button.is-warning:hover{background-color:#ffdb4a;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-warning.is-focused,.button.is-warning:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(255,221,87,.25);box-shadow:0 0 .5em rgba(255,221,87,.25);color:rgba(0,0,0,.7)}.button.is-warning.is-active,.button.is-warning:active{background-color:#ffd83d;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:rgba(0,0,0,.7)}.button.is-warning[disabled]{background-color:#ffdd57;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-warning.is-inverted{background-color:rgba(0,0,0,.7);color:#ffdd57}.button.is-warning.is-inverted:hover{background-color:rgba(0,0,0,.7)}.button.is-warning.is-inverted[disabled]{background-color:rgba(0,0,0,.7);border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#ffdd57}.button.is-warning.is-loading:after{border-color:transparent transparent rgba(0,0,0,.7) rgba(0,0,0,.7)!important}.button.is-warning.is-outlined{background-color:transparent;border-color:#ffdd57;color:#ffdd57}.button.is-warning.is-outlined:focus,.button.is-warning.is-outlined:hover{background-color:#ffdd57;border-color:#ffdd57;color:rgba(0,0,0,.7)}.button.is-warning.is-outlined.is-loading:after{border-color:transparent transparent #ffdd57 #ffdd57!important}.button.is-warning.is-outlined[disabled]{background-color:transparent;border-color:#ffdd57;-webkit-box-shadow:none;box-shadow:none;color:#ffdd57}.button.is-warning.is-inverted.is-outlined{background-color:transparent;border-color:rgba(0,0,0,.7);color:rgba(0,0,0,.7)}.button.is-warning.is-inverted.is-outlined:focus,.button.is-warning.is-inverted.is-outlined:hover{background-color:rgba(0,0,0,.7);color:#ffdd57}.button.is-warning.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:rgba(0,0,0,.7);-webkit-box-shadow:none;box-shadow:none;color:rgba(0,0,0,.7)}.button.is-danger{background-color:#ff3860;border-color:transparent;color:#fff}.button.is-danger.is-hovered,.button.is-danger:hover{background-color:#ff2b56;border-color:transparent;color:#fff}.button.is-danger.is-focused,.button.is-danger:focus{border-color:transparent;-webkit-box-shadow:0 0 .5em rgba(255,56,96,.25);box-shadow:0 0 .5em rgba(255,56,96,.25);color:#fff}.button.is-danger.is-active,.button.is-danger:active{background-color:#ff1f4b;border-color:transparent;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2);color:#fff}.button.is-danger[disabled]{background-color:#ff3860;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.button.is-danger.is-inverted{background-color:#fff;color:#ff3860}.button.is-danger.is-inverted:hover{background-color:#f2f2f2}.button.is-danger.is-inverted[disabled]{background-color:#fff;border-color:transparent;-webkit-box-shadow:none;box-shadow:none;color:#ff3860}.button.is-danger.is-loading:after{border-color:transparent transparent #fff #fff!important}.button.is-danger.is-outlined{background-color:transparent;border-color:#ff3860;color:#ff3860}.button.is-danger.is-outlined:focus,.button.is-danger.is-outlined:hover{background-color:#ff3860;border-color:#ff3860;color:#fff}.button.is-danger.is-outlined.is-loading:after{border-color:transparent transparent #ff3860 #ff3860!important}.button.is-danger.is-outlined[disabled]{background-color:transparent;border-color:#ff3860;-webkit-box-shadow:none;box-shadow:none;color:#ff3860}.button.is-danger.is-inverted.is-outlined{background-color:transparent;border-color:#fff;color:#fff}.button.is-danger.is-inverted.is-outlined:focus,.button.is-danger.is-inverted.is-outlined:hover{background-color:#fff;color:#ff3860}.button.is-danger.is-inverted.is-outlined[disabled]{background-color:transparent;border-color:#fff;-webkit-box-shadow:none;box-shadow:none;color:#fff}.button.is-small{border-radius:2px;font-size:.75rem}.button.is-medium{font-size:1.25rem}.button.is-large{font-size:1.5rem}.button[disabled]{background-color:#fff;border-color:#dbdbdb;-webkit-box-shadow:none;box-shadow:none;opacity:.5}.button.is-fullwidth{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.button.is-loading{color:transparent!important;pointer-events:none}.button.is-loading:after{-webkit-animation:spinAround .5s infinite linear;animation:spinAround .5s infinite linear;border:2px solid #dbdbdb;border-radius:290486px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;position:relative;width:1em;position:absolute;left:calc(50% - (1em / 2));top:calc(50% - (1em / 2));position:absolute!important}.button.is-static{background-color:#f5f5f5;border-color:#dbdbdb;color:#7a7a7a;-webkit-box-shadow:none;box-shadow:none;pointer-events:none}button.button,input[type=submit].button{line-height:1;padding-bottom:.4em;padding-top:.35em}.content{color:#4a4a4a}.content:not(:last-child){margin-bottom:1.5rem}.content li+li{margin-top:.25em}.content blockquote:not(:last-child),.content dl:not(:last-child),.content ol:not(:last-child),.content p:not(:last-child),.content pre:not(:last-child),.content table:not(:last-child),.content ul:not(:last-child){margin-bottom:1em}.content h1,.content h2,.content h3,.content h4,.content h5,.content h6{color:#363636;font-weight:400;line-height:1.125}.content h1{font-size:2em;margin-bottom:.5em}.content h1:not(:first-child){margin-top:1em}.content h2{font-size:1.75em;margin-bottom:.5714em}.content h2:not(:first-child){margin-top:1.1428em}.content h3{font-size:1.5em;margin-bottom:.6666em}.content h3:not(:first-child){margin-top:1.3333em}.content h4{font-size:1.25em;margin-bottom:.8em}.content h5{font-size:1.125em;margin-bottom:.8888em}.content h6{font-size:1em;margin-bottom:1em}.content blockquote{background-color:#f5f5f5;border-left:5px solid #dbdbdb;padding:1.25em 1.5em}.content ol{list-style:decimal outside;margin-left:2em;margin-top:1em}.content ul{list-style:disc outside;margin-left:2em;margin-top:1em}.content ul ul{list-style-type:circle;margin-top:.5em}.content ul ul ul{list-style-type:square}.content dd{margin-left:2em}.content figure{text-align:center}.content figure img{display:inline-block}.content figure figcaption{font-style:italic}.content pre{-webkit-overflow-scrolling:touch;overflow-x:auto;padding:1.25em 1.5em;white-space:pre;word-wrap:normal}.content sub,.content sup{font-size:70%}.content table{width:100%}.content table td,.content table th{border:1px solid #dbdbdb;border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.content table th{color:#363636;text-align:left}.content table tr:hover{background-color:#f5f5f5}.content table thead td,.content table thead th{border-width:0 0 2px;color:#363636}.content table tfoot td,.content table tfoot th{border-width:2px 0 0;color:#363636}.content table tbody tr:last-child td,.content table tbody tr:last-child th{border-bottom-width:0}.content.is-small{font-size:.75rem}.content.is-medium{font-size:1.25rem}.content.is-large{font-size:1.5rem}.input,.textarea{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.25em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.375em - 1px);padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);padding-top:calc(.375em - 1px);position:relative;vertical-align:top;background-color:#fff;border-color:#dbdbdb;color:#363636;-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.1);box-shadow:inset 0 1px 2px rgba(10,10,10,.1);max-width:100%;width:100%}.input.is-active,.input.is-focused,.input:active,.input:focus,.textarea.is-active,.textarea.is-focused,.textarea:active,.textarea:focus{outline:0}.input[disabled],.textarea[disabled]{cursor:not-allowed}.input.is-hovered,.input:hover,.textarea.is-hovered,.textarea:hover{border-color:#b5b5b5}.input.is-active,.input.is-focused,.input:active,.input:focus,.textarea.is-active,.textarea.is-focused,.textarea:active,.textarea:focus{border-color:#00d1b2}.input[disabled],.textarea[disabled]{background-color:#f5f5f5;border-color:#f5f5f5;-webkit-box-shadow:none;box-shadow:none;color:#7a7a7a}.input[disabled]::-moz-placeholder,.textarea[disabled]::-moz-placeholder{color:rgba(54,54,54,.3)}.input[disabled]::-webkit-input-placeholder,.textarea[disabled]::-webkit-input-placeholder{color:rgba(54,54,54,.3)}.input[disabled]:-moz-placeholder,.textarea[disabled]:-moz-placeholder{color:rgba(54,54,54,.3)}.input[disabled]:-ms-input-placeholder,.textarea[disabled]:-ms-input-placeholder{color:rgba(54,54,54,.3)}.input[type=search],.textarea[type=search]{border-radius:290486px}.input.is-white,.textarea.is-white{border-color:#fff}.input.is-black,.textarea.is-black{border-color:#0a0a0a}.input.is-light,.textarea.is-light{border-color:#f5f5f5}.input.is-dark,.textarea.is-dark{border-color:#363636}.input.is-primary,.textarea.is-primary{border-color:#00d1b2}.input.is-info,.textarea.is-info{border-color:#3273dc}.input.is-success,.textarea.is-success{border-color:#23d160}.input.is-warning,.textarea.is-warning{border-color:#ffdd57}.input.is-danger,.textarea.is-danger{border-color:#ff3860}.input.is-small,.textarea.is-small{border-radius:2px;font-size:.75rem}.input.is-medium,.textarea.is-medium{font-size:1.25rem}.input.is-large,.textarea.is-large{font-size:1.5rem}.input.is-fullwidth,.textarea.is-fullwidth{display:block;width:100%}.input.is-inline,.textarea.is-inline{display:inline;width:auto}.textarea{display:block;max-height:600px;max-width:100%;min-height:120px;min-width:100%;padding:.625em;resize:vertical}.checkbox,.radio{cursor:pointer;display:inline-block;line-height:1.25;position:relative}.checkbox input,.radio input{cursor:pointer}.checkbox:hover,.radio:hover{color:#363636}.checkbox[disabled],.radio[disabled]{color:#7a7a7a;cursor:not-allowed}.radio+.radio{margin-left:.5em}.select{display:inline-block;height:2.25em;max-width:100%;position:relative;vertical-align:top}.select:after{border:1px solid #00d1b2;border-right:0;border-top:0;content:" ";display:block;height:.5em;pointer-events:none;position:absolute;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);width:.5em;margin-top:-.375em;right:1.125em;top:50%;z-index:4}.select select{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.25em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.375em - 1px);padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);padding-top:calc(.375em - 1px);position:relative;vertical-align:top;background-color:#fff;border-color:#dbdbdb;color:#363636;cursor:pointer;display:block;font-size:1em;max-width:100%;outline:0;padding-right:2.5em}.select select.is-active,.select select.is-focused,.select select:active,.select select:focus{outline:0}.select select[disabled]{cursor:not-allowed}.select select.is-hovered,.select select:hover{border-color:#b5b5b5}.select select.is-active,.select select.is-focused,.select select:active,.select select:focus{border-color:#00d1b2}.select select[disabled]{background-color:#f5f5f5;border-color:#f5f5f5;-webkit-box-shadow:none;box-shadow:none;color:#7a7a7a}.select select[disabled]::-moz-placeholder{color:rgba(54,54,54,.3)}.select select[disabled]::-webkit-input-placeholder{color:rgba(54,54,54,.3)}.select select[disabled]:-moz-placeholder{color:rgba(54,54,54,.3)}.select select[disabled]:-ms-input-placeholder{color:rgba(54,54,54,.3)}.select select:hover{border-color:#b5b5b5}.select select::-ms-expand{display:none}.select select[disabled]:hover{border-color:#f5f5f5}.select:hover:after{border-color:#363636}.select.is-white select{border-color:#fff}.select.is-black select{border-color:#0a0a0a}.select.is-light select{border-color:#f5f5f5}.select.is-dark select{border-color:#363636}.select.is-primary select{border-color:#00d1b2}.select.is-info select{border-color:#3273dc}.select.is-success select{border-color:#23d160}.select.is-warning select{border-color:#ffdd57}.select.is-danger select{border-color:#ff3860}.select.is-small{border-radius:2px;font-size:.75rem}.select.is-medium{font-size:1.25rem}.select.is-large{font-size:1.5rem}.select.is-disabled:after{border-color:#7a7a7a}.select.is-fullwidth{width:100%}.select.is-fullwidth select{width:100%}.select.is-loading:after{-webkit-animation:spinAround .5s infinite linear;animation:spinAround .5s infinite linear;border:2px solid #dbdbdb;border-radius:290486px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;position:relative;width:1em;margin-top:0;position:absolute;right:.625em;top:.625em;-webkit-transform:none;transform:none}.select.is-loading.is-small:after{font-size:.75rem}.select.is-loading.is-medium:after{font-size:1.25rem}.select.is-loading.is-large:after{font-size:1.5rem}.label{color:#363636;display:block;font-size:1rem;font-weight:700}.label:not(:last-child){margin-bottom:.5em}.label.is-small{font-size:.75rem}.label.is-medium{font-size:1.25rem}.label.is-large{font-size:1.5rem}.help{display:block;font-size:.75rem;margin-top:.25rem}.help.is-white{color:#fff}.help.is-black{color:#0a0a0a}.help.is-light{color:#f5f5f5}.help.is-dark{color:#363636}.help.is-primary{color:#00d1b2}.help.is-info{color:#3273dc}.help.is-success{color:#23d160}.help.is-warning{color:#ffdd57}.help.is-danger{color:#ff3860}.field:not(:last-child){margin-bottom:.75rem}.field.has-addons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.field.has-addons .control{margin-right:-1px}.field.has-addons .control:first-child .button,.field.has-addons .control:first-child .input,.field.has-addons .control:first-child .select select{border-bottom-left-radius:3px;border-top-left-radius:3px}.field.has-addons .control:last-child .button,.field.has-addons .control:last-child .input,.field.has-addons .control:last-child .select select{border-bottom-right-radius:3px;border-top-right-radius:3px}.field.has-addons .control .button,.field.has-addons .control .input,.field.has-addons .control .select select{border-radius:0}.field.has-addons .control .button.is-hovered,.field.has-addons .control .button:hover,.field.has-addons .control .input.is-hovered,.field.has-addons .control .input:hover,.field.has-addons .control .select select.is-hovered,.field.has-addons .control .select select:hover{z-index:2}.field.has-addons .control .button.is-active,.field.has-addons .control .button.is-focused,.field.has-addons .control .button:active,.field.has-addons .control .button:focus,.field.has-addons .control .input.is-active,.field.has-addons .control .input.is-focused,.field.has-addons .control .input:active,.field.has-addons .control .input:focus,.field.has-addons .control .select select.is-active,.field.has-addons .control .select select.is-focused,.field.has-addons .control .select select:active,.field.has-addons .control .select select:focus{z-index:3}.field.has-addons .control .button.is-active:hover,.field.has-addons .control .button.is-focused:hover,.field.has-addons .control .button:active:hover,.field.has-addons .control .button:focus:hover,.field.has-addons .control .input.is-active:hover,.field.has-addons .control .input.is-focused:hover,.field.has-addons .control .input:active:hover,.field.has-addons .control .input:focus:hover,.field.has-addons .control .select select.is-active:hover,.field.has-addons .control .select select.is-focused:hover,.field.has-addons .control .select select:active:hover,.field.has-addons .control .select select:focus:hover{z-index:4}.field.has-addons .control.is-expanded{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.field.has-addons.has-addons-centered{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.field.has-addons.has-addons-right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.field.has-addons.has-addons-fullwidth .control{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.field.is-grouped{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.field.is-grouped>.control{-ms-flex-negative:0;flex-shrink:0}.field.is-grouped>.control:not(:last-child){margin-bottom:0;margin-right:.75rem}.field.is-grouped>.control.is-expanded{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.field.is-grouped.is-grouped-centered{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.field.is-grouped.is-grouped-right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}@media screen and (min-width:769px),print{.field.is-horizontal{display:-webkit-box;display:-ms-flexbox;display:flex}}.field-label .label{font-size:inherit}@media screen and (max-width:768px){.field-label{margin-bottom:.5rem}}@media screen and (min-width:769px),print{.field-label{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;margin-right:1.5rem;text-align:right}.field-label.is-small{font-size:.75rem;padding-top:.375em}.field-label.is-normal{padding-top:.375em}.field-label.is-medium{font-size:1.25rem;padding-top:.375em}.field-label.is-large{font-size:1.5rem;padding-top:.375em}}@media screen and (min-width:769px),print{.field-body{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:5;-ms-flex-positive:5;flex-grow:5;-ms-flex-negative:1;flex-shrink:1}.field-body .field{-ms-flex-negative:1;flex-shrink:1}.field-body .field:not(.is-narrow){-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.field-body .field:not(:last-child){margin-bottom:0;margin-right:.75rem}}.control{font-size:1rem;position:relative;text-align:left}.control.has-icon .icon{color:#dbdbdb;height:2.25em;pointer-events:none;position:absolute;top:0;width:2.25em;z-index:4}.control.has-icon .input:focus+.icon{color:#7a7a7a}.control.has-icon .input.is-small+.icon{font-size:.75rem}.control.has-icon .input.is-medium+.icon{font-size:1.25rem}.control.has-icon .input.is-large+.icon{font-size:1.5rem}.control.has-icon:not(.has-icon-right) .icon{left:0}.control.has-icon:not(.has-icon-right) .input{padding-left:2.25em}.control.has-icon.has-icon-right .icon{right:0}.control.has-icon.has-icon-right .input{padding-right:2.25em}.control.has-icons-left .input:focus~.icon,.control.has-icons-left .select select:focus~.icon,.control.has-icons-right .input:focus~.icon,.control.has-icons-right .select select:focus~.icon{color:#7a7a7a}.control.has-icons-left .input.is-small~.icon,.control.has-icons-left .select select.is-small~.icon,.control.has-icons-right .input.is-small~.icon,.control.has-icons-right .select select.is-small~.icon{font-size:.75rem}.control.has-icons-left .input.is-medium~.icon,.control.has-icons-left .select select.is-medium~.icon,.control.has-icons-right .input.is-medium~.icon,.control.has-icons-right .select select.is-medium~.icon{font-size:1.25rem}.control.has-icons-left .input.is-large~.icon,.control.has-icons-left .select select.is-large~.icon,.control.has-icons-right .input.is-large~.icon,.control.has-icons-right .select select.is-large~.icon{font-size:1.5rem}.control.has-icons-left .icon,.control.has-icons-right .icon{color:#dbdbdb;height:2.25em;pointer-events:none;position:absolute;top:0;width:2.25em;z-index:4}.control.has-icons-left .input,.control.has-icons-left .select select{padding-left:2.25em}.control.has-icons-left .icon.is-left{left:0}.control.has-icons-right .input,.control.has-icons-right .select select{padding-right:2.25em}.control.has-icons-right .icon.is-right{right:0}.control.is-loading:after{-webkit-animation:spinAround .5s infinite linear;animation:spinAround .5s infinite linear;border:2px solid #dbdbdb;border-radius:290486px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;position:relative;width:1em;position:absolute!important;right:.625em;top:.625em}.control.is-loading.is-small:after{font-size:.75rem}.control.is-loading.is-medium:after{font-size:1.25rem}.control.is-loading.is-large:after{font-size:1.5rem}.icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:1.5rem;width:1.5rem}.icon .fa{font-size:21px}.icon.is-small{height:1rem;width:1rem}.icon.is-small .fa{font-size:14px}.icon.is-medium{height:2rem;width:2rem}.icon.is-medium .fa{font-size:28px}.icon.is-large{height:3rem;width:3rem}.icon.is-large .fa{font-size:42px}.image{display:block;position:relative}.image img{display:block;height:auto;width:100%}.image.is-16by9 img,.image.is-1by1 img,.image.is-2by1 img,.image.is-3by2 img,.image.is-4by3 img,.image.is-square img{bottom:0;left:0;position:absolute;right:0;top:0;height:100%;width:100%}.image.is-1by1,.image.is-square{padding-top:100%}.image.is-4by3{padding-top:75%}.image.is-3by2{padding-top:66.6666%}.image.is-16by9{padding-top:56.25%}.image.is-2by1{padding-top:50%}.image.is-16x16{height:16px;width:16px}.image.is-24x24{height:24px;width:24px}.image.is-32x32{height:32px;width:32px}.image.is-48x48{height:48px;width:48px}.image.is-64x64{height:64px;width:64px}.image.is-96x96{height:96px;width:96px}.image.is-128x128{height:128px;width:128px}.notification{background-color:#f5f5f5;border-radius:3px;padding:1.25rem 2.5rem 1.25rem 1.5rem;position:relative}.notification:not(:last-child){margin-bottom:1.5rem}.notification a:not(.button){color:currentColor;text-decoration:underline}.notification code,.notification pre{background:#fff}.notification pre code{background:0 0}.notification>.delete{position:absolute;right:.5em;top:.5em}.notification .content,.notification .subtitle,.notification .title{color:inherit}.notification.is-white{background-color:#fff;color:#0a0a0a}.notification.is-black{background-color:#0a0a0a;color:#fff}.notification.is-light{background-color:#f5f5f5;color:#363636}.notification.is-dark{background-color:#363636;color:#f5f5f5}.notification.is-primary{background-color:#00d1b2;color:#fff}.notification.is-info{background-color:#3273dc;color:#fff}.notification.is-success{background-color:#23d160;color:#fff}.notification.is-warning{background-color:#ffdd57;color:rgba(0,0,0,.7)}.notification.is-danger{background-color:#ff3860;color:#fff}.progress{-moz-appearance:none;-webkit-appearance:none;border:none;border-radius:290486px;display:block;height:1rem;overflow:hidden;padding:0;width:100%}.progress:not(:last-child){margin-bottom:1.5rem}.progress::-webkit-progress-bar{background-color:#dbdbdb}.progress::-webkit-progress-value{background-color:#4a4a4a}.progress::-moz-progress-bar{background-color:#4a4a4a}.progress.is-white::-webkit-progress-value{background-color:#fff}.progress.is-white::-moz-progress-bar{background-color:#fff}.progress.is-black::-webkit-progress-value{background-color:#0a0a0a}.progress.is-black::-moz-progress-bar{background-color:#0a0a0a}.progress.is-light::-webkit-progress-value{background-color:#f5f5f5}.progress.is-light::-moz-progress-bar{background-color:#f5f5f5}.progress.is-dark::-webkit-progress-value{background-color:#363636}.progress.is-dark::-moz-progress-bar{background-color:#363636}.progress.is-primary::-webkit-progress-value{background-color:#00d1b2}.progress.is-primary::-moz-progress-bar{background-color:#00d1b2}.progress.is-info::-webkit-progress-value{background-color:#3273dc}.progress.is-info::-moz-progress-bar{background-color:#3273dc}.progress.is-success::-webkit-progress-value{background-color:#23d160}.progress.is-success::-moz-progress-bar{background-color:#23d160}.progress.is-warning::-webkit-progress-value{background-color:#ffdd57}.progress.is-warning::-moz-progress-bar{background-color:#ffdd57}.progress.is-danger::-webkit-progress-value{background-color:#ff3860}.progress.is-danger::-moz-progress-bar{background-color:#ff3860}.progress.is-small{height:.75rem}.progress.is-medium{height:1.25rem}.progress.is-large{height:1.5rem}.table{background-color:#fff;color:#363636;margin-bottom:1.5rem;width:100%}.table td,.table th{border:1px solid #dbdbdb;border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.table td.is-narrow,.table th.is-narrow{white-space:nowrap;width:1%}.table th{color:#363636;text-align:left}.table tr:hover{background-color:#fafafa}.table tr.is-selected{background-color:#00d1b2;color:#fff}.table tr.is-selected a,.table tr.is-selected strong{color:currentColor}.table tr.is-selected td,.table tr.is-selected th{border-color:#fff;color:currentColor}.table thead td,.table thead th{border-width:0 0 2px;color:#7a7a7a}.table tfoot td,.table tfoot th{border-width:2px 0 0;color:#7a7a7a}.table tbody tr:last-child td,.table tbody tr:last-child th{border-bottom-width:0}.table.is-bordered td,.table.is-bordered th{border-width:1px}.table.is-bordered tr:last-child td,.table.is-bordered tr:last-child th{border-bottom-width:1px}.table.is-narrow td,.table.is-narrow th{padding:.25em .5em}.table.is-striped tbody tr:not(.is-selected):nth-child(even){background-color:#fafafa}.table.is-striped tbody tr:not(.is-selected):nth-child(even):hover{background-color:#f5f5f5}.tag{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#f5f5f5;border-radius:290486px;color:#4a4a4a;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:.75rem;height:2em;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;line-height:1.5;padding-left:.875em;padding-right:.875em;white-space:nowrap}.tag .delete{margin-left:.25em;margin-right:-.375em}.tag.is-white{background-color:#fff;color:#0a0a0a}.tag.is-black{background-color:#0a0a0a;color:#fff}.tag.is-light{background-color:#f5f5f5;color:#363636}.tag.is-dark{background-color:#363636;color:#f5f5f5}.tag.is-primary{background-color:#00d1b2;color:#fff}.tag.is-info{background-color:#3273dc;color:#fff}.tag.is-success{background-color:#23d160;color:#fff}.tag.is-warning{background-color:#ffdd57;color:rgba(0,0,0,.7)}.tag.is-danger{background-color:#ff3860;color:#fff}.tag.is-medium{font-size:1rem}.tag.is-large{font-size:1.25rem}.subtitle,.title{word-break:break-word}.subtitle:not(:last-child),.title:not(:last-child){margin-bottom:1.5rem}.subtitle em,.subtitle span,.title em,.title span{font-weight:300}.subtitle strong,.title strong{font-weight:500}.subtitle .tag,.title .tag{vertical-align:middle}.title{color:#363636;font-size:2rem;font-weight:300;line-height:1.125}.title strong{color:inherit}.title+.highlight{margin-top:-.75rem}.title:not(.is-spaced)+.subtitle{margin-top:-1.5rem}.title.is-1{font-size:3rem}.title.is-2{font-size:2.5rem}.title.is-3{font-size:2rem}.title.is-4{font-size:1.5rem}.title.is-5{font-size:1.25rem}.title.is-6{font-size:1rem}.subtitle{color:#4a4a4a;font-size:1.25rem;font-weight:300;line-height:1.25}.subtitle strong{color:#363636}.subtitle:not(.is-spaced)+.title{margin-top:-1.5rem}.subtitle.is-1{font-size:3rem}.subtitle.is-2{font-size:2.5rem}.subtitle.is-3{font-size:2rem}.subtitle.is-4{font-size:1.5rem}.subtitle.is-5{font-size:1.25rem}.subtitle.is-6{font-size:1rem}.block:not(:last-child){margin-bottom:1.5rem}.container{position:relative}@media screen and (min-width:1000px){.container{margin:0 auto;max-width:960px;width:960px}.container.is-fluid{margin:0 20px;max-width:none;width:auto}}@media screen and (min-width:1192px){.container{max-width:1152px;width:1152px}}@media screen and (min-width:1384px){.container{max-width:1344px;width:1344px}}.delete{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(10,10,10,.2);border:none;border-radius:290486px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:0;position:relative;vertical-align:top;width:20px}.delete:after,.delete:before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;transform-origin:center center}.delete:before{height:2px;width:50%}.delete:after{height:50%;width:2px}.delete:focus,.delete:hover{background-color:rgba(10,10,10,.3)}.delete:active{background-color:rgba(10,10,10,.4)}.delete.is-small{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.delete.is-medium{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.delete.is-large{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;width:32px}.fa{font-size:21px;text-align:center;vertical-align:top}.heading{display:block;font-size:11px;letter-spacing:1px;margin-bottom:5px;text-transform:uppercase}.highlight{font-weight:400;max-width:100%;overflow:hidden;padding:0}.highlight:not(:last-child){margin-bottom:1.5rem}.highlight pre{overflow:auto;max-width:100%}.loader{-webkit-animation:spinAround .5s infinite linear;animation:spinAround .5s infinite linear;border:2px solid #dbdbdb;border-radius:290486px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;position:relative;width:1em}.number{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#f5f5f5;border-radius:290486px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1.25rem;height:2em;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:1.5rem;min-width:2.5em;padding:.25rem .5rem;text-align:center;vertical-align:top}.breadcrumb{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1rem;overflow:hidden;overflow-x:auto;white-space:nowrap}.breadcrumb:not(:last-child){margin-bottom:1.5rem}.breadcrumb a{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#7a7a7a;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:.5em .75em}.breadcrumb a:hover{color:#363636}.breadcrumb li{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.breadcrumb li.is-active a{color:#363636;cursor:default;pointer-events:none}.breadcrumb li+li:before{color:#4a4a4a;content:'\0002f'}.breadcrumb ol,.breadcrumb ul{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.breadcrumb .icon:first-child{margin-right:.5em}.breadcrumb .icon:last-child{margin-left:.5em}.breadcrumb.is-centered ol,.breadcrumb.is-centered ul{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.breadcrumb.is-right ol,.breadcrumb.is-right ul{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.breadcrumb.is-small{font-size:.75rem}.breadcrumb.is-medium{font-size:1.25rem}.breadcrumb.is-large{font-size:1.5rem}.breadcrumb.has-arrow-separator li+li:before{content:'\02192'}.breadcrumb.has-bullet-separator li+li:before{content:'\02022'}.breadcrumb.has-dot-separator li+li:before{content:'\000b7'}.breadcrumb.has-succeeds-separator li+li:before{content:'\0227B'}.card-header{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-shadow:0 1px 2px rgba(10,10,10,.1);box-shadow:0 1px 2px rgba(10,10,10,.1);display:-webkit-box;display:-ms-flexbox;display:flex}.card-header-title{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#363636;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;font-weight:700;padding:.75rem}.card-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:.75rem}.card-image{display:block;position:relative}.card-content{padding:1.5rem}.card-footer{border-top:1px solid #dbdbdb;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex}.card-footer-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:.75rem}.card-footer-item:not(:last-child){border-right:1px solid #dbdbdb}.card{background-color:#fff;-webkit-box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);color:#4a4a4a;max-width:100%;position:relative}.card .media:not(:last-child){margin-bottom:.75rem}.level-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.level-item .subtitle,.level-item .title{margin-bottom:0}@media screen and (max-width:768px){.level-item:not(:last-child){margin-bottom:.75rem}}.level-left,.level-right{-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.level-left .level-item:not(:last-child),.level-right .level-item:not(:last-child){margin-right:.75rem}.level-left .level-item.is-flexible,.level-right .level-item.is-flexible{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.level-left{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}@media screen and (max-width:768px){.level-left+.level-right{margin-top:1.5rem}}@media screen and (min-width:769px),print{.level-left{display:-webkit-box;display:-ms-flexbox;display:flex}}.level-right{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}@media screen and (min-width:769px),print{.level-right{display:-webkit-box;display:-ms-flexbox;display:flex}}.level{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.level:not(:last-child){margin-bottom:1.5rem}.level code{border-radius:3px}.level img{display:inline-block;vertical-align:top}.level.is-mobile{display:-webkit-box;display:-ms-flexbox;display:flex}.level.is-mobile .level-left,.level.is-mobile .level-right{display:-webkit-box;display:-ms-flexbox;display:flex}.level.is-mobile .level-left+.level-right{margin-top:0}.level.is-mobile .level-item:not(:last-child){margin-bottom:0}.level.is-mobile .level-item:not(.is-narrow){-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}@media screen and (min-width:769px),print{.level{display:-webkit-box;display:-ms-flexbox;display:flex}.level>.level-item:not(.is-narrow){-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}}.media-left,.media-right{-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.media-left{margin-right:1rem}.media-right{margin-left:1rem}.media-content{-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;text-align:left}.media{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left}.media .content:not(:last-child){margin-bottom:.75rem}.media .media{border-top:1px solid rgba(219,219,219,.5);display:-webkit-box;display:-ms-flexbox;display:flex;padding-top:.75rem}.media .media .content:not(:last-child),.media .media .control:not(:last-child){margin-bottom:.5rem}.media .media .media{padding-top:.5rem}.media .media .media+.media{margin-top:.5rem}.media+.media{border-top:1px solid rgba(219,219,219,.5);margin-top:1rem;padding-top:1rem}.media.is-large+.media{margin-top:1.5rem;padding-top:1.5rem}.menu{font-size:1rem}.menu-list{line-height:1.25}.menu-list a{border-radius:2px;color:#4a4a4a;display:block;padding:.5em .75em}.menu-list a:hover{background-color:#f5f5f5;color:#00d1b2}.menu-list a.is-active{background-color:#00d1b2;color:#fff}.menu-list li ul{border-left:1px solid #dbdbdb;margin:.75em;padding-left:.75em}.menu-label{color:#7a7a7a;font-size:.8em;letter-spacing:.1em;text-transform:uppercase}.menu-label:not(:first-child){margin-top:1em}.menu-label:not(:last-child){margin-bottom:1em}.message{background-color:#f5f5f5;border-radius:3px;font-size:1rem}.message:not(:last-child){margin-bottom:1.5rem}.message.is-white{background-color:#fff}.message.is-white .message-header{background-color:#fff;color:#0a0a0a}.message.is-white .message-body{border-color:#fff;color:#4d4d4d}.message.is-black{background-color:#fafafa}.message.is-black .message-header{background-color:#0a0a0a;color:#fff}.message.is-black .message-body{border-color:#0a0a0a;color:#090909}.message.is-light{background-color:#fafafa}.message.is-light .message-header{background-color:#f5f5f5;color:#363636}.message.is-light .message-body{border-color:#f5f5f5;color:#505050}.message.is-dark{background-color:#fafafa}.message.is-dark .message-header{background-color:#363636;color:#f5f5f5}.message.is-dark .message-body{border-color:#363636;color:#2a2a2a}.message.is-primary{background-color:#f5fffd}.message.is-primary .message-header{background-color:#00d1b2;color:#fff}.message.is-primary .message-body{border-color:#00d1b2;color:#021310}.message.is-info{background-color:#f6f9fe}.message.is-info .message-header{background-color:#3273dc;color:#fff}.message.is-info .message-body{border-color:#3273dc;color:#22509a}.message.is-success{background-color:#f6fef9}.message.is-success .message-header{background-color:#23d160;color:#fff}.message.is-success .message-body{border-color:#23d160;color:#0e301a}.message.is-warning{background-color:#fffdf5}.message.is-warning .message-header{background-color:#ffdd57;color:rgba(0,0,0,.7)}.message.is-warning .message-body{border-color:#ffdd57;color:#3b3108}.message.is-danger{background-color:#fff5f7}.message.is-danger .message-header{background-color:#ff3860;color:#fff}.message.is-danger .message-body{border-color:#ff3860;color:#cd0930}.message-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#4a4a4a;border-radius:3px 3px 0 0;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;line-height:1.25;padding:.5em .75em;position:relative}.message-header a,.message-header strong{color:inherit}.message-header a{text-decoration:underline}.message-header .delete{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;margin-left:.75em}.message-header+.message-body{border-top-left-radius:0;border-top-right-radius:0;border-top:none}.message-body{border:1px solid #dbdbdb;border-radius:3px;color:#4a4a4a;padding:1em 1.25em}.message-body a,.message-body strong{color:inherit}.message-body a{text-decoration:underline}.message-body code,.message-body pre{background:#fff}.message-body pre code{background:0 0}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:rgba(10,10,10,.86)}.modal-card,.modal-content{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media screen and (min-width:769px),print{.modal-card,.modal-content{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}.modal-close{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(10,10,10,.2);border:none;border-radius:290486px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:0;position:relative;vertical-align:top;width:20px;background:0 0;height:40px;position:fixed;right:20px;top:20px;width:40px}.modal-close:after,.modal-close:before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;transform-origin:center center}.modal-close:before{height:2px;width:50%}.modal-close:after{height:50%;width:2px}.modal-close:focus,.modal-close:hover{background-color:rgba(10,10,10,.3)}.modal-close:active{background-color:rgba(10,10,10,.4)}.modal-close.is-small{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.modal-close.is-medium{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.modal-close.is-large{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;width:32px}.modal-card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden}.modal-card-foot,.modal-card-head{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#f5f5f5;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;padding:20px;position:relative}.modal-card-head{border-bottom:1px solid #dbdbdb;border-top-left-radius:5px;border-top-right-radius:5px}.modal-card-title{color:#363636;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;font-size:1.5rem;line-height:1}.modal-card-foot{border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:1px solid #dbdbdb}.modal-card-foot .button:not(:last-child){margin-right:10px}.modal-card-body{-webkit-overflow-scrolling:touch;background-color:#fff;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;overflow:auto;padding:20px}.modal{bottom:0;left:0;position:absolute;right:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:none;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow:hidden;position:fixed;z-index:20}.modal.is-active{display:-webkit-box;display:-ms-flexbox;display:flex}.nav-toggle{cursor:pointer;display:block;height:3.25rem;position:relative;width:3.25rem}.nav-toggle span{background-color:#4a4a4a;display:block;height:1px;left:50%;margin-left:-7px;position:absolute;top:50%;-webkit-transition:none 86ms ease-out;transition:none 86ms ease-out;-webkit-transition-property:background,left,opacity,-webkit-transform;transition-property:background,left,opacity,-webkit-transform;transition-property:background,left,opacity,transform;transition-property:background,left,opacity,transform,-webkit-transform;width:15px}.nav-toggle span:nth-child(1){margin-top:-6px}.nav-toggle span:nth-child(2){margin-top:-1px}.nav-toggle span:nth-child(3){margin-top:4px}.nav-toggle:hover{background-color:#f5f5f5}.nav-toggle.is-active span{background-color:#00d1b2}.nav-toggle.is-active span:nth-child(1){margin-left:-5px;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform-origin:left top;transform-origin:left top}.nav-toggle.is-active span:nth-child(2){opacity:0}.nav-toggle.is-active span:nth-child(3){margin-left:-5px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:left bottom;transform-origin:left bottom}@media screen and (min-width:769px),print{.nav-toggle{display:none}}.nav-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;line-height:1.5;padding:.5rem .75rem}.nav-item a{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.nav-item img{max-height:1.75rem}.nav-item .tag:first-child:not(:last-child){margin-right:.5rem}.nav-item .tag:last-child:not(:first-child){margin-left:.5rem}@media screen and (max-width:768px){.nav-item{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}.nav-item a:not(.button),a.nav-item:not(.button){color:#7a7a7a}.nav-item a:not(.button):hover,a.nav-item:not(.button):hover{color:#363636}.nav-item a:not(.button).is-active,a.nav-item:not(.button).is-active{color:#363636}.nav-item a:not(.button).is-tab,a.nav-item:not(.button).is-tab{border-bottom:1px solid transparent;border-top:1px solid transparent;padding-bottom:calc(.75rem - 1px);padding-left:1rem;padding-right:1rem;padding-top:calc(.75rem - 1px)}.nav-item a:not(.button).is-tab:hover,a.nav-item:not(.button).is-tab:hover{border-bottom-color:#00d1b2;border-top-color:transparent}.nav-item a:not(.button).is-tab.is-active,a.nav-item:not(.button).is-tab.is-active{border-bottom:3px solid #00d1b2;color:#00d1b2;padding-bottom:calc(.75rem - 3px)}@media screen and (min-width:1000px){.nav-item a:not(.button).is-brand,a.nav-item:not(.button).is-brand{padding-left:0}}.nav-left,.nav-right{-webkit-overflow-scrolling:touch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;max-width:100%;overflow:auto}@media screen and (min-width:1192px){.nav-left,.nav-right{-ms-flex-preferred-size:0;flex-basis:0}}.nav-left{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;white-space:nowrap}.nav-right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.nav-center{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-left:auto;margin-right:auto}@media screen and (max-width:768px){.nav-menu.nav-right{background-color:#fff;-webkit-box-shadow:0 4px 7px rgba(10,10,10,.1);box-shadow:0 4px 7px rgba(10,10,10,.1);left:0;display:none;right:0;top:100%;position:absolute}.nav-menu.nav-right .nav-item{border-top:1px solid rgba(219,219,219,.5);padding:.75rem}.nav-menu.nav-right.is-active{display:block}}.nav{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;height:3.25rem;position:relative;text-align:center;z-index:10}.nav>.container{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;min-height:3.25rem;width:100%}.nav.has-shadow{-webkit-box-shadow:0 2px 3px rgba(10,10,10,.1);box-shadow:0 2px 3px rgba(10,10,10,.1)}.navbar{background-color:#fff;min-height:3.25rem;position:relative}.navbar-brand{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:3.25rem;display:-webkit-box;display:-ms-flexbox;display:flex}.navbar-burger{cursor:pointer;display:block;height:3.25rem;position:relative;width:3.25rem;margin-left:auto}.navbar-burger span{background-color:#4a4a4a;display:block;height:1px;left:50%;margin-left:-7px;position:absolute;top:50%;-webkit-transition:none 86ms ease-out;transition:none 86ms ease-out;-webkit-transition-property:background,left,opacity,-webkit-transform;transition-property:background,left,opacity,-webkit-transform;transition-property:background,left,opacity,transform;transition-property:background,left,opacity,transform,-webkit-transform;width:15px}.navbar-burger span:nth-child(1){margin-top:-6px}.navbar-burger span:nth-child(2){margin-top:-1px}.navbar-burger span:nth-child(3){margin-top:4px}.navbar-burger:hover{background-color:#f5f5f5}.navbar-burger.is-active span{background-color:#00d1b2}.navbar-burger.is-active span:nth-child(1){margin-left:-5px;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform-origin:left top;transform-origin:left top}.navbar-burger.is-active span:nth-child(2){opacity:0}.navbar-burger.is-active span:nth-child(3){margin-left:-5px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:left bottom;transform-origin:left bottom}.navbar-menu{display:none}.navbar-item,.navbar-link{color:#4a4a4a;display:block;line-height:1.5;padding:.5rem 1rem;position:relative}.navbar-link.is-active,.navbar-link:hover,a.navbar-item.is-active,a.navbar-item:hover{background-color:#f5f5f5;color:#0a0a0a}.navbar-item{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.navbar-item img{max-height:1.75rem}.navbar-item.has-dropdown{padding:0}.navbar-content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.navbar-link{padding-right:2.5em}.navbar-dropdown{font-size:.875rem;padding-bottom:.5rem;padding-top:.5rem}.navbar-dropdown .navbar-item{padding-left:1.5rem;padding-right:1.5rem}.navbar-divider{background-color:#dbdbdb;border:none;display:none;height:1px;margin:.5rem 0}@media screen and (max-width:999px){.navbar-brand .navbar-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.navbar-menu{-webkit-box-shadow:0 8px 16px rgba(10,10,10,.1);box-shadow:0 8px 16px rgba(10,10,10,.1);padding:.5rem 0}.navbar-menu.is-active{display:block}}@media screen and (min-width:1000px){.navbar,.navbar-end,.navbar-menu,.navbar-start{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex}.navbar{height:3.25rem}.navbar.is-transparent .navbar-link.is-active,.navbar.is-transparent .navbar-link:hover,.navbar.is-transparent a.navbar-item.is-active,.navbar.is-transparent a.navbar-item:hover{background-color:transparent}.navbar.is-transparent .navbar-item.has-dropdown.is-active .navbar-link,.navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:hover .navbar-link{background-color:transparent}.navbar.is-transparent .navbar-dropdown a.navbar-item:hover{background-color:#f5f5f5;color:#0a0a0a}.navbar.is-transparent .navbar-dropdown a.navbar-item.is-active{background-color:#f5f5f5;color:#00d1b2}.navbar-burger{display:none}.navbar-item,.navbar-link{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.navbar-item.has-dropdown{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.navbar-item.is-active .navbar-dropdown,.navbar-item.is-hoverable:hover .navbar-dropdown{display:block}.navbar-item.is-active .navbar-dropdown.is-boxed,.navbar-item.is-hoverable:hover .navbar-dropdown.is-boxed{opacity:1;pointer-events:auto;-webkit-transform:translateY(0);transform:translateY(0)}.navbar-link::after{border:1px solid #00d1b2;border-right:0;border-top:0;content:" ";display:block;height:.5em;pointer-events:none;position:absolute;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);width:.5em;margin-top:-.375em;right:1.125em;top:50%}.navbar-menu{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.navbar-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;margin-right:auto}.navbar-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-left:auto}.navbar-dropdown{background-color:#fff;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:1px solid #dbdbdb;-webkit-box-shadow:0 8px 8px rgba(10,10,10,.1);box-shadow:0 8px 8px rgba(10,10,10,.1);display:none;font-size:.875rem;left:0;min-width:100%;position:absolute;top:100%;z-index:20}.navbar-dropdown .navbar-item{padding:.375rem 1rem;white-space:nowrap}.navbar-dropdown a.navbar-item{padding-right:3rem}.navbar-dropdown a.navbar-item:hover{background-color:#f5f5f5;color:#0a0a0a}.navbar-dropdown a.navbar-item.is-active{background-color:#f5f5f5;color:#00d1b2}.navbar-dropdown.is-boxed{border-radius:5px;border-top:none;-webkit-box-shadow:0 8px 8px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);box-shadow:0 8px 8px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);display:block;opacity:0;pointer-events:none;top:calc(100% + (-4px));-webkit-transform:translateY(-5px);transform:translateY(-5px);-webkit-transition-duration:86ms;transition-duration:86ms;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform;transition-property:opacity,transform,-webkit-transform}.navbar-divider{display:block}.container>.navbar{margin-left:-1rem;margin-right:-1rem}.navbar-link.is-active,a.navbar-item.is-active{color:#0a0a0a}.navbar-link.is-active:not(:hover),a.navbar-item.is-active:not(:hover){background-color:transparent}.navbar-item.has-dropdown.is-active .navbar-link,.navbar-item.has-dropdown:hover .navbar-link{background-color:#f5f5f5}}.pagination{font-size:1rem;margin:-.25rem}.pagination.is-small{font-size:.75rem}.pagination.is-medium{font-size:1.25rem}.pagination.is-large{font-size:1.5rem}.pagination,.pagination-list{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.pagination-ellipsis,.pagination-link,.pagination-next,.pagination-previous{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.25em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.375em - 1px);padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);padding-top:calc(.375em - 1px);position:relative;vertical-align:top;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:1em;padding-left:.5em;padding-right:.5em;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:.25rem;text-align:center}.pagination-ellipsis.is-active,.pagination-ellipsis.is-focused,.pagination-ellipsis:active,.pagination-ellipsis:focus,.pagination-link.is-active,.pagination-link.is-focused,.pagination-link:active,.pagination-link:focus,.pagination-next.is-active,.pagination-next.is-focused,.pagination-next:active,.pagination-next:focus,.pagination-previous.is-active,.pagination-previous.is-focused,.pagination-previous:active,.pagination-previous:focus{outline:0}.pagination-ellipsis[disabled],.pagination-link[disabled],.pagination-next[disabled],.pagination-previous[disabled]{cursor:not-allowed}.pagination-link,.pagination-next,.pagination-previous{border-color:#dbdbdb;min-width:2.25em}.pagination-link:hover,.pagination-next:hover,.pagination-previous:hover{border-color:#b5b5b5;color:#363636}.pagination-link:focus,.pagination-next:focus,.pagination-previous:focus{border-color:#00d1b2}.pagination-link:active,.pagination-next:active,.pagination-previous:active{-webkit-box-shadow:inset 0 1px 2px rgba(10,10,10,.2);box-shadow:inset 0 1px 2px rgba(10,10,10,.2)}.pagination-link[disabled],.pagination-next[disabled],.pagination-previous[disabled]{background-color:#dbdbdb;border-color:#dbdbdb;-webkit-box-shadow:none;box-shadow:none;color:#7a7a7a;opacity:.5}.pagination-next,.pagination-previous{padding-left:.75em;padding-right:.75em;white-space:nowrap}.pagination-link.is-current{background-color:#00d1b2;border-color:#00d1b2;color:#fff}.pagination-ellipsis{color:#b5b5b5;pointer-events:none}.pagination-list{-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (max-width:768px){.pagination{-ms-flex-wrap:wrap;flex-wrap:wrap}.pagination-next,.pagination-previous{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.pagination-list li{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}}@media screen and (min-width:769px),print{.pagination-list{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.pagination-previous{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.pagination-next{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.pagination{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.pagination.is-centered .pagination-previous{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.pagination.is-centered .pagination-list{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.pagination.is-centered .pagination-next{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.pagination.is-right .pagination-previous{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.pagination.is-right .pagination-next{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.pagination.is-right .pagination-list{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}}.panel{font-size:1rem}.panel:not(:last-child){margin-bottom:1.5rem}.panel-block,.panel-heading,.panel-tabs{border-bottom:1px solid #dbdbdb;border-left:1px solid #dbdbdb;border-right:1px solid #dbdbdb}.panel-block:first-child,.panel-heading:first-child,.panel-tabs:first-child{border-top:1px solid #dbdbdb}.panel-heading{background-color:#f5f5f5;border-radius:3px 3px 0 0;color:#363636;font-size:1.25em;font-weight:300;line-height:1.25;padding:.5em .75em}.panel-tabs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:.875em;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.panel-tabs a{border-bottom:1px solid #dbdbdb;margin-bottom:-1px;padding:.5em}.panel-tabs a.is-active{border-bottom-color:#4a4a4a;color:#363636}.panel-list a{color:#4a4a4a}.panel-list a:hover{color:#00d1b2}.panel-block{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#363636;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;padding:.5em .75em}.panel-block input[type=checkbox]{margin-right:.75em}.panel-block>.control{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;width:100%}.panel-block.is-wrapped{-ms-flex-wrap:wrap;flex-wrap:wrap}.panel-block.is-active{border-left-color:#00d1b2;color:#363636}.panel-block.is-active .panel-icon{color:#00d1b2}a.panel-block,label.panel-block{cursor:pointer}a.panel-block:hover,label.panel-block:hover{background-color:#f5f5f5}.panel-icon{display:inline-block;font-size:14px;height:1em;line-height:1em;text-align:center;vertical-align:top;width:1em;color:#7a7a7a;margin-right:.75em}.panel-icon .fa{font-size:inherit;line-height:inherit}.tabs{-webkit-overflow-scrolling:touch;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1rem;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden;overflow-x:auto;white-space:nowrap}.tabs:not(:last-child){margin-bottom:1.5rem}.tabs a{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #dbdbdb;color:#4a4a4a;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:-1px;padding:.5em 1em;vertical-align:top}.tabs a:hover{border-bottom-color:#363636;color:#363636}.tabs li{display:block}.tabs li.is-active a{border-bottom-color:#00d1b2;color:#00d1b2}.tabs ul{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #dbdbdb;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.tabs ul.is-left{padding-right:.75em}.tabs ul.is-center{-webkit-box-flex:0;-ms-flex:none;flex:none;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:.75em;padding-right:.75em}.tabs ul.is-right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding-left:.75em}.tabs .icon:first-child{margin-right:.5em}.tabs .icon:last-child{margin-left:.5em}.tabs.is-centered ul{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.tabs.is-right ul{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.tabs.is-boxed a{border:1px solid transparent;border-radius:3px 3px 0 0}.tabs.is-boxed a:hover{background-color:#f5f5f5;border-bottom-color:#dbdbdb}.tabs.is-boxed li.is-active a{background-color:#fff;border-color:#dbdbdb;border-bottom-color:transparent!important}.tabs.is-fullwidth li{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.tabs.is-toggle a{border:1px solid #dbdbdb;margin-bottom:0;position:relative}.tabs.is-toggle a:hover{background-color:#f5f5f5;border-color:#b5b5b5;z-index:2}.tabs.is-toggle li+li{margin-left:-1px}.tabs.is-toggle li:first-child a{border-radius:3px 0 0 3px}.tabs.is-toggle li:last-child a{border-radius:0 3px 3px 0}.tabs.is-toggle li.is-active a{background-color:#00d1b2;border-color:#00d1b2;color:#fff;z-index:1}.tabs.is-toggle ul{border-bottom:none}.tabs.is-small{font-size:.75rem}.tabs.is-medium{font-size:1.25rem}.tabs.is-large{font-size:1.5rem}.column{display:block;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;padding:.75rem}.columns.is-mobile>.column.is-narrow{-webkit-box-flex:0;-ms-flex:none;flex:none}.columns.is-mobile>.column.is-full{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.columns.is-mobile>.column.is-three-quarters{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.columns.is-mobile>.column.is-two-thirds{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.columns.is-mobile>.column.is-half{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.columns.is-mobile>.column.is-one-third{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.columns.is-mobile>.column.is-one-quarter{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.columns.is-mobile>.column.is-offset-three-quarters{margin-left:75%}.columns.is-mobile>.column.is-offset-two-thirds{margin-left:66.6666%}.columns.is-mobile>.column.is-offset-half{margin-left:50%}.columns.is-mobile>.column.is-offset-one-third{margin-left:33.3333%}.columns.is-mobile>.column.is-offset-one-quarter{margin-left:25%}.columns.is-mobile>.column.is-1{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.columns.is-mobile>.column.is-offset-1{margin-left:8.33333%}.columns.is-mobile>.column.is-2{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.columns.is-mobile>.column.is-offset-2{margin-left:16.66667%}.columns.is-mobile>.column.is-3{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.columns.is-mobile>.column.is-offset-3{margin-left:25%}.columns.is-mobile>.column.is-4{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.columns.is-mobile>.column.is-offset-4{margin-left:33.33333%}.columns.is-mobile>.column.is-5{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.columns.is-mobile>.column.is-offset-5{margin-left:41.66667%}.columns.is-mobile>.column.is-6{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.columns.is-mobile>.column.is-offset-6{margin-left:50%}.columns.is-mobile>.column.is-7{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.columns.is-mobile>.column.is-offset-7{margin-left:58.33333%}.columns.is-mobile>.column.is-8{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.columns.is-mobile>.column.is-offset-8{margin-left:66.66667%}.columns.is-mobile>.column.is-9{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.columns.is-mobile>.column.is-offset-9{margin-left:75%}.columns.is-mobile>.column.is-10{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.columns.is-mobile>.column.is-offset-10{margin-left:83.33333%}.columns.is-mobile>.column.is-11{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.columns.is-mobile>.column.is-offset-11{margin-left:91.66667%}.columns.is-mobile>.column.is-12{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.columns.is-mobile>.column.is-offset-12{margin-left:100%}@media screen and (max-width:768px){.column.is-narrow-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters-mobile{margin-left:75%}.column.is-offset-two-thirds-mobile{margin-left:66.6666%}.column.is-offset-half-mobile{margin-left:50%}.column.is-offset-one-third-mobile{margin-left:33.3333%}.column.is-offset-one-quarter-mobile{margin-left:25%}.column.is-1-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1-mobile{margin-left:8.33333%}.column.is-2-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2-mobile{margin-left:16.66667%}.column.is-3-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3-mobile{margin-left:25%}.column.is-4-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4-mobile{margin-left:33.33333%}.column.is-5-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5-mobile{margin-left:41.66667%}.column.is-6-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6-mobile{margin-left:50%}.column.is-7-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7-mobile{margin-left:58.33333%}.column.is-8-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8-mobile{margin-left:66.66667%}.column.is-9-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9-mobile{margin-left:75%}.column.is-10-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10-mobile{margin-left:83.33333%}.column.is-11-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11-mobile{margin-left:91.66667%}.column.is-12-mobile{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12-mobile{margin-left:100%}}@media screen and (min-width:769px),print{.column.is-narrow,.column.is-narrow-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full,.column.is-full-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters,.column.is-three-quarters-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds,.column.is-two-thirds-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half,.column.is-half-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third,.column.is-one-third-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter,.column.is-one-quarter-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters,.column.is-offset-three-quarters-tablet{margin-left:75%}.column.is-offset-two-thirds,.column.is-offset-two-thirds-tablet{margin-left:66.6666%}.column.is-offset-half,.column.is-offset-half-tablet{margin-left:50%}.column.is-offset-one-third,.column.is-offset-one-third-tablet{margin-left:33.3333%}.column.is-offset-one-quarter,.column.is-offset-one-quarter-tablet{margin-left:25%}.column.is-1,.column.is-1-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1,.column.is-offset-1-tablet{margin-left:8.33333%}.column.is-2,.column.is-2-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2,.column.is-offset-2-tablet{margin-left:16.66667%}.column.is-3,.column.is-3-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3,.column.is-offset-3-tablet{margin-left:25%}.column.is-4,.column.is-4-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4,.column.is-offset-4-tablet{margin-left:33.33333%}.column.is-5,.column.is-5-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5,.column.is-offset-5-tablet{margin-left:41.66667%}.column.is-6,.column.is-6-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6,.column.is-offset-6-tablet{margin-left:50%}.column.is-7,.column.is-7-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7,.column.is-offset-7-tablet{margin-left:58.33333%}.column.is-8,.column.is-8-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8,.column.is-offset-8-tablet{margin-left:66.66667%}.column.is-9,.column.is-9-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9,.column.is-offset-9-tablet{margin-left:75%}.column.is-10,.column.is-10-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10,.column.is-offset-10-tablet{margin-left:83.33333%}.column.is-11,.column.is-11-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11,.column.is-offset-11-tablet{margin-left:91.66667%}.column.is-12,.column.is-12-tablet{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12,.column.is-offset-12-tablet{margin-left:100%}}@media screen and (max-width:999px){.column.is-narrow-touch{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters-touch{margin-left:75%}.column.is-offset-two-thirds-touch{margin-left:66.6666%}.column.is-offset-half-touch{margin-left:50%}.column.is-offset-one-third-touch{margin-left:33.3333%}.column.is-offset-one-quarter-touch{margin-left:25%}.column.is-1-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1-touch{margin-left:8.33333%}.column.is-2-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2-touch{margin-left:16.66667%}.column.is-3-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3-touch{margin-left:25%}.column.is-4-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4-touch{margin-left:33.33333%}.column.is-5-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5-touch{margin-left:41.66667%}.column.is-6-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6-touch{margin-left:50%}.column.is-7-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7-touch{margin-left:58.33333%}.column.is-8-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8-touch{margin-left:66.66667%}.column.is-9-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9-touch{margin-left:75%}.column.is-10-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10-touch{margin-left:83.33333%}.column.is-11-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11-touch{margin-left:91.66667%}.column.is-12-touch{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12-touch{margin-left:100%}}@media screen and (min-width:1000px){.column.is-narrow-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters-desktop{margin-left:75%}.column.is-offset-two-thirds-desktop{margin-left:66.6666%}.column.is-offset-half-desktop{margin-left:50%}.column.is-offset-one-third-desktop{margin-left:33.3333%}.column.is-offset-one-quarter-desktop{margin-left:25%}.column.is-1-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1-desktop{margin-left:8.33333%}.column.is-2-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2-desktop{margin-left:16.66667%}.column.is-3-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3-desktop{margin-left:25%}.column.is-4-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4-desktop{margin-left:33.33333%}.column.is-5-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5-desktop{margin-left:41.66667%}.column.is-6-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6-desktop{margin-left:50%}.column.is-7-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7-desktop{margin-left:58.33333%}.column.is-8-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8-desktop{margin-left:66.66667%}.column.is-9-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9-desktop{margin-left:75%}.column.is-10-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10-desktop{margin-left:83.33333%}.column.is-11-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11-desktop{margin-left:91.66667%}.column.is-12-desktop{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12-desktop{margin-left:100%}}@media screen and (min-width:1192px){.column.is-narrow-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters-widescreen{margin-left:75%}.column.is-offset-two-thirds-widescreen{margin-left:66.6666%}.column.is-offset-half-widescreen{margin-left:50%}.column.is-offset-one-third-widescreen{margin-left:33.3333%}.column.is-offset-one-quarter-widescreen{margin-left:25%}.column.is-1-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1-widescreen{margin-left:8.33333%}.column.is-2-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2-widescreen{margin-left:16.66667%}.column.is-3-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3-widescreen{margin-left:25%}.column.is-4-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4-widescreen{margin-left:33.33333%}.column.is-5-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5-widescreen{margin-left:41.66667%}.column.is-6-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6-widescreen{margin-left:50%}.column.is-7-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7-widescreen{margin-left:58.33333%}.column.is-8-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8-widescreen{margin-left:66.66667%}.column.is-9-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9-widescreen{margin-left:75%}.column.is-10-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10-widescreen{margin-left:83.33333%}.column.is-11-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11-widescreen{margin-left:91.66667%}.column.is-12-widescreen{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12-widescreen{margin-left:100%}}@media screen and (min-width:1384px){.column.is-narrow-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none}.column.is-full-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-three-quarters-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-two-thirds-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.6666%}.column.is-half-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-one-third-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.3333%}.column.is-one-quarter-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-three-quarters-fullhd{margin-left:75%}.column.is-offset-two-thirds-fullhd{margin-left:66.6666%}.column.is-offset-half-fullhd{margin-left:50%}.column.is-offset-one-third-fullhd{margin-left:33.3333%}.column.is-offset-one-quarter-fullhd{margin-left:25%}.column.is-1-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.column.is-offset-1-fullhd{margin-left:8.33333%}.column.is-2-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.column.is-offset-2-fullhd{margin-left:16.66667%}.column.is-3-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.column.is-offset-3-fullhd{margin-left:25%}.column.is-4-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.column.is-offset-4-fullhd{margin-left:33.33333%}.column.is-5-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.column.is-offset-5-fullhd{margin-left:41.66667%}.column.is-6-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6-fullhd{margin-left:50%}.column.is-7-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.column.is-offset-7-fullhd{margin-left:58.33333%}.column.is-8-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.column.is-offset-8-fullhd{margin-left:66.66667%}.column.is-9-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.column.is-offset-9-fullhd{margin-left:75%}.column.is-10-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.column.is-offset-10-fullhd{margin-left:83.33333%}.column.is-11-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.column.is-offset-11-fullhd{margin-left:91.66667%}.column.is-12-fullhd{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}.column.is-offset-12-fullhd{margin-left:100%}}.columns{margin-left:-.75rem;margin-right:-.75rem;margin-top:-.75rem}.columns:last-child{margin-bottom:-.75rem}.columns:not(:last-child){margin-bottom:.75rem}.columns.is-centered{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.columns.is-gapless{margin-left:0;margin-right:0;margin-top:0}.columns.is-gapless:last-child{margin-bottom:0}.columns.is-gapless:not(:last-child){margin-bottom:1.5rem}.columns.is-gapless>.column{margin:0;padding:0}@media screen and (min-width:769px),print{.columns.is-grid{-ms-flex-wrap:wrap;flex-wrap:wrap}.columns.is-grid>.column{max-width:33.3333%;padding:.75rem;width:33.3333%}.columns.is-grid>.column+.column{margin-left:0}}.columns.is-mobile{display:-webkit-box;display:-ms-flexbox;display:flex}.columns.is-multiline{-ms-flex-wrap:wrap;flex-wrap:wrap}.columns.is-vcentered{-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media screen and (min-width:769px),print{.columns:not(.is-desktop){display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width:1000px){.columns.is-desktop{display:-webkit-box;display:-ms-flexbox;display:flex}}.tile{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:block;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;min-height:-webkit-min-content;min-height:-moz-min-content;min-height:min-content}.tile.is-ancestor{margin-left:-.75rem;margin-right:-.75rem;margin-top:-.75rem}.tile.is-ancestor:last-child{margin-bottom:-.75rem}.tile.is-ancestor:not(:last-child){margin-bottom:.75rem}.tile.is-child{margin:0!important}.tile.is-parent{padding:.75rem}.tile.is-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.tile.is-vertical>.tile.is-child:not(:last-child){margin-bottom:1.5rem!important}@media screen and (min-width:769px),print{.tile:not(.is-child){display:-webkit-box;display:-ms-flexbox;display:flex}.tile.is-1{-webkit-box-flex:0;-ms-flex:none;flex:none;width:8.33333%}.tile.is-2{-webkit-box-flex:0;-ms-flex:none;flex:none;width:16.66667%}.tile.is-3{-webkit-box-flex:0;-ms-flex:none;flex:none;width:25%}.tile.is-4{-webkit-box-flex:0;-ms-flex:none;flex:none;width:33.33333%}.tile.is-5{-webkit-box-flex:0;-ms-flex:none;flex:none;width:41.66667%}.tile.is-6{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.tile.is-7{-webkit-box-flex:0;-ms-flex:none;flex:none;width:58.33333%}.tile.is-8{-webkit-box-flex:0;-ms-flex:none;flex:none;width:66.66667%}.tile.is-9{-webkit-box-flex:0;-ms-flex:none;flex:none;width:75%}.tile.is-10{-webkit-box-flex:0;-ms-flex:none;flex:none;width:83.33333%}.tile.is-11{-webkit-box-flex:0;-ms-flex:none;flex:none;width:91.66667%}.tile.is-12{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}}.hero-video{bottom:0;left:0;position:absolute;right:0;top:0;overflow:hidden}.hero-video video{left:50%;min-height:100%;min-width:100%;position:absolute;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.hero-video.is-transparent{opacity:.3}@media screen and (max-width:768px){.hero-video{display:none}}.hero-buttons{margin-top:1.5rem}@media screen and (max-width:768px){.hero-buttons .button{display:-webkit-box;display:-ms-flexbox;display:flex}.hero-buttons .button:not(:last-child){margin-bottom:.75rem}}@media screen and (min-width:769px),print{.hero-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.hero-buttons .button:not(:last-child){margin-right:1.5rem}}.hero-foot,.hero-head{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.hero-body{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;padding:3rem 1.5rem}.hero{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.hero .nav{background:0 0;-webkit-box-shadow:0 1px 0 rgba(219,219,219,.3);box-shadow:0 1px 0 rgba(219,219,219,.3)}.hero .tabs ul{border-bottom:none}.hero.is-white{background-color:#fff;color:#0a0a0a}.hero.is-white a:not(.button),.hero.is-white strong{color:inherit}.hero.is-white .title{color:#0a0a0a}.hero.is-white .subtitle{color:rgba(10,10,10,.9)}.hero.is-white .subtitle a:not(.button),.hero.is-white .subtitle strong{color:#0a0a0a}.hero.is-white .nav{-webkit-box-shadow:0 1px 0 rgba(10,10,10,.2);box-shadow:0 1px 0 rgba(10,10,10,.2)}@media screen and (max-width:768px){.hero.is-white .nav-menu{background-color:#fff}}.hero.is-white .nav-item a:not(.button),.hero.is-white a.nav-item{color:rgba(10,10,10,.7)}.hero.is-white .nav-item a:not(.button).is-active,.hero.is-white .nav-item a:not(.button):hover,.hero.is-white a.nav-item.is-active,.hero.is-white a.nav-item:hover{color:#0a0a0a}.hero.is-white .tabs a{color:#0a0a0a;opacity:.9}.hero.is-white .tabs a:hover{opacity:1}.hero.is-white .tabs li.is-active a{opacity:1}.hero.is-white .tabs.is-boxed a,.hero.is-white .tabs.is-toggle a{color:#0a0a0a}.hero.is-white .tabs.is-boxed a:hover,.hero.is-white .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-white .tabs.is-boxed li.is-active a,.hero.is-white .tabs.is-boxed li.is-active a:hover,.hero.is-white .tabs.is-toggle li.is-active a,.hero.is-white .tabs.is-toggle li.is-active a:hover{background-color:#0a0a0a;border-color:#0a0a0a;color:#fff}.hero.is-white.is-bold{background-image:linear-gradient(141deg,#e6e6e6 0,#fff 71%,#fff 100%)}@media screen and (max-width:768px){.hero.is-white.is-bold .nav-menu{background-image:linear-gradient(141deg,#e6e6e6 0,#fff 71%,#fff 100%)}}@media screen and (max-width:768px){.hero.is-white .nav-toggle span{background-color:#0a0a0a}.hero.is-white .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-white .nav-toggle.is-active span{background-color:#0a0a0a}.hero.is-white .nav-menu .nav-item{border-top-color:rgba(10,10,10,.2)}}.hero.is-black{background-color:#0a0a0a;color:#fff}.hero.is-black a:not(.button),.hero.is-black strong{color:inherit}.hero.is-black .title{color:#fff}.hero.is-black .subtitle{color:rgba(255,255,255,.9)}.hero.is-black .subtitle a:not(.button),.hero.is-black .subtitle strong{color:#fff}.hero.is-black .nav{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.2)}@media screen and (max-width:768px){.hero.is-black .nav-menu{background-color:#0a0a0a}}.hero.is-black .nav-item a:not(.button),.hero.is-black a.nav-item{color:rgba(255,255,255,.7)}.hero.is-black .nav-item a:not(.button).is-active,.hero.is-black .nav-item a:not(.button):hover,.hero.is-black a.nav-item.is-active,.hero.is-black a.nav-item:hover{color:#fff}.hero.is-black .tabs a{color:#fff;opacity:.9}.hero.is-black .tabs a:hover{opacity:1}.hero.is-black .tabs li.is-active a{opacity:1}.hero.is-black .tabs.is-boxed a,.hero.is-black .tabs.is-toggle a{color:#fff}.hero.is-black .tabs.is-boxed a:hover,.hero.is-black .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-black .tabs.is-boxed li.is-active a,.hero.is-black .tabs.is-boxed li.is-active a:hover,.hero.is-black .tabs.is-toggle li.is-active a,.hero.is-black .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#0a0a0a}.hero.is-black.is-bold{background-image:linear-gradient(141deg,#000 0,#0a0a0a 71%,#181616 100%)}@media screen and (max-width:768px){.hero.is-black.is-bold .nav-menu{background-image:linear-gradient(141deg,#000 0,#0a0a0a 71%,#181616 100%)}}@media screen and (max-width:768px){.hero.is-black .nav-toggle span{background-color:#fff}.hero.is-black .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-black .nav-toggle.is-active span{background-color:#fff}.hero.is-black .nav-menu .nav-item{border-top-color:rgba(255,255,255,.2)}}.hero.is-light{background-color:#f5f5f5;color:#363636}.hero.is-light a:not(.button),.hero.is-light strong{color:inherit}.hero.is-light .title{color:#363636}.hero.is-light .subtitle{color:rgba(54,54,54,.9)}.hero.is-light .subtitle a:not(.button),.hero.is-light .subtitle strong{color:#363636}.hero.is-light .nav{-webkit-box-shadow:0 1px 0 rgba(54,54,54,.2);box-shadow:0 1px 0 rgba(54,54,54,.2)}@media screen and (max-width:768px){.hero.is-light .nav-menu{background-color:#f5f5f5}}.hero.is-light .nav-item a:not(.button),.hero.is-light a.nav-item{color:rgba(54,54,54,.7)}.hero.is-light .nav-item a:not(.button).is-active,.hero.is-light .nav-item a:not(.button):hover,.hero.is-light a.nav-item.is-active,.hero.is-light a.nav-item:hover{color:#363636}.hero.is-light .tabs a{color:#363636;opacity:.9}.hero.is-light .tabs a:hover{opacity:1}.hero.is-light .tabs li.is-active a{opacity:1}.hero.is-light .tabs.is-boxed a,.hero.is-light .tabs.is-toggle a{color:#363636}.hero.is-light .tabs.is-boxed a:hover,.hero.is-light .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-light .tabs.is-boxed li.is-active a,.hero.is-light .tabs.is-boxed li.is-active a:hover,.hero.is-light .tabs.is-toggle li.is-active a,.hero.is-light .tabs.is-toggle li.is-active a:hover{background-color:#363636;border-color:#363636;color:#f5f5f5}.hero.is-light.is-bold{background-image:linear-gradient(141deg,#dfd8d9 0,#f5f5f5 71%,#fff 100%)}@media screen and (max-width:768px){.hero.is-light.is-bold .nav-menu{background-image:linear-gradient(141deg,#dfd8d9 0,#f5f5f5 71%,#fff 100%)}}@media screen and (max-width:768px){.hero.is-light .nav-toggle span{background-color:#363636}.hero.is-light .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-light .nav-toggle.is-active span{background-color:#363636}.hero.is-light .nav-menu .nav-item{border-top-color:rgba(54,54,54,.2)}}.hero.is-dark{background-color:#363636;color:#f5f5f5}.hero.is-dark a:not(.button),.hero.is-dark strong{color:inherit}.hero.is-dark .title{color:#f5f5f5}.hero.is-dark .subtitle{color:rgba(245,245,245,.9)}.hero.is-dark .subtitle a:not(.button),.hero.is-dark .subtitle strong{color:#f5f5f5}.hero.is-dark .nav{-webkit-box-shadow:0 1px 0 rgba(245,245,245,.2);box-shadow:0 1px 0 rgba(245,245,245,.2)}@media screen and (max-width:768px){.hero.is-dark .nav-menu{background-color:#363636}}.hero.is-dark .nav-item a:not(.button),.hero.is-dark a.nav-item{color:rgba(245,245,245,.7)}.hero.is-dark .nav-item a:not(.button).is-active,.hero.is-dark .nav-item a:not(.button):hover,.hero.is-dark a.nav-item.is-active,.hero.is-dark a.nav-item:hover{color:#f5f5f5}.hero.is-dark .tabs a{color:#f5f5f5;opacity:.9}.hero.is-dark .tabs a:hover{opacity:1}.hero.is-dark .tabs li.is-active a{opacity:1}.hero.is-dark .tabs.is-boxed a,.hero.is-dark .tabs.is-toggle a{color:#f5f5f5}.hero.is-dark .tabs.is-boxed a:hover,.hero.is-dark .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-dark .tabs.is-boxed li.is-active a,.hero.is-dark .tabs.is-boxed li.is-active a:hover,.hero.is-dark .tabs.is-toggle li.is-active a,.hero.is-dark .tabs.is-toggle li.is-active a:hover{background-color:#f5f5f5;border-color:#f5f5f5;color:#363636}.hero.is-dark.is-bold{background-image:linear-gradient(141deg,#1f191a 0,#363636 71%,#46403f 100%)}@media screen and (max-width:768px){.hero.is-dark.is-bold .nav-menu{background-image:linear-gradient(141deg,#1f191a 0,#363636 71%,#46403f 100%)}}@media screen and (max-width:768px){.hero.is-dark .nav-toggle span{background-color:#f5f5f5}.hero.is-dark .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-dark .nav-toggle.is-active span{background-color:#f5f5f5}.hero.is-dark .nav-menu .nav-item{border-top-color:rgba(245,245,245,.2)}}.hero.is-primary{background-color:#00d1b2;color:#fff}.hero.is-primary a:not(.button),.hero.is-primary strong{color:inherit}.hero.is-primary .title{color:#fff}.hero.is-primary .subtitle{color:rgba(255,255,255,.9)}.hero.is-primary .subtitle a:not(.button),.hero.is-primary .subtitle strong{color:#fff}.hero.is-primary .nav{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.2)}@media screen and (max-width:768px){.hero.is-primary .nav-menu{background-color:#00d1b2}}.hero.is-primary .nav-item a:not(.button),.hero.is-primary a.nav-item{color:rgba(255,255,255,.7)}.hero.is-primary .nav-item a:not(.button).is-active,.hero.is-primary .nav-item a:not(.button):hover,.hero.is-primary a.nav-item.is-active,.hero.is-primary a.nav-item:hover{color:#fff}.hero.is-primary .tabs a{color:#fff;opacity:.9}.hero.is-primary .tabs a:hover{opacity:1}.hero.is-primary .tabs li.is-active a{opacity:1}.hero.is-primary .tabs.is-boxed a,.hero.is-primary .tabs.is-toggle a{color:#fff}.hero.is-primary .tabs.is-boxed a:hover,.hero.is-primary .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-primary .tabs.is-boxed li.is-active a,.hero.is-primary .tabs.is-boxed li.is-active a:hover,.hero.is-primary .tabs.is-toggle li.is-active a,.hero.is-primary .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#00d1b2}.hero.is-primary.is-bold{background-image:linear-gradient(141deg,#009e6c 0,#00d1b2 71%,#00e7eb 100%)}@media screen and (max-width:768px){.hero.is-primary.is-bold .nav-menu{background-image:linear-gradient(141deg,#009e6c 0,#00d1b2 71%,#00e7eb 100%)}}@media screen and (max-width:768px){.hero.is-primary .nav-toggle span{background-color:#fff}.hero.is-primary .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-primary .nav-toggle.is-active span{background-color:#fff}.hero.is-primary .nav-menu .nav-item{border-top-color:rgba(255,255,255,.2)}}.hero.is-info{background-color:#3273dc;color:#fff}.hero.is-info a:not(.button),.hero.is-info strong{color:inherit}.hero.is-info .title{color:#fff}.hero.is-info .subtitle{color:rgba(255,255,255,.9)}.hero.is-info .subtitle a:not(.button),.hero.is-info .subtitle strong{color:#fff}.hero.is-info .nav{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.2)}@media screen and (max-width:768px){.hero.is-info .nav-menu{background-color:#3273dc}}.hero.is-info .nav-item a:not(.button),.hero.is-info a.nav-item{color:rgba(255,255,255,.7)}.hero.is-info .nav-item a:not(.button).is-active,.hero.is-info .nav-item a:not(.button):hover,.hero.is-info a.nav-item.is-active,.hero.is-info a.nav-item:hover{color:#fff}.hero.is-info .tabs a{color:#fff;opacity:.9}.hero.is-info .tabs a:hover{opacity:1}.hero.is-info .tabs li.is-active a{opacity:1}.hero.is-info .tabs.is-boxed a,.hero.is-info .tabs.is-toggle a{color:#fff}.hero.is-info .tabs.is-boxed a:hover,.hero.is-info .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-info .tabs.is-boxed li.is-active a,.hero.is-info .tabs.is-boxed li.is-active a:hover,.hero.is-info .tabs.is-toggle li.is-active a,.hero.is-info .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#3273dc}.hero.is-info.is-bold{background-image:linear-gradient(141deg,#1577c6 0,#3273dc 71%,#4366e5 100%)}@media screen and (max-width:768px){.hero.is-info.is-bold .nav-menu{background-image:linear-gradient(141deg,#1577c6 0,#3273dc 71%,#4366e5 100%)}}@media screen and (max-width:768px){.hero.is-info .nav-toggle span{background-color:#fff}.hero.is-info .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-info .nav-toggle.is-active span{background-color:#fff}.hero.is-info .nav-menu .nav-item{border-top-color:rgba(255,255,255,.2)}}.hero.is-success{background-color:#23d160;color:#fff}.hero.is-success a:not(.button),.hero.is-success strong{color:inherit}.hero.is-success .title{color:#fff}.hero.is-success .subtitle{color:rgba(255,255,255,.9)}.hero.is-success .subtitle a:not(.button),.hero.is-success .subtitle strong{color:#fff}.hero.is-success .nav{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.2)}@media screen and (max-width:768px){.hero.is-success .nav-menu{background-color:#23d160}}.hero.is-success .nav-item a:not(.button),.hero.is-success a.nav-item{color:rgba(255,255,255,.7)}.hero.is-success .nav-item a:not(.button).is-active,.hero.is-success .nav-item a:not(.button):hover,.hero.is-success a.nav-item.is-active,.hero.is-success a.nav-item:hover{color:#fff}.hero.is-success .tabs a{color:#fff;opacity:.9}.hero.is-success .tabs a:hover{opacity:1}.hero.is-success .tabs li.is-active a{opacity:1}.hero.is-success .tabs.is-boxed a,.hero.is-success .tabs.is-toggle a{color:#fff}.hero.is-success .tabs.is-boxed a:hover,.hero.is-success .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-success .tabs.is-boxed li.is-active a,.hero.is-success .tabs.is-boxed li.is-active a:hover,.hero.is-success .tabs.is-toggle li.is-active a,.hero.is-success .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#23d160}.hero.is-success.is-bold{background-image:linear-gradient(141deg,#12af2f 0,#23d160 71%,#2ce28a 100%)}@media screen and (max-width:768px){.hero.is-success.is-bold .nav-menu{background-image:linear-gradient(141deg,#12af2f 0,#23d160 71%,#2ce28a 100%)}}@media screen and (max-width:768px){.hero.is-success .nav-toggle span{background-color:#fff}.hero.is-success .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-success .nav-toggle.is-active span{background-color:#fff}.hero.is-success .nav-menu .nav-item{border-top-color:rgba(255,255,255,.2)}}.hero.is-warning{background-color:#ffdd57;color:rgba(0,0,0,.7)}.hero.is-warning a:not(.button),.hero.is-warning strong{color:inherit}.hero.is-warning .title{color:rgba(0,0,0,.7)}.hero.is-warning .subtitle{color:rgba(0,0,0,.9)}.hero.is-warning .subtitle a:not(.button),.hero.is-warning .subtitle strong{color:rgba(0,0,0,.7)}.hero.is-warning .nav{-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2);box-shadow:0 1px 0 rgba(0,0,0,.2)}@media screen and (max-width:768px){.hero.is-warning .nav-menu{background-color:#ffdd57}}.hero.is-warning .nav-item a:not(.button),.hero.is-warning a.nav-item{color:rgba(0,0,0,.7)}.hero.is-warning .nav-item a:not(.button).is-active,.hero.is-warning .nav-item a:not(.button):hover,.hero.is-warning a.nav-item.is-active,.hero.is-warning a.nav-item:hover{color:rgba(0,0,0,.7)}.hero.is-warning .tabs a{color:rgba(0,0,0,.7);opacity:.9}.hero.is-warning .tabs a:hover{opacity:1}.hero.is-warning .tabs li.is-active a{opacity:1}.hero.is-warning .tabs.is-boxed a,.hero.is-warning .tabs.is-toggle a{color:rgba(0,0,0,.7)}.hero.is-warning .tabs.is-boxed a:hover,.hero.is-warning .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-warning .tabs.is-boxed li.is-active a,.hero.is-warning .tabs.is-boxed li.is-active a:hover,.hero.is-warning .tabs.is-toggle li.is-active a,.hero.is-warning .tabs.is-toggle li.is-active a:hover{background-color:rgba(0,0,0,.7);border-color:rgba(0,0,0,.7);color:#ffdd57}.hero.is-warning.is-bold{background-image:linear-gradient(141deg,#ffaf24 0,#ffdd57 71%,#fffa70 100%)}@media screen and (max-width:768px){.hero.is-warning.is-bold .nav-menu{background-image:linear-gradient(141deg,#ffaf24 0,#ffdd57 71%,#fffa70 100%)}}@media screen and (max-width:768px){.hero.is-warning .nav-toggle span{background-color:rgba(0,0,0,.7)}.hero.is-warning .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-warning .nav-toggle.is-active span{background-color:rgba(0,0,0,.7)}.hero.is-warning .nav-menu .nav-item{border-top-color:rgba(0,0,0,.2)}}.hero.is-danger{background-color:#ff3860;color:#fff}.hero.is-danger a:not(.button),.hero.is-danger strong{color:inherit}.hero.is-danger .title{color:#fff}.hero.is-danger .subtitle{color:rgba(255,255,255,.9)}.hero.is-danger .subtitle a:not(.button),.hero.is-danger .subtitle strong{color:#fff}.hero.is-danger .nav{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.2)}@media screen and (max-width:768px){.hero.is-danger .nav-menu{background-color:#ff3860}}.hero.is-danger .nav-item a:not(.button),.hero.is-danger a.nav-item{color:rgba(255,255,255,.7)}.hero.is-danger .nav-item a:not(.button).is-active,.hero.is-danger .nav-item a:not(.button):hover,.hero.is-danger a.nav-item.is-active,.hero.is-danger a.nav-item:hover{color:#fff}.hero.is-danger .tabs a{color:#fff;opacity:.9}.hero.is-danger .tabs a:hover{opacity:1}.hero.is-danger .tabs li.is-active a{opacity:1}.hero.is-danger .tabs.is-boxed a,.hero.is-danger .tabs.is-toggle a{color:#fff}.hero.is-danger .tabs.is-boxed a:hover,.hero.is-danger .tabs.is-toggle a:hover{background-color:rgba(10,10,10,.1)}.hero.is-danger .tabs.is-boxed li.is-active a,.hero.is-danger .tabs.is-boxed li.is-active a:hover,.hero.is-danger .tabs.is-toggle li.is-active a,.hero.is-danger .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#ff3860}.hero.is-danger.is-bold{background-image:linear-gradient(141deg,#ff0561 0,#ff3860 71%,#ff5257 100%)}@media screen and (max-width:768px){.hero.is-danger.is-bold .nav-menu{background-image:linear-gradient(141deg,#ff0561 0,#ff3860 71%,#ff5257 100%)}}@media screen and (max-width:768px){.hero.is-danger .nav-toggle span{background-color:#fff}.hero.is-danger .nav-toggle:hover{background-color:rgba(10,10,10,.1)}.hero.is-danger .nav-toggle.is-active span{background-color:#fff}.hero.is-danger .nav-menu .nav-item{border-top-color:rgba(255,255,255,.2)}}@media screen and (min-width:769px),print{.hero.is-medium .hero-body{padding-bottom:9rem;padding-top:9rem}}@media screen and (min-width:769px),print{.hero.is-large .hero-body{padding-bottom:18rem;padding-top:18rem}}.hero.is-fullheight .hero-body,.hero.is-halfheight .hero-body{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.hero.is-fullheight .hero-body>.container,.hero.is-halfheight .hero-body>.container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.hero.is-halfheight{min-height:50vh}.hero.is-fullheight{min-height:100vh}.section{background-color:#fff;padding:3rem 1.5rem}@media screen and (min-width:1000px){.section.is-medium{padding:9rem 1.5rem}.section.is-large{padding:18rem 1.5rem}}.footer{background-color:#f5f5f5;padding:3rem 1.5rem 6rem}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid #000;border-radius:4px 4px 4px 4px;color:#000;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}html{overflow-y:auto}body{height:100vh}#simulator-tab-view{display:none}#editor-tab-view{overflow:hidden;width:100%}#asm-editor{width:100%;height:88vh;max-height:88vh;font-family:Courier New,Courier,monospace}.section{padding:0 1.5rem}#mc-column{width:20%}#bc-column{width:30%}#oc-column{width:50%}#program-listing{font-family:Courier New,Courier,monospace}#program-listing-body{overflow:auto;height:100%}#program-listing-body tr.is-breakpoint{background-color:#ff3860;color:#fff}#program-listing-body tr.is-selected{background-color:#00d1b2;color:#fff}#program-listing-body tr{cursor:pointer}#program-listing-container{min-height:60vh;max-height:60vh;overflow-y:auto}#sidebar-listings-container{min-height:80vh;max-height:80vh;overflow-y:auto}#sidebar-listings-container>.panel{height:100%}#listing-panel{min-height:95%}#register-tab-view{font-family:Courier New,Courier,monospace}#memory-tab-view{display:none}#memory-table{font-family:Courier New,Courier,monospace;margin:auto}#memory-table th{text-align:center;vertical-align:middle}#memory-table td{text-align:center;vertical-align:middle}#console-output{height:100%}.tabs{margin-top:1em}#simulator-run.is-loading{pointer-events:auto}#register-tab-view .input{font-family:Courier New,Courier,monospace;border-width:2px}#register-tab-view .field.is-horizontal{width:100%}.input.is-modified{border-color:#3273dc}#addr-column{width:40%}.byte-column{width:15%}.panel-block>.field{width:100%}.stdout{font-weight:700;font-size:1.2em} \ No newline at end of file diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..36893e0 --- /dev/null +++ b/web/index.html @@ -0,0 +1,177 @@ + + + + ChocoPy Web IDE + + + + + + + + +

Compile Me!

+ + + + + +
+ + + + + +
+ + + + + + +

+
+
+
+  
+
diff --git a/web/js/ace.js b/web/js/ace.js
new file mode 100644
index 0000000..2693b6a
--- /dev/null
+++ b/web/js/ace.js
@@ -0,0 +1,17 @@
+(function(){function o(n){var i=e;n&&(e[n]||(e[n]={}),i=e[n]);if(!i.define||!i.define.packaged)t.original=i.define,i.define=t,i.define.packaged=!0;if(!i.require||!i.require.packaged)r.original=i.require,i.require=r,i.require.packaged=!0}var ACE_NAMESPACE="",e=function(){return this}();!e&&typeof window!="undefined"&&(e=window);if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)};t.modules={},t.payloads={};var n=function(e,t,n){if(typeof t=="string"){var i=s(e,t);if(i!=undefined)return n&&n(),i}else if(Object.prototype.toString.call(t)==="[object Array]"){var o=[];for(var u=0,a=t.length;u1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;et.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=i.match(/ Gecko\/\d+/),t.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",t.isWebKit=parseFloat(i.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(i.split(" Chrome/")[1])||undefined,t.isEdge=parseFloat(i.split(" Edge/")[1])||undefined,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isIPad=i.indexOf("iPad")>=0,t.isAndroid=i.indexOf("Android")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(i)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIPad||t.isAndroid}),define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent"),i="http://www.w3.org/1999/xhtml";t.buildDom=function o(e,t,n){if(typeof e=="string"&&e){var r=document.createTextNode(e);return t&&t.appendChild(r),r}if(!Array.isArray(e))return e;if(typeof e[0]!="string"||!e[0]){var i=[];for(var s=0;s=1.5:!0;if(typeof document!="undefined"){var s=document.createElement("div");t.HI_DPI&&s.style.transform!==undefined&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&typeof s.style.animationName!="undefined"&&(t.HAS_CSS_ANIMATION=!0),s=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,"super":8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},t,n;for(n in e.FUNCTION_KEYS)t=e.FUNCTION_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);for(n in e.PRINTABLE_KEYS)t=e.PRINTABLE_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);return r.mixin(e,e.MODIFIER_KEYS),r.mixin(e,e.PRINTABLE_KEYS),r.mixin(e,e.FUNCTION_KEYS),e.enter=e["return"],e.escape=e.esc,e.del=e["delete"],e[173]="-",function(){var t=["cmd","ctrl","alt","shift"];for(var n=Math.pow(2,t.length);n--;)e.KEY_MODS[n]=t.filter(function(t){return n&e.KEY_MODS[t]}).join("-")+"-"}(),e.KEY_MODS[0]="",e.KEY_MODS[-1]="input-",e}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return typeof t!="string"&&(t=String.fromCharCode(e)),t.toLowerCase()}}),define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function a(e,t,n){var a=u(t);if(!i.isMac&&s){t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(a|=8);if(s.altGr){if((3&a)==3)return;s.altGr=0}if(n===18||n===17){var f="location"in t?t.location:t.keyLocation;if(n===17&&f===1)s[n]==1&&(o=t.timeStamp);else if(n===18&&a===3&&f===2){var l=t.timeStamp-o;l<50&&(s.altGr=!0)}}}n in r.MODIFIER_KEYS&&(n=-1),a&8&&n>=91&&n<=93&&(n=-1);if(!a&&n===13){var f="location"in t?t.location:t.keyLocation;if(f===3){e(t,a,-n);if(t.defaultPrevented)return}}if(i.isChromeOS&&a&8){e(t,a,n);if(t.defaultPrevented)return;a&=-9}return!!a||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,a,n):!1}function f(){s=Object.create(null)}var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addTouchMoveListener=function(e,n){var r,i;t.addListener(e,"touchstart",function(e){var t=e.touches,n=t[0];r=n.clientX,i=n.clientY}),t.addListener(e,"touchmove",function(e){var t=e.touches;if(t.length>1)return;var s=t[0];e.wheelX=r-s.clientX,e.wheelY=i-s.clientY,r=s.clientX,i=s.clientY,n(e)})},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5,e.wheelY=(e.deltaY||0)*5}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=(e.detail||0)*5,e.wheelY=0):(e.wheelX=0,e.wheelY=(e.detail||0)*5),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){function c(e){t.getButton(e)!==0?o=0:e.detail>1?(o++,o>4&&(o=1)):o=1;if(i.isIE){var c=Math.abs(e.clientX-u)>5||Math.abs(e.clientY-a)>5;if(!f||c)o=1;f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),o==1&&(u=e.clientX,a=e.clientY)}e._clicks=o,r[s]("mousedown",e);if(o>4)o=0;else if(o>1)return r[s](l[o],e)}function h(e){o=2,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),r[s]("mousedown",e),r[s](l[o],e)}var o=0,u,a,f,l={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",c),i.isOldIE&&t.addListener(e,"dblclick",h)})};var u=!i.isMac||!i.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};t.getModifierString=function(e){return r.KEY_MODS[u(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return a(n,e,o)})}else{var u=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=a(n,e,e.keyCode);return u=e.defaultPrevented,t}),r(e,"keypress",function(e){u&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),u=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(f(),r(window,"focus",f))}};if(typeof window=="object"&&window.postMessage&&!i.isOldIE){var l=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+l++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function r(){t.$idleBlocked?setTimeout(r,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n63,l=400,c=e("../lib/keys"),h=c.KEY_MODS,p=i.isIOS,d=p?/\s/:/\n/,v=function(e,t){function W(){x=!0,n.blur(),n.focus(),x=!1}function V(e){e.keyCode==27&&n.value.lengthC&&T[s]=="\n")o=c.end;else if(rC&&T.slice(0,s).split("\n").length>2)o=c.down;else if(s>C&&T[s-1]==" ")o=c.right,u=h.option;else if(s>C||s==C&&C!=N&&r==s)o=c.right;r!==s&&(u|=h.shift),o&&(t.onCommandKey(null,u,o),N=r,C=s,A(""))};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var v=!1,m=!1,g=!1,y=!1,b="",w=!0,E=!1;i.isMobile||(n.style.fontSize="1px");var S=!1,x=!1,T="",N=0,C=0;try{var k=document.activeElement===n}catch(L){}r.addListener(n,"blur",function(e){if(x)return;t.onBlur(e),k=!1}),r.addListener(n,"focus",function(e){if(x)return;k=!0;if(i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(A):A()}),this.$focusScroll=!1,this.focus=function(){if(b||f||this.$focusScroll=="browser")return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=n.getBoundingClientRect().top!=0}catch(r){return}var i=[];if(t){var s=n.parentElement;while(s&&s.nodeType==1)i.push(s),s.setAttribute("ace_nocontext",!0),!s.parentElement&&s.getRootNode?s=s.getRootNode().host:s=s.parentElement}n.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="",n.style.top=="0px"&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return k},t.on("beforeEndOperation",function(){if(t.curOp&&t.curOp.command.name=="insertstring")return;g&&(T=n.value="",z()),A()});var A=p?function(e){if(!k||v&&!e)return;e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=T=r);var i=4,s=4+(e.length||(t.selection.isEmpty()?0:1));(N!=i||C!=s)&&n.setSelectionRange(i,s),N=i,C=s}:function(){if(g||y)return;if(!k&&!D)return;g=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,u=t.session.getLine(i);if(r.start.row!=i){var a=t.session.getLine(i-1);s=r.start.rowi+1?f.length:o,o+=u.length+1,u=u+"\n"+f}u.length>l&&(s=T.length&&e.value===T&&T&&e.selectionEnd!==C},M=function(e){if(g)return;v?v=!1:O(n)&&(t.selectAll(),A())},_=null;this.setInputHandler=function(e){_=e},this.getInputHandler=function(){return _};var D=!1,P=function(e,r){D&&(D=!1);if(m)return A(),e&&t.onPaste(e),m=!1,"";var i=n.selectionStart,s=n.selectionEnd,o=N,u=T.length-C,a=e,f=e.length-i,l=e.length-s,c=0;while(o>0&&T[c]==e[c])c++,o--;a=a.slice(c),c=1;while(u>0&&T.length-c>N-1&&T[T.length-c]==e[e.length-c])c++,u--;return f-=c-1,l-=c-1,a=a.slice(0,a.length-c+1),!r&&f==a.length&&!o&&!u&&!l?"":(y=!0,a&&!o&&!u&&!f&&!l||S?t.onTextInput(a):t.onTextInput(a,{extendLeft:o,extendRight:u,restoreStart:f,restoreEnd:l}),y=!1,T=e,N=i,C=s,a)},H=function(e){if(g)return U();var t=n.value,r=P(t,!0);(t.length>l+100||d.test(r))&&A()},B=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(!r||u)return;var i=a||n?"Text":"text/plain";try{return t?r.setData(i,t)!==!1:r.getData(i)}catch(e){if(!n)return B(e,t,!0)}},j=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);B(e,s)?(p&&(A(s),v=s,setTimeout(function(){v=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(v=!0,n.value=s,n.select(),setTimeout(function(){v=!1,A(),i?t.onCut():t.onCopy()}))},F=function(e){j(e,!0)},I=function(e){j(e,!1)},q=function(e){var s=B(e);typeof s=="string"?(s&&t.onPaste(s,e),i.isIE&&setTimeout(A),r.preventDefault(e)):(n.value="",m=!0)};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",M),r.addListener(n,"input",H),r.addListener(n,"cut",F),r.addListener(n,"copy",I),r.addListener(n,"paste",q),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(i.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:I(e);break;case 86:q(e);break;case 88:F(e)}});var R=function(e){if(g||!t.onCompositionStart||t.$readOnly)return;g={};if(S)return;setTimeout(U,0),t.on("mousedown",W);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,g.markerRange=r,g.selectionStart=N,t.onCompositionStart(g),g.useTextareaForIME?(n.value="",T="",N=0,C=0):(n.msGetInputContext&&(g.context=n.msGetInputContext()),n.getInputContext&&(g.context=n.getInputContext()))},U=function(){if(!g||!t.onCompositionUpdate||t.$readOnly)return;if(S)return W();if(g.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;P(e),g.markerRange&&(g.context&&(g.markerRange.start.column=g.selectionStart=g.context.compositionStartOffset),g.markerRange.end.column=g.markerRange.start.column+C-g.selectionStart)}},z=function(e){if(!t.onCompositionEnd||t.$readOnly)return;g=!1,t.onCompositionEnd(),t.off("mousedown",W),e&&H()},X=o.delayedCall(U,50).schedule.bind(null,null);r.addListener(n,"compositionstart",R),r.addListener(n,"compositionupdate",U),r.addListener(n,"keyup",V),r.addListener(n,"keydown",X),r.addListener(n,"compositionend",z),this.getElement=function(){return n},this.setCommandMode=function(e){S=e,n.readOnly=!1},this.setReadOnly=function(e){S||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){E=e},this.onContextMenu=function(e){D=!0,A(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){b||(b=n.style.cssText),n.style.cssText=(o?"z-index:100000;":"")+(i.isIE?"opacity:0.1;":"")+"text-indent: -"+(N+C)*t.renderer.characterWidth*.5+"px;";var u=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),f=u.top+(parseInt(a.borderTopWidth)||0),l=u.left+(parseInt(u.borderLeftWidth)||0),c=u.bottom-f-n.clientHeight-2,h=function(e){n.style.left=e.clientX-l-2+"px",n.style.top=Math.min(e.clientY-f-2,c)+"px"};h(e);if(e.type!="mousedown")return;t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout($),i.isWin&&r.capture(t.container,h,J)},this.onContextMenuClose=J;var $,K=function(e){t.textInput.onContextMenu(e),J()};r.addListener(n,"mouseup",K),r.addListener(n,"mousedown",function(e){e.preventDefault(),J()}),r.addListener(t.renderer.scroller,"contextmenu",K),r.addListener(n,"contextmenu",K),p&&Q(e,t,n)};t.TextInput=v}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),t.setDefaultHandler("touchmove",this.onTouchMove.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=t.column-4;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),i=0,s=550;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(s!==0){var o=i.getSelectionRange(),u=o.isEmpty();(u||s==1)&&i.selection.moveToPosition(n),s==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}this.mousedownEvent.time=Date.now();if(t&&!i.isFocused()){i.focus();if(this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode){this.setState("focusWait"),this.captureMouse(e);return}}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;if(!this.mousedownEvent)return;this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=a(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=a(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>i||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,u=i?e.wheelY/i:n.vy;i=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(f=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(f=!0);if(f)n.allowed=r;else if(r-n.allowedt.session.documentToScreenRow(l.row,l.column))return c()}if(f==s)return;f=s.text.join("
"),i.setHtml(f),i.show(),t._signal("showGutterTooltip",i),t.on("mousewheel",c);if(e.$tooltipFollowsMouse)h(u);else{var p=u.domEvent.target,d=p.getBoundingClientRect(),v=i.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}}function c(){o&&(o=clearTimeout(o)),f&&(i.hide(),f=null,t._signal("hideGutterTooltip",i),t.removeEventListener("mousewheel",c))}function h(e){i.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,i=new a(t.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var o,u,f;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();f&&e.$tooltipFollowsMouse&&h(t),u=t;if(o)return;o=setTimeout(function(){o=null,u&&!e.isMousePressed?l():c()},50)}),s.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!f||o)return;o=setTimeout(function(){o=null,c()},50)}),t.on("changeSession",c)}function a(e){o.call(this,e)}var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=u}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.moveCursorToPosition(e),S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.selection.fromOrientedRange(m),t.isFocused()&&!w&&t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e)),i.addListener(c,"dragend",this.onDragEnd.bind(e)),i.addListener(c,"dragenter",this.onDragEnter.bind(e)),i.addListener(c,"dragover",this.onDragOver.bind(e)),i.addListener(c,"dragleave",this.onDragLeave.bind(e)),i.addListener(c,"drop",this.onDrop.bind(e));var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement("script");i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){if(n||!i.readyState||i.readyState=="loaded"||i.readyState=="complete")i=i.onload=i.onreadystatechange=null,n||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o1&&(i=n[n.length-2]);var o=a[t+"Path"];return o==null?o=a.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i&&!t.$loading[n])return r&&r(i);t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r);if(t.$loading[n].length>1)return;var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),f()};var f=function(){!a.basePath&&!a.workerPath&&!a.modePath&&!a.themePath&&!Object.keys(a.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),f=function(){})};t.init=l}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,f=e("../config"),l=function(e){var t=this;this.editor=e,new s(this),new o(this),new a(this);var n=function(t){var n=!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement());n&&window.focus(),e.focus()},u=e.renderer.getMouseEventTarget();r.addListener(u,"click",this.onMouseEvent.bind(this,"click")),r.addListener(u,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener([u,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),r.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var f=e.renderer.$gutter;r.addListener(f,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(f,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(f,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(f,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),r.addListener(u,"mousedown",n),r.addListener(f,"mousedown",n),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",n),r.addListener(e.renderer.scrollBarH.element,"mousedown",n)),e.on("mousemove",function(n){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),s=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?s.setCursorStyle("default"):s.setCursorStyle("")})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.onTouchMove=function(e,t){var n=new u(t,this.editor);n.speed=1,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,s=this.editor.renderer;s.$keepTextAreaAtCursor&&(s.$keepTextAreaAtCursor=null);var o=this,a=function(e){if(!e)return;if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new u(e,o.editor),o.$mouseMoved=!0},f=function(e){n.off("beforeEndOperation",c),clearInterval(h),l(),o[o.state+"End"]&&o[o.state+"End"](e),o.state="",s.$keepTextAreaAtCursor==null&&(s.$keepTextAreaAtCursor=!0,s.$moveTextAreaToCursor()),o.isMousePressed=!1,o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent("mouseup",e),n.endOperation()},l=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1};if(i.isOldIE&&e.domEvent.type=="dblclick")return setTimeout(function(){f(e)});var c=function(e){if(!o.releaseMouse)return;n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+"End"]&&o[o.state+"End"](),o.state="",o.releaseMouse())};n.on("beforeEndOperation",c),n.startOperation({command:{name:"mouse"}}),o.$onCaptureMouseMove=a,o.releaseMouse=r.capture(this.editor.container,a,f);var h=setInterval(l,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(l.prototype),f.defineOptions(l.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=l}),define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";function i(e){e.on("click",function(t){var n=t.getDocumentPosition(),i=e.session,s=i.getFoldAt(n.row,n.column,1);s&&(t.getAccelKey()?i.removeFold(s):i.expandFold(s),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,"ace_inline_button")&&r.hasCssClass(o,"ace_toggle_wrap")&&(i.setOption("wrap",!0),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),o=s.range||s.firstRange;if(o){r=o.start.row;var u=i.getFoldAt(r,i.getLine(r).length,1);u?i.removeFold(u):(i.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}var r=e("../lib/dom");t.FoldHandler=i}),define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;typeof e=="function"&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=!0:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&s.passEvent!=1&&s.command.passEvent!=1&&i.stopEvent(r);if(o)break}return!o&&e==-1&&(s={command:"insertstring"},o=u.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(s.prototype),t.KeyBinding=s}),define("ace/lib/bidiutil",["require","exports","module"],function(e,t,n){"use strict";function F(e,t,n,r){var i=s?d:p,c=null,h=null,v=null,m=0,g=null,y=null,b=-1,w=null,E=null,T=[];if(!r)for(w=0,r=[];w0)if(g==16){for(w=b;w-1){for(w=b;w=0;C--){if(r[C]!=N)break;t[C]=s}}}function I(e,t,n){if(o=e){u=i+1;while(u=e)u++;for(a=i,l=u-1;a=t.length||(o=n[r-1])!=b&&o!=w||(c=t[r+1])!=b&&c!=w)return E;return u&&(c=w),c==o?c:E;case k:o=r>0?n[r-1]:S;if(o==b&&r+10&&n[r-1]==b)return b;if(u)return E;p=r+1,h=t.length;while(p=1425&&d<=2303||d==64286;o=t[p];if(v&&(o==y||o==T))return y}if(r<1||(o=t[r-1])==S)return E;return n[r-1];case S:return u=!1,f=!0,s;case x:return l=!0,E;case O:case M:case D:case P:case _:u=!1;case H:return E}}function R(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?g:B[t]:n==5?/[\u0591-\u05f4]/.test(e)?y:g:n==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?w:t==1642?L:/[\u06f0-\u06f9]/.test(e)?b:T:n==32&&t<=8287?j[t&255]:n==254?t>=65136?T:E:E}function U(e){return e>="\u064b"&&e<="\u0655"}var r=["\u0621","\u0641"],i=["\u063a","\u064a"],s=0,o=0,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v=0,m=1,g=0,y=1,b=2,w=3,E=4,S=5,x=6,T=7,N=8,C=9,k=10,L=11,A=12,O=13,M=14,_=15,D=16,P=17,H=18,B=[H,H,H,H,H,H,H,H,H,x,S,x,N,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,S,S,S,x,N,E,E,L,L,L,E,E,E,E,E,k,C,k,C,C,b,b,b,b,b,b,b,b,b,b,C,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,H,H,H,H,H,H,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,C,E,L,L,L,L,E,E,E,E,g,E,E,H,E,E,L,L,b,b,E,g,E,E,E,b,g,E,E,E,E,E],j=[N,N,N,N,N,N,N,N,N,N,N,H,H,H,g,y,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N,S,O,M,_,D,P,C,L,L,L,L,L,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,C,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N];t.L=g,t.R=y,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\u00b7",t.doBidiReorder=function(e,n,r){if(e.length<2)return{};var i=e.split(""),o=new Array(i.length),u=new Array(i.length),a=[];s=r?m:v,F(i,a,i.length,n);for(var f=0;fT&&n[f]0&&i[f-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(i[f])&&(a[f-1]=a[f]=t.R_H,f++);i[i.length-1]===t.DOT&&(a[i.length-1]=t.B),i[0]==="\u202b"&&(a[0]=t.RLE);for(var f=0;f=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n,r=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){n=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(n!==r)break;r=n,e++}}else e=this.currentRow;return e},this.updateRowLine=function(e,t){e===undefined&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1,s=n?this.EOF:this.EOL;this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(t===undefined&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!==0&&i++;for(var u=0;ut&&s[i]%2===0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,s=[],o=0,u=Math.min(e,t)-this.wrapIndent,a=Math.max(e,t)-this.wrapIndent,f=!1,l=!1,c=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p=u&&hn+s/2){n+=s;if(r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!==0&&i[r]%2===0?(e0&&i[r-1]%2===0&&i[r]%2!==0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&s===0&&i[r-1]%2===0||!this.isRtlDir&&r===0&&i[r]%2!==0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!==0&&s!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t));if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(s)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t=0,n,r=/\s/,i=this.session.tokenRe;i.lastIndex=0;if(this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{while((n=e[t])&&r.test(n))t++;if(t<1){i.lastIndex=0;while((n=e[t])&&!i.test(n)){i.lastIndex=0,t++;if(r.test(n)){if(t>2){t--;break}while((n=e[t])&&r.test(n))t++;if(t>2)break}}}}return i.lastIndex=0,t},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var i=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(u.prototype),t.Selection=u}),define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=e|0},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;il){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;yi){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:f,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c={'"':'"',"'":"'"},h=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},d=function(e){this.add("braces","insertion",function(t,n,r,i,s){var u=r.getCursorPosition(),a=i.doc.getLine(u.row);if(s=="{"){h(r);var l=r.getSelectionRange(),c=i.doc.getTextRange(l);if(c!==""&&c!=="{"&&r.getWrapBehavioursEnabled())return p(l,c,"{","}");if(d.isSaneInsertion(r,i))return/[\]\}\)]/.test(a[u.column])||r.inMultiSelectMode||e&&e.braces?(d.recordAutoInsert(r,i,"}"),{text:"{}",selection:[1,1]}):(d.recordMaybeInsert(r,i,"{"),{text:"{",selection:[1,1]})}else if(s=="}"){h(r);var v=a.substring(u.column,u.column+1);if(v=="}"){var m=i.$findOpeningBracket("}",{column:u.column+1,row:u.row});if(m!==null&&d.isAutoInsertedClosing(u,a,s))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(s=="\n"||s=="\r\n"){h(r);var g="";d.isMaybeInsertedClosing(u,a)&&(g=o.stringRepeat("}",f.maybeInsertedBrackets),d.clearMaybeInsertedClosing());var v=a.substring(u.column,u.column+1);if(v==="}"){var y=i.findMatchingBracket({row:u.row,column:u.column+1},"}");if(!y)return null;var b=this.$getIndent(i.getLine(y.row))}else{if(!g){d.clearMaybeInsertedClosing();return}var b=this.$getIndent(a)}var w=b+i.getTabString();return{text:"\n"+w+"\n"+b+g,selection:[1,w.length,1,w.length]}}d.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||c;if(i.length==1&&s[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;h(n);var o=i,u=n.getSelectionRange(),a=r.doc.getTextRange(u);if(a!==""&&(a.length!=1||!s[a])&&n.getWrapBehavioursEnabled())return p(u,a,o,o);if(!a){var f=n.getCursorPosition(),l=r.doc.getLine(f.row),d=l.substring(f.column-1,f.column),v=l.substring(f.column,f.column+1),m=r.getTokenAt(f.row,f.column),g=r.getTokenAt(f.row,f.column+1);if(d=="\\"&&m&&/escape/.test(m.type))return null;var y=m&&/string|escape/.test(m.type),b=!g||/string|escape/.test(g.type),w;if(v==o)w=y!==b,w&&/string\.end/.test(g.type)&&(w=!1);else{if(y&&!b)return null;if(y&&b)return null;var E=r.$mode.tokenRe;E.lastIndex=0;var S=E.test(d);E.lastIndex=0;var x=E.test(d);if(S||x)return null;if(v&&!/[\s;,.})\]\\]/.test(v))return null;w=!0}return{text:w?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||c,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)){h(n);var u=r.doc.getLine(i.start.row),a=u.substring(i.start.column+1,i.start.column+2);if(a==o)return i.end.column++,i}})};d.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},d.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},d.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},d.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},d.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},d.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},d.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},d.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(d,i),t.CstyleBehaviour=d}),define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[];for(var o=0;o2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(ne.length&&(E=e.length)}),u==Infinity&&(u=E,s=!1,o=!1),l&&u%f!=0&&(u=Math.floor(u/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new f(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,a=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new l(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new f(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new l(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);a.start.row==c&&(a.start.column+=h),a.end.row==c&&(a.end.column+=h),t.selection.fromOrientedRange(a)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var t=0;t=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var r=n?e.column<=t.column:e.columnthis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column;for(var o=0,u=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action=="remove")this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},this.update=function(e,t,n,i){if(!this.regExp)return;var o=i.firstRow,u=i.lastRow;for(var a=o;a<=u;a++){var f=this.cache[a];f==null&&(f=r.getMatchOffsets(n.getLine(a),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new s(a,e.offset,a,e.offset+e.length)}),this.cache[a]=f.length?f:"");for(var l=f.length;l--;)t.drawSingleLineMarker(e,f[l].toScreenRange(n),this.clazz,i)}}}).call(o.prototype),t.SearchHighlight=o}),define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var r=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f0)continue;var a=i(e,o.start);return u===0?t&&a!==0?-s-2:s:a>0||a===0&&!t?s:-s-1}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});var n=t[0],r;for(var s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if(e.action=="insert"){var f=i-r,l=-t.column+n.column;for(;or)break;a.start.row==r&&a.start.column>=t.column&&(a.start.column!=t.column||!this.$insertRight)&&(a.start.column+=l,a.start.row+=f);if(a.end.row==r&&a.end.column>=t.column){if(a.end.column==t.column&&this.$insertRight)continue;a.end.column==t.column&&l>0&&oa.start.column&&a.end.column==s[o+1].start.column&&(a.end.column-=l),a.end.column+=l,a.end.row+=f}}}else{var f=r-i,l=t.column-n.column;for(;oi)break;if(a.end.rowt.column)a.end.column=t.column,a.end.row=t.row}else a.end.column+=l,a.end.row+=f;else a.end.row>i&&(a.end.row+=f);if(a.start.rowt.column)a.start.column=t.column,a.start.row=t.row}else a.start.column+=l,a.start.row+=f;else a.start.row>i&&(a.start.row+=f)}}if(f!=0&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i=t){u=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:(o=new s(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column;if(u0&&(this.removeFolds(p),p.forEach(function(e){o.addSubFold(e)}));for(var d=0;d0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;e==null?(n=new r(0,0,this.getLength(),0),t=!0):typeof e=="number"?n=new r(e,0,e,this.getLine(e).length):"row"in e?n=r.fromPoints(e,e):n=e,i=this.getFoldsInRangeList(n);if(t)this.removeFolds(i);else{var s=i;while(s.length)this.expandFolds(s),s=this.getFoldsInRangeList(n)}if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row),i==null&&(i=0),t==null&&(t=e.end.row),n==null&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(tl)break}while(s&&a.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return f.end.row=i.getCurrentTokenRow(),f.end.column=i.getCurrentTokenColumn()+s.value.length-2,f}},this.foldAll=function(e,t,n){n==undefined&&(n=1e5);var r=this.foldWidgets;if(!r)return;t=t||this.getLength(),e=e||0;for(var i=e;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(u){}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e,e=="manual"&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)},this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};var r=e-1,i;while(r>=0){var s=n[r];s==null&&(s=n[r]=this.getFoldWidget(r));if(s=="start"){var o=this.getFoldWidgetRange(r);i||(i=o);if(o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},r=this.$toggleFoldWidget(e,n);if(!r){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var n=this.getFoldWidget(e),r=this.getLine(e),i=n==="end"?-1:1,s=this.getFoldAt(e,i===-1?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range))return this.removeFold(s),s}if(t.siblings){var u=this.getParentFoldRangeData(e);if(u.range)var a=u.range.start.row+1,f=u.range.end.row;this.foldAll(a,f,t.all?1e4:0)}else t.children?(f=o?o.end.row:this.getLength(),this.foldAll(e+1,f,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(n)return;var r=this.getParentFoldRangeData(t,!0);n=r.range||r.firstRange;if(n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action=="remove")this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=u}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}r.implement(this,u),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},this.setUndoManager=function(e){this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;ao){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action=="insert"||r.action=="remove"?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1},this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}s.end=this.insert(s.start,r);if(i.length){var a=e.start,f=s.start,o=f.row-a.row,u=f.column-a.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){var t=e.collapseRows(),n=new l(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var s=new l(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),u=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,u),o.length&&this.addFolds(o),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode")},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,u=o-s,a=null;this.$updating=!0;if(u!=0)if(n==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(s,u);var f=this.$foldData;a=this.getFoldsInRange(e),this.removeFolds(a);var l=this.getFoldLine(i.row),c=0;if(l){l.addRemoveChars(i.row,i.column,r.column-i.column),l.shiftRow(-u);var h=this.getFoldLine(s);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c=i.row&&l.shiftRow(-u)}o=s}else{var p=Array(u);p.unshift(s,0);var d=t?this.$wrapData:this.$rowLengthCache;d.splice.apply(d,p);var f=this.$foldData,l=this.getFoldLine(s),c=0;if(l){var v=l.range.compareInside(r.row,r.column);v==0?(l=l.split(r.row,r.column),l&&(l.shiftRow(u),l.addRemoveChars(o,0,i.column-r.column))):v==-1&&(l.addRemoveChars(s,0,i.column-r.column),l.shiftRow(u)),c=f.indexOf(l)+1}for(c;c=s&&l.shiftRow(u)}}else{u=Math.abs(e.start.column-e.end.column),n==="remove"&&(a=this.getFoldsInRange(e),this.removeFolds(a),u=-u);var l=this.getFoldLine(s);l&&l.addRemoveChars(s,r.column,u)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),a},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var r=this.doc.getAllLines(),i=this.getTabSize(),o=this.$wrapData,u=this.$wrapLimit,a,f,l=e;t=Math.min(t,r.length-1);while(l<=t)f=this.getFoldLine(l,f),f?(a=[],f.walk(function(e,t,i,o){var u;if(e!=null){u=this.$getDisplayTokens(e,a.length),u[0]=n;for(var f=1;fr-b){var w=f+r-b;if(e[w-1]>=c&&e[w]>=c){y(w);continue}if(e[w]==n||e[w]==s){for(w;w!=f-1;w--)if(e[w]==n)break;if(w>f){y(w);continue}w=f+r;for(w;w>2)),f-1);while(w>E&&e[w]E&&e[w]E&&e[w]==a)w--}else while(w>E&&e[w]E){y(++w);continue}w=f+r,e[w]==t&&w--,y(w-b)}return o},this.$getDisplayTokens=function(n,r){var i=[],s;r=r||0;for(var o=0;o39&&u<48||u>57&&u<64?i.push(a):u>=4352&&m(u)?i.push(e,t):i.push(e)}return i},this.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i=4352&&m(r)?n+=2:n+=1;if(n>t)break}return[n,i]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0)var u=f[l],i=this.$docRowCache[l],h=e>f[c-1];else var h=!c;var p=this.getLength()-1,d=this.getNextFoldLine(i),v=d?d.start.row:Infinity;while(u<=e){a=this.getRowLength(i);if(u+a>e||i>=p)break;u+=a,i++,i>v&&(i=d.end.row+1,d=this.getNextFoldLine(i,d),v=d?d.start.row:Infinity),h&&(this.$docRowCache.push(i),this.$screenRowCache.push(u))}if(d&&d.start.row<=i)r=this.getFoldDisplayLine(d),i=d.start.row;else{if(u+a<=e||i>p)return{row:p,column:this.getLine(p).length};r=this.getLine(i),d=null}var m=0,g=Math.floor(e-u);if(this.$useWrapMode){var y=this.$wrapData[i];y&&(o=y[g],g>0&&y.length&&(m=y.indent,s=y[g-1]||y[y.length-1],r=r.substring(s)))}return n!==undefined&&this.$bidiHandler.isBidiRow(u+g,i,g)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(r,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),d?d.idxToPosition(s):{row:i,column:s}},this.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);var v=0;if(this.$useWrapMode){var m=this.$wrapData[i];if(m){var g=0;while(d.length>=m[g])r++,g++;d=d.substring(m[g-1]||0,d.length),v=g>0?m.indent:0}}return{row:r,column:v+this.$getStringScreenWidth(d)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;ro&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(t,n,r){if(n===0)return[0,0];n||(n=Infinity),r=r||0;var i,s;for(s=0;sn)break}return[r,s]}},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=m}.call(d.prototype),e("./edit_session/folding").Folding.call(d.prototype),e("./edit_session/bracket_match").BracketMatch.call(d.prototype),o.defineOptions(d.prototype,"session",{wrap:{set:function(e){!e||e=="off"?e=!1:e=="free"?e=!0:e=="printMargin"?e=-1:typeof e=="string"&&(e=parseInt(e,10)||!1);if(this.$wrap==e)return;this.$wrap=e;if(!e)this.setUseWrapMode(!1);else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text",e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){if(isNaN(e)||this.$tabSize===e)return;this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize")},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=d}),define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";function u(e,t){function n(e){return/\w/.test(e)||t.regExp?"\\b":""}return n(e[0])+e+n(e[e.length-1])}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a,l;e:for(var c=u.offset||0;c<=f;c++){for(var h=0;hv)continue;o.push(l=new s(c,v,c+a-1,m)),a>2&&(c=c+a-2)}}else for(var g=0;gE&&o[h].end.row==n.end.row)h--;o=o.slice(g,h+1);for(g=0,h=o.length;g=u;n--)if(c(n,Number.MAX_VALUE,e))return;if(t.wrap==0)return;for(n=a,u=o.row;n>=u;n--)if(c(n,Number.MAX_VALUE,e))return};else var f=function(e){var n=o.row;if(c(n,o.column,e))return;for(n+=1;n<=a;n++)if(c(n,0,e))return;if(t.wrap==0)return;for(n=u,a=o.row;n<=a;n++)if(c(n,0,e))return};if(t.$isMultiLine)var l=n.length,c=function(t,i,s){var o=r?t-l+1:t;if(o<0)return;var u=e.getLine(o),a=u.search(n[0]);if(!r&&ai)return;if(s(o,a,o+l-1,c))return!0};else if(r)var c=function(t,r,i){var s=e.getLine(t),o=[],u,a=0;n.lastIndex=0;while(u=n.exec(s)){var f=u[0].length;a=u.index;if(!f){if(a>=s.length)break;n.lastIndex=a+=1}if(u.index+f>r)break;o.push(u.index,f)}for(var l=o.length-1;l>=0;l-=2){var c=o[l-1],f=o[l];if(i(t,c,t,c+f))return!0}};else var c=function(t,r,i){var s=e.getLine(t),o,u;n.lastIndex=r;while(u=n.exec(s)){var a=u[0].length;o=u.index;if(i(t,o,t,o+a))return!0;if(!a){n.lastIndex=o+=1;if(o>=s.length)return!1}}};return{forEach:f}}}).call(o.prototype),t.Search=o}),define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function u(e,t){o.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;u.prototype=o.prototype,function(){function e(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);o!=-1&&(s.splice(o,1),s.length==1&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){typeof e=="object"&&e&&(n==undefined&&(n=e.position),e=e[this.platform]);if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var r="";if(e.indexOf(" ")!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),u=s[o.hashId]+o.key;this._addCommandToBinding(r+u,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i=this.commandKeyBinding,s;if(!n)delete i[t];else if(!i[t]||this.$singleCommand)i[t]=n;else{Array.isArray(i[t])?(s=i[t].indexOf(n))!=-1&&i[t].splice(s,1):i[t]=[i[t]],typeof r!="number"&&(r=e(n));var o=i[t];for(s=0;sr)break}o.splice(s,0,n)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(!n)return;if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n});if(typeof n!="object")return;n.name||(n.name=t),this.addCommand(n)},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=r.KEY_MODS[t[o]];if(u==null)return typeof console!="undefined"&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=u}return{key:n,hashId:s}},this.findKeyCommand=function(t,n){var r=s[t]+n;return this.commandKeyBinding[r]},this.handleKeyboard=function(e,t,n,r){if(r<0)return;var i=s[t]+n,o=this.commandKeyBinding[i];e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o);if(o)if(o=="chainKeys"||o[o.length-1]=="chainKeys")return e.$keyChain=e.$keyChain||i,{command:"null"};if(e.$keyChain)if(!!t&&t!=4||n.length!=1){if(t==-1||r>0)e.$keyChain=""}else e.$keyChain=e.$keyChain.slice(0,-i.length-1);return{command:o}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=u}),define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),i.returnValue===!1?!1:!0},this.toggleRecording=function(e){if(this.$inReplay)return;return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},this.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function o(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){typeof t!="number"&&(t=parseInt(prompt("Enter line number:"),10)),isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:o("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:o("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(e){},readOnly:!0},{name:"cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),n=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",n),n.isEmpty()||e.session.remove(n),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:o(null,null),exec:function(e){var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),a=u.replace(/\n\s*/," ").length,f=e.session.doc.getLine(n.row);for(var l=n.row+1;l<=i.row+1;l++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));c.length!==0&&(c=" "+c),f+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:}n=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var i=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())},this.setKeyboardHandler=function(e,t){if(e&&typeof e=="string"&&e!="ace"){this.$keybindingId=e;var n=this;g.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session==e)return;this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new p(n.row,n.column,n.row,n.column+1);else if(t.$mode.getMatching)var r=t.$mode.getMatching(e.session);r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))},50)},this.$highlightTags=function(){if(this.$highlightTagPending)return;var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=e.getCursorPosition(),r=new y(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type)){t.removeMarker(t.$tagHighlight),t.$tagHighlight=null;return}if(i.type.indexOf("tag-open")!=-1){i=r.stepForward();if(!i)return}var s=i.value,o=0,u=r.stepBackward();if(u.value=="<"){do u=i,i=r.stepForward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="=0)}else{do i=u,u=r.stepBackward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="1)&&(t=!1)}if(e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,Infinity);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(s.length>5e3||!/[\w\d]/.test(s))return;var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),u=i.substring(n-1,r+1);if(!o.test(u))return;return o},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;var r=this.selection.getAllRanges();for(var i=0;is.length||i.length<2||!i[1])return this.commands.exec("insertstring",this,t);for(var o=s.length;o--;){var u=s[o];u.isEmpty()||r.remove(u),r.insert(u.start,i[o])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var n=this.session,r=n.getMode(),i=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var s=r.transformAction(n.getState(i.row),"insertion",this,n,e);s&&(e!==s.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=s.text)}e==" "&&(e=this.session.getTabString());if(!this.selection.isEmpty()){var o=this.getSelectionRange();i=this.session.remove(o),this.clearSelection()}else if(this.session.getOverwrite()&&e.indexOf("\n")==-1){var o=new p.fromPoints(i,i);o.end.column+=e.length,this.session.remove(o)}if(e=="\n"||e=="\r\n"){var u=n.getLine(i.row);if(i.column>u.search(/\S|$/)){var a=u.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var f=i.column,l=n.getState(i.row),u=n.getLine(i.row),c=r.checkOutdent(l,u,e),h=n.insert(i,e);s&&s.selection&&(s.selection.length==2?this.selection.setSelectionRange(new p(i.row,f+s.selection[0],i.row,f+s.selection[1])):this.selection.setSelectionRange(new p(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3])));if(n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(l,u.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}c&&r.autoOutdent(l,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}(e||!this.selection.isEmpty())&&this.insert(e,!0);if(t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},this.onCommandKey=function(e,t,n){this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(t.end.column===0){var s=n.getTextRange(t);if(s[s.length-1]=="\n"){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});var i=new p(0,0,0,0);for(var r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new p(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);a*=Math.pow(10,u),o!==s.end&&n=u&&o<=a&&(n=t,f.selection.clearSelection(),f.moveCursorTo(e,u+r),f.selection.selectTo(e,a+r)),u=a});var l=this.$toggleWordPairs,c;for(var h=0;hp+1)break;p=d.last}l--,u=this.session.$moveLines(h,p,t?0:e),t&&e==-1&&(c=l+1);while(c<=l)o[c].moveBy(u,0),c++;t||(u=0),a+=u}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(!s)return;var o,u=!1,a={},f=n.column-s.start,l,c={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g))for(;f=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&r.mixin(t,e);var i=this.selection.getRange();t.needle==null&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(!e)return;var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),u=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,u=s.top-o.offset;s.top>=0&&u+t.top<0?r=!0:s.topwindow.innerHeight?r=!1:r=null,r!=null&&(i.style.top=u+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",u),this.renderer.off("beforeRender",o)}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!="wide",i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))}}.call(w.prototype),g.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?E.attach(this):E.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?E.attach(this):E.detach(this)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var E={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"\u00b7":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=w}),define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){while(n0){a.row+=i,a.column+=a.row==r.row?s:0;continue}!t&&l<=0&&(a.row=n.row,a.column=n.column,l===0&&(a.bias=1))}}function f(e){return{row:e.row,column:e.column}}function l(e){return{start:f(e.start),end:f(e.end),action:e.action,lines:e.lines.slice()}}function c(e){e=e||this;if(Array.isArray(e))return e.map(c).join("\n");var t="";e.action?(t=e.action=="insert"?"+":"-",t+="["+e.lines+"]"):e.value&&(Array.isArray(e.value)?t=e.value.map(h).join("\n"):t=h(e.value)),e.start&&(t+=h(e));if(e.id||e.rev)t+=" ("+(e.id||e.rev)+")";return t}function h(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function p(e,t){var n=e.action=="insert",r=t.action=="insert";if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}return[t,e]}function d(e,t){for(var n=e.length;n--;)for(var r=0;r=0?m(e,t,-1):o(e.start,t.start)<=0?m(t,e,1):(m(e,s.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):o(t.start,e.start)<=0?m(e,t,1):(m(t,s.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0)){var i,u;return o(e.start,t.start)<0&&(i=e,e=y(e,t.start)),o(e.end,t.end)>0&&(u=y(e,t.end)),g(t.end,e.start,e.end,-1),u&&!i&&(e.lines=u.lines,e.start=u.start,e.end=u.end,u=e),[t,i,u].filter(Boolean)}m(e,t,-1)}return[t,e]}function m(e,t,n){g(e.start,t.start,t.end,n),g(e.end,t.start,t.end,n)}function g(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function y(e,t){var n=e.lines,r=e.end;e.end=f(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;n.push(s[0].substring(0,o)),s[0]=s[0].substr(o);var u={start:f(t),end:r,lines:s,action:e.action};return u}function b(e,t){t=l(t);for(var n=e.length;n--;){var r=e[n];for(var i=0;i0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){e==undefined&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?c(e):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)}}).call(r.prototype);var s=e("./range").Range,o=s.comparePoints,u=s.comparePoints;t.UndoManager=r}),define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight),s=n.documentToScreenRow(e,0)*t.lineHeight;return s-i*this.canvasHeight},this.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLength(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=r.createFragment(this.element);for(var n=0;ns&&(a=i.end.row+1,i=t.getNextFoldLine(a,i),s=i?i.start.row:Infinity);if(a>r){while(this.$lines.getLength()>u+1)this.$lines.pop();break}o=this.$lines.get(++u),o?o.row=a:(o=this.$lines.createCell(a,e,this.session,f),this.$lines.push(o)),this.$renderCell(o,e,i,a),a++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)i=t.getLength()+r-1;var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();s+=o.left+o.right,s!==this.gutterWidth&&!isNaN(s)&&(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row},this.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}},this.scrollLines=function(e){var t=this.config;this.config=e,this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;this.oldLastRow=n;if(!t||r0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:Infinity;for(;;){i>o&&(i=s.end.row+1,s=this.session.getNextFoldLine(i,s),o=s?s.start.row:Infinity);if(i>n)break;var u=this.$lines.createCell(i,e,this.session,f);this.$renderCell(u,e,s,i),r.push(u),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,u=s.childNodes[0],a=s.childNodes[1],f=o.$firstLineNumber,l=o.$breakpoints,c=o.$decorations,h=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,d=n?n.start.row:Number.MAX_VALUE,v="ace_gutter-cell ";this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=d&&this.$cursorRow<=n.end.row)&&(v+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),l[i]&&(v+=l[i]),c[i]&&(v+=c[i]),this.$annotations[i]&&(v+=this.$annotations[i].className),s.className!=v&&(s.className=v);if(p){var m=p[i];m==null&&(m=p[i]=o.getFoldWidget(i))}if(m){var v="ace_fold-widget ace_"+m;m=="start"&&i==d&&in.right-t.right)return"foldWidgets"}}).call(a.prototype),t.Gutter=a}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(!e)return;this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(i.isEmpty())continue;i=i.toScreenRange(this.session);if(r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,i,r.clazz,e):r.type=="screenLine"?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type=="text"?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start"+" ace_br15",e)}if(this.i!=-1)while(this.ip,l==f),s,l==f?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,u=this.$getTop(t.start.row,r),a=s+t.start.column*r.characterWidth;i=i||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var f=t.clone();f.end.row=f.start.row,f.end.column=this.session.getLine(f.start.row).length,this.drawBidiSingleLineMarker(e,f,n+" ace_br1 ace_start",r,null,i)}else this.elt(n+" ace_br1 ace_start","height:"+o+"px;"+"right:0;"+"top:"+u+"px;left:"+a+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var f=t.clone();f.start.row=f.end.row,f.start.column=0,this.drawBidiSingleLineMarker(e,f,n+" ace_br12",r,null,i)}else{u=this.$getTop(t.end.row,r);var l=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;"+"width:"+l+"px;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))}o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<=0)return;u=this.$getTop(t.start.row+1,r);var c=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(c?" ace_br"+c:""),"height:"+o+"px;"+"right:0;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,u=(t.end.column+(i||0)-t.start.column)*r.characterWidth,a=this.$getTop(t.start.row,r),f=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;"+"width:"+u+"px;"+"top:"+a+"px;"+"left:"+f+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,u=this.$getTop(t.start.row,r),a=this.$padding,f=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);f.forEach(function(e){this.elt(n,"height:"+o+"px;"+"width:"+e.width+(i||0)+"px;"+"top:"+u+"px;"+"left:"+(a+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,u=e("../lib/event_emitter").EventEmitter,a=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,u),this.EOF_CHAR="\u00b6",this.EOL_CHAR_LF="\u00ac",this.EOL_CHAR_CRLF="\u00a4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\u00b7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;nl&&(u=a.end.row+1,a=this.session.getNextFoldLine(u,a),l=a?a.start.row:Infinity);if(u>i)break;var c=s[o++];if(c){this.dom.removeChildren(c),this.$renderLine(c,u,u==l?a:!1);var h=e.lineHeight*this.session.getRowLength(u)+"px";c.style.height!=h&&(f=!0,c.style.height=h)}u++}if(f)while(o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){var r=[],s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=this.$lines.createCell(s,e,this.session),f=a.element;this.dom.removeChildren(f),i.setStyle(f.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(f.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(f,s,s==u?o:!1),this.$useLineGroups()?f.className="ace_line_group":f.className="ace_line",r.push(a),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;var t=e.firstRow,n=e.lastRow,r=this.$lines;while(r.getLength())r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){var o=this,u=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,a=this.dom.createFragment(this.element),f,l=0;while(f=u.exec(r)){var c=f[1],h=f[2],p=f[3],d=f[4],v=f[5];if(!o.showInvisibles&&h)continue;var m=l!=f.index?r.slice(l,f.index):"";l=f.index+f[0].length,m&&a.appendChild(this.dom.createTextNode(m,this.element));if(c){var g=o.session.getScreenTabSize(t+f.index);a.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else if(h)if(o.showInvisibles){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_space",y.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),a.appendChild(y)}else a.appendChild(this.com.createTextNode(h,this.element));else if(p){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_space ace_invalid",y.textContent=s.stringRepeat(o.SPACE_CHAR,p.length),a.appendChild(y)}else if(d){var b=o.showInvisibles?o.SPACE_CHAR:"";t+=1;var y=this.dom.createElement("span");y.style.width=o.config.characterWidth*2+"px",y.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=o.showInvisibles?o.SPACE_CHAR:"",a.appendChild(y)}else if(v){t+=1;var y=i.createElement("span");y.style.width=o.config.characterWidth*2+"px",y.className="ace_cjk",y.textContent=v,a.appendChild(y)}}a.appendChild(this.dom.createTextNode(l?r.slice(l):r,this.element));if(!this.$textToken[n.type]){var w="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");n.type=="fold"&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=w,y.appendChild(a),e.appendChild(y)}else e.appendChild(a);return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==" "){r-=r%this.tabSize;var i=r/this.tabSize;for(var s=0;s=o)u=this.$renderToken(a,u,l,c.substring(0,o-r)),c=c.substring(o-r),r=o,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(s.stringRepeat("\u00a0",n.indent),this.element)),i++,u=0,o=n[i]||Number.MAX_VALUE;c.length!=0&&(r+=c.length,u=this.$renderToken(a,u,l,c))}}},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r){this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var i=this.dom.createElement("span");i.className="ace_inline_button ace_keyword ace_toggle_wrap",i.style.position="absolute",i.style.right="0",i.textContent="",e.appendChild(i)},this.$renderLine=function(e,t,n){!n&&n!=0&&(n=this.session.getFoldLine(t));if(n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,r,s);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(a.prototype),t.Text=a}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){var t=this.cursors;for(var n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));if(r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)continue;var u=this.cursors[i++]||this.addCursor(),a=u.style;this.drawCursor?this.drawCursor(u,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(a,"display","block"),r.translate(u,o.left,o.top),r.setStyle(a,"width",Math.round(e.characterWidth)+"px"),r.setStyle(a,"height",e.lineHeight+"px")):r.setStyle(a,"display","none")}while(this.cursors.length>i)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,u=32768,a=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var f=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(f,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>u?(this.coeff=u/e,e=u):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(f.prototype);var l=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(l,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(l.prototype),t.ScrollBar=f,t.ScrollBarV=f,t.ScrollBarH=l,t.VScrollBar=f,t.HScrollBar=l}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;t&&(r.blockIdle(100),n.changes=0,n.onRender(t));if(n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),u=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,f=256,l=typeof ResizeObserver=="function",c=200,h=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",f),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,a),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",u.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){e===undefined&&(e=this.$measureSizes());if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/f})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/f};return t.width===0||t.height===0?null:t},this.$measureCharWidth=function(e){this.$main.innerHTML=s.stringRepeat(e,f);var t=this.$main.getBoundingClientRect();return t.width/f},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},this.transformCoordinates=function(e,t){function r(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function u(e){var t=e.getBoundingClientRect();return[t.left,t.top]}if(e){var n=this.$getZoom(this.el);e=o(1/n,e)}this.els||this.$initTransformMeasureNodes();var a=u(this.els[0]),f=u(this.els[1]),l=u(this.els[2]),h=u(this.els[3]),p=r(i(h,f),i(h,l),i(s(f,l),s(h,a))),d=o(1+p[0],i(f,a)),v=o(1+p[1],i(l,a));if(t){var m=t,g=p[0]*m[0]/c+p[1]*m[1]/c+1,y=s(o(m[0],d),o(m[1],v));return s(o(1/g/c,y),a)}var b=i(e,a),w=r(i(d,o(p[0],b)),i(v,o(p[1],b)),b);return o(c,w)}}).call(h.prototype)}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,u=e("./layer/marker").Marker,a=e("./layer/text").Text,f=e("./layer/cursor").Cursor,l=e("./scrollbar").HScrollBar,c=e("./scrollbar").VScrollBar,h=e("./renderloop").RenderLoop,p=e("./layer/font_metrics").FontMetrics,d=e("./lib/event_emitter").EventEmitter,v='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}',m=e("./lib/useragent"),g=m.isIE;i.importCssString(v,"ace_editor.css");var y=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new u(this.content);var r=this.$textLayer=new a(this.content);this.canvas=r.element,this.$markerFront=new u(this.content),this.$cursorLayer=new f(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new c(this.container,this),this.scrollBarH=new l(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new h(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,d),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)},this.updateLines=function(e,t,n){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(this.resizing>2)return;this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,u={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL);if(n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,t==null&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",a),i.setStyle(this.scroller.style,"right",a),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight());if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)s|=this.CHANGE_FULL}return o.$dirty=!n||!r,s&&this._signal("resize",u),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e=this.textarea.style;if(!this.$keepTextAreaAtCursor){i.translate(this.textarea,-100,0);return}var t=this.$cursorLayer.$pixelPos;if(!t)return;var n=this.$composition;n&&n.markerRange&&(t=this.$cursorLayer.getPixelPosition(n.markerRange.start,!0));var r=this.layerConfig,s=t.top,o=t.left;s-=r.offset;var u=n&&n.useTextareaForIME?this.lineHeight:g?0:1;if(s<0||s>r.height-u){i.translate(this.textarea,0,0);return}var a=1;if(!n)s+=this.lineHeight;else if(n.useTextareaForIME){var f=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(f)[0],u+=2}else s+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-a&&(o=this.$size.scrollerWidth-a),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",u+"px"),i.setStyle(e,"width",a+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-a),Math.min(s,this.$size.height-u))},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow,n=this.session.documentToScreenRow(t,0)*e.lineHeight;return n-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left");if(e&this.CHANGE_FULL){this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender");return}if(e&this.CHANGE_SCROLL){e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender");return}e&this.CHANGE_TEXT?(this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=n<=2*this.lineHeight,i=!r&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var s=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength(),i=r*this.lineHeight,s=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),u=this.$horizScroll!==o;u&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var f=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=l;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,i-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+l<0||this.scrollTop>c.top),p=a!==h;p&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var d=this.scrollTop%this.lineHeight,v=Math.ceil(f/this.lineHeight)-1,m=Math.max(0,Math.round((this.scrollTop-d)/this.lineHeight)),g=m+v,y,b,w=this.lineHeight;m=e.screenToDocumentRow(m,0);var E=e.getFoldLine(m);E&&(m=E.start.row),y=e.documentToScreenRow(m,0),b=e.getRowLength(m)*w,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),f=t.scrollerHeight+e.getRowLength(g)*w+b,d=this.scrollTop-y*w;var S=0;if(this.layerConfig.width!=s||u)S=this.CHANGE_H_SCROLL;if(u||p)S=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),p&&(s=this.$getLongestLine());return this.layerConfig={width:s,padding:this.$padding,firstRow:m,firstRowScreen:y,lastRow:g,lineHeight:w,characterWidth:this.characterWidth,minHeight:f,maxHeight:i,offset:d,gutterOffset:w?Math.max(0,Math.ceil((d+t.height-t.scrollerHeight)/w)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),S},this.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight===0)return;var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,u=n&&n.bottom||0,a=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;a+o>s?(t&&a+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):a+this.$size.scrollerHeight-ui?(i=1-this.scrollMargin.top)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return!0;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return!0;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),u=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:u,side:s-u>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),u=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(u,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText,e.keepTextAreaAtCursor=this.$keepTextAreaAtCursor),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(this.$keepTextAreaAtCursor=!0,i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!this.$composition)return;this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display=""},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(r==null)o.push(s);else{var u=0;for(var a=0;a50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e})}}).call(f.prototype);var l=function(e,t,n){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var r=null,i=!1,u=Object.create(s),a=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){a.messageBuffer.push(e),r&&(i?setTimeout(f):f())},this.setEmitSync=function(e){i=e};var f=function(){var e=a.messageBuffer.shift();e.command?r[e.command].apply(r,e.args):e.event&&u._signal(e.event,e.data)};u.postMessage=function(e){a.onMessage({data:e})},u.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},u.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){r=new e[n](u);while(a.messageBuffer.length)f()})};l.prototype=f.prototype,t.UIWorkerClient=l,t.WorkerClient=f,t.createWorker=a}),define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})},this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;this.updateAnchors(e),i&&(this.length+=n);if(i&&!this.session.$fromUndo)if(e.action==="insert")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.insertMergedLines(a,e.lines)}else if(e.action==="remove")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(this.$updating)return;var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)},this.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var n=this.getRange(),r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var u=n.end,a=n.start;else var u=n.start,a=n.end;this.addRange(i.fromPoints(a,a)),this.addRange(i.fromPoints(u,u));return}var f=[],l=this.getLineRange(s,!0);l.start.column=n.start.column,f.push(l);for(var c=s+1;c1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0)g--;if(g>0){var y=0;while(r[y].isEmpty())y++}for(var b=g;b>=y;b--)r[b].isEmpty()&&r.splice(b,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection")},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;if(!t.multiSelectAction){var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}else t.multiSelectAction=="forEach"?r=n.forEachSelection(t,e.args):t.multiSelectAction=="forEachLine"?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});return r},this.forEachSelection=function(e,t,n){if(this.inVirtualSelectionMode)return;var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,u=this.selection,a=u.rangeList,f=(r?u:a).ranges,l;if(!f.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=u._eventRegistry;u._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var p=f.length;p--;){if(i)while(p>0&&f[p].start.row==f[p-1].end.row)p--;h.fromOrientedRange(f[p]),h.index=p,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});!l&&d!==undefined&&(l=d),h.toOrientedRange(f[p])}h.detach(),this.selection=o.selection=u,this.inVirtualSelectionMode=!1,u._eventRegistry=c,u.mergeOverlappingRanges(),u.ranges[0]&&u.fromOrientedRange(u.ranges[0]);var v=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),v&&v.from==v.to&&this.renderer.animateScrolling(v.from),l},this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges,n=[];for(var r=0;r0);u<0&&(u=0),f>=c&&(f=c-1)}var p=this.session.removeFullLines(u,f);p=this.$reAlignText(p,l),this.session.insert({row:u,column:0},p.join("\n")+"\n"),l||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{s.forEach(function(e){t.substractPoint(e.cursor)});var d=0,v=Infinity,m=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>d&&(d=n.column),io?e.insert(r,a.stringRepeat(" ",s-o)):e.remove(new i(r.row,r.column,r.row,r.column-s+o)),t.start.column=t.end.column=d,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){function u(e){return a.stringRepeat(" ",e)}function f(e){return e[2]?u(i)+e[2]+u(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?u(i+s-e[2].length)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function c(e){return e[2]?u(i)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var n=!0,r=!0,i,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,s=t[2].length,o=t[3].length,t):(i+s+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),st[3].length&&(o=t[3].length),t):[e]}).map(t?f:n?r?l:f:c)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){m(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++tf){var h=e.getLine(l).length;return new r(f,u,l,h)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=e.getFoldWidget(u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)}),define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}),define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./range").Range;(function(){this.getRowLength=function(e){var t;return this.lineWidgets?t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:t=0,!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach();if(this.editor==e)return;this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},this.detach=function(e){var t=this.editor;if(!t)return;this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(!n||!e.action)return;var r=e.data,i=r.start.row,s=r.end.row,o=e.action=="add";for(var u=i+1;u0&&!r[i])i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var u=r[o];if(!u||!u.el)continue;if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,t.container.appendChild(u.el));var a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;u.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=a-n.offset+"px";var f=u.coverGutter?0:t.gutterWidth;u.fixedWidth||(f-=t.scrollLeft),u.el.style.left=f+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=n.width+2*n.padding+"px"),u.fixedWidth?u.el.style.right=t.scrollBar.getWidth()+"px":u.el.style.right=""}}}).call(o.prototype),t.LineWidgets=o}),define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e,t,n){var r=0,i=e.length-1;while(r<=i){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}function u(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(!r.length)return;var i=o(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:i===0&&n<0&&(i=r.length-1);var u=r[i];if(!u||!n)return;if(u.row===t){do u=r[i+=n];while(u&&u.row===t);if(!u)return r.slice()}var a=[];t=u.row;do a[n<0?"unshift":"push"](u),u=r[i+=n];while(u&&u.row==t);return a.length&&a}var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),o=s.row,a=n.widgetManager.getWidgetsAtRow(o).filter(function(e){return e.type=="errorMarker"})[0];a?a.destroy():o-=t;var f=u(n,o,t),l;if(f){var c=f[0];s.column=(c.pos&&typeof c.column!="number"?c.pos.sc:c.column)||0,s.row=c.row,l=e.renderer.$gutterLayer.$annotations[s.row]}else{if(a)return;l={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var h={row:s.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},p=h.el.appendChild(i.createElement("div")),d=h.el.appendChild(i.createElement("div"));d.className="error_widget_arrow "+l.className;var v=e.renderer.$cursorLayer.getPixelPosition(s).left;d.style.left=v+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",p.className="error_widget "+l.className,p.innerHTML=l.text.join("
"),p.appendChild(i.createElement("div"));var m=function(e,t,n){if(t===0&&(n==="esc"||n==="return"))return h.destroy(),{command:"null"}};h.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy)},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./range").Range,o=e("./editor").Editor,u=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,f=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,typeof define=="function"&&(t.define=define),t.edit=function(e,n){if(typeof e=="string"){var s=e;e=document.getElementById(s);if(!e)throw new Error("ace.edit can't find div #"+s)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var u="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;u=a.value,e=r.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(u=e.textContent,e.innerHTML="");var l=t.createEditSession(u),c=new o(new f(e),l,n),h={document:l,editor:c,onResize:c.resize.bind(c,null)};return a&&(h.textarea=a),i.addListener(window,"resize",h.onResize),c.on("destroy",function(){i.removeListener(window,"resize",h.onResize),h.editor.container.env=null}),c.container.env=c.env=h,c},t.createEditSession=function(e,t){var n=new u(e,t);return n.setUndoManager(new a),n},t.Range=s,t.Editor=o,t.EditSession=u,t.UndoManager=a,t.VirtualRenderer=f,t.version="1.4.2"}); (function() { + window.require(["ace/ace"], function(a) { + if (a) { + a.config.init(true); + a.define = window.define; + } + if (!window.ace) + window.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + window.ace[key] = a[key]; + window.ace["default"] = window.ace; + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = window.ace; + } + }); + })(); + \ No newline at end of file diff --git a/web/js/codemirror.js b/web/js/codemirror.js new file mode 100644 index 0000000..a2cf9c3 --- /dev/null +++ b/web/js/codemirror.js @@ -0,0 +1,3 @@ +/*! venus 08-11-2018 */ + +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,g=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),w=r||n||i,C=w&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),l=!i&&/Chrome\//.test(e),v=/Opera\//.test(e),a=/Apple Computer/.test(navigator.vendor),s=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),u=/PhantomJS/.test(e),c=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),h=/Android/.test(e),f=c||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=c||/Mac/.test(t),d=/\bCrOS\b/.test(e),p=/win/i.test(t),m=v&&e.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&15<=m&&(b=!(v=!1));var y=x&&(o||v&&(null==m||m<12.11)),S=g||w&&9<=C;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,M=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function T(e){for(var t=e.childNodes.length;0=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&to?ve(o,ae(e,o).text.length):(n=ae(e,(r=t).line).text.length,null==(i=r.ch)||n=t:o.to>t);(n||(n=[])).push(new Te(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.frome.lastLine())return t;var r,n=ae(e,t);if(!Ke(e,n))return t;for(;r=Re(n);)n=r.find(1,!0).line;return fe(n)+1}function Ke(e,t){var r=Me&&t.markedSpans;if(r)for(var n=void 0,i=0;ir.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var qe=null;function $e(e,t,r){var n;qe=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:qe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:qe=i)}return null!=n?n:qe}var Ze=function(){var z="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",I="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var R=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,B=/[stwN]/,G=/[LRr]/,U=/[Lb1n]/,V=/[1n]/;function K(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!R.test(e))return!1;for(var n,i=e.length,o=[],l=0;le.text.length?null:n}function et(e,t,r){var n=Je(e,t.ch,r);return null==n?null:new ve(t.line,n,r<0?"after":"before")}function tt(e,t,r,n,i){if(e){var o=Qe(r,t.doc.direction);if(o){var l,s=i<0?q(o):o[0],a=i<0==(1==s.level)?"after":"before";if(0=l.text.length?(s.ch=l.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var t=$e(a,s.ch,s.sticky),r=a[t];if("ltr"==o.doc.direction&&r.level%2==0&&(0s.ch:r.from=r.from&&f>=i.begin)){var d=h?"before":"after";return new ve(s.line,f,d)}}var p=function(e,t,r){for(var n=function(e,t){return t?new ve(s.line,c(e,1),"before"):new ve(s.line,e,"after")};0<=e&&e=this.string.length},zt.prototype.sol=function(){return this.pos==this.lineStart},zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},zt.prototype.next=function(){if(this.post},zt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},zt.prototype.skipToEnd=function(){this.pos=this.string.length},zt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1e.options.maxHighlightLength&&Ft(e.doc.mode,n.state),o=Bt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ut(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new Rt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;lt.first&&ae(t,o-1).stateAfter,s=l?Rt.fromSaved(t,l,o):new Rt(t,Pt(t.mode),o);return t.iter(o,n,function(e){Vt(r,e.text,s);var t=s.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&tt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Rt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Rt.prototype.nextLine=function(){this.line++,0e.options.maxHighlightLength?(s=!1,l&&Vt(e,t,n,h.pos),h.pos=t.length,null):Yt(jt(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;us&&u.from<=s);c++);if(u.to>=a)return h(e,t,r,n,i,o,l);h(e,t.slice(0,u.to-s),r,n,null,o,l),n=null,t=t.slice(u.to-s),s=u.to}}}function ir(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function or(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y=[],b=void 0,x=0;xp||C.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&m>w.to&&(m=w.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&w.from==p&&(c+=" "+C.startStyle),C.endStyle&&w.to==m&&(b||(b=[])).push(C.endStyle,w.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||Pe(f.marker,C)<0)&&(f=w)):w.from>p&&m>w.from&&(m=w.from)}if(b)for(var S=0;Sr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Wr(e,t,r,n){return Fr(e,Hr(e,t),r,n)}function Dr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(i=(o=a-s)-1,a<=t&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!u)return a("before"==r?t-1:t,"before"==r);function c(e,t,r){return a(r?e-1:e,u[t].level%2!=0!=r)}var h=$e(u,t,r),f=qe,d=c(t,h,"before"==r);return null!=f&&(d.other=c(t,f,"before"!=r)),d}function Yr(e,t){var r=0;t=Se(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=ae(e.doc,t.line),i=Xe(n)+Lr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function qr(e,t,r,n,i){var o=ve(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function $r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return qr(n.first,0,null,!0,-1);var i=de(n,r),o=n.first+n.size-1;if(ou.from.ch||s.ch==u.from.ch&&0i},l,e)}}function Qr(r,n,e,i,o){o-=Xe(n);var t,l=0,s=n.text.length,a=Hr(r,n);if(Qe(n,r.doc.direction)){var u;if(r.options.lineWrapping)l=(u=Zr(r,n,a,o)).begin,s=u.end;t=new ve(e,Math.floor(l+(s-l)/2));var c,h,f=_r(r,t,"line",n,a).left,d=fMath.abs(c)){if(p<0==c<0)throw new Error("Broke out of infinite loop in coordsCharInner");t=h}}else{var b=le(function(e){var t=Kr(r,n,Fr(r,a,e),"line");return t.top>o?(s=Math.min(e,s),!0):!(t.bottom<=o)&&(t.left>i||!(t.rightx.right?1:0,t}function Jr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Er){Er=O("pre");for(var t=0;t<49;++t)Er.appendChild(document.createTextNode("x")),Er.appendChild(O("br"));Er.appendChild(document.createTextNode("x"))}N(e.measure,Er);var r=Er.offsetHeight/50;return 3=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().linet||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}(Qe(n,o.direction),a||0,null==u?f:u,function(e,t,r){var n,i,o,l=d(e,"left");if(e==t)i=o=(n=l).left;else{if(n=d(t-1,"right"),"rtl"==r){var s=l;l=n,n=s}i=l.left,o=n.right}null==a&&0==e&&(i=p),3h.bottom||n.bottom==h.bottom&&n.right>h.right)&&(h=n),i=l&&(o=de(t,Xe(ae(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function xn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;lo&&(t.bottom=t.top+o);var s=e.doc.height+kr(r),a=t.tops-n;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Nr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.leftf+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function Sn(e,t){null!=t&&(Mn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ln(e){Mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function kn(e,t,r){null==t&&null==r||Mn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Mn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Tn(e,Yr(e,t.from),Yr(e,t.to),t.margin))}function Tn(e,t,r,n){var i=Cn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});kn(e,i.scrollLeft,i.scrollTop)}function Nn(e,t){Math.abs(e.doc.scrollTop-t)<2||(g||oi(e,{top:t}),On(e,t,!0),g&&oi(e),ei(e,100))}function On(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function An(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,xn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Wn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Dn=function(e,t,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),it(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),it(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,w&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ri(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Un(e){var t=e.cm,r=t.display;e.updatedDisplay&&mn(t),e.barMeasure=Wn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Wr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function Vn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!u){var o=O("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Lr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ve(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ve(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=_r(e,t),a=r&&r!=t?_r(e,r):s,u=Cn(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Nn(e,u.scrollTop),1t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Me&&Ue(e.doc,t)i.viewFrom?Zn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Zn(e);else if(t<=i.viewFrom){var o=Qn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Zn(e)}else if(r>=i.viewTo){var l=Qn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Zn(e)}else{var s=Qn(e,t,t,-1),a=Qn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(sr(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):Zn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[sn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function Zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,r,n){var i,o=sn(e,t),l=e.display.view;if(!Me||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a=a.display.viewTo)){var c=+new Date+a.options.workTime,h=Ut(a,u.highlightFrontier),f=[];u.iter(h.line,Math.min(u.first+u.size,a.display.viewTo+500),function(e){if(h.line>=a.display.viewFrom){var t=e.styles,r=e.text.length>a.options.maxHighlightLength?Ft(u.mode,h.state):null,n=Bt(a,e,h,!0);r&&(h.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var l=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),s=0;!l&&sc)return ei(a,a.options.workDelay),!0}),u.highlightFrontier=h.line,u.modeFrontier=Math.max(u.modeFrontier,h.line),f.length&&jn(a,function(){for(var e=0;e=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Jn(e))return!1;wn(e)&&(Zn(e),t.dims=tn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Me&&(o=Ue(e.doc,o),l=Ve(e.doc,l));var s,a,u,c,h=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;a=o,u=l,0==(c=(s=e).display).view.length||a>=c.viewTo||u<=c.viewFrom?(c.view=sr(s,a,u),c.viewFrom=a):(c.viewFrom>a?c.view=sr(s,a,c.viewFrom).concat(c.view):c.viewFromu&&(c.view=c.view.slice(0,sn(s,u)))),c.viewTo=u,r.viewOffset=Xe(ae(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=Jn(e);if(!h&&0==f&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var d=function(e){if(e.hasFocus())return null;var t=D();if(!t||!W(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&W(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ni(e,t);n=!1){mn(e);var i=Wn(e);an(e),Fn(e,i),si(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function oi(e,t){var r=new ri(e,t);if(ni(e,r)){mn(e),ii(e,r);var n=Wn(e);an(e),Fn(e,n),si(e,n),r.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function si(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function ai(e){var t=e.display.gutters,r=e.options.gutters;T(t);for(var n=0;nl.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&x&&b)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;ha-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=(s=i).lastOp==n?(Di(s.done),q(s.done)):s.done.length&&!q(s.done).ranges?q(s.done):1i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||st(e,"historyAdded")}function Fi(e,t,r,n){var i,o,l,s,a,u=e.history,c=n&&n.origin;r==u.lastSelOp||c&&u.lastSelOrigin==c&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==c||(i=e,o=c,l=q(u.done),s=t,"*"==(a=o.charAt(0))||"+"==a&&l.ranges.length==s.ranges.length&&l.somethingSelected()==s.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?u.done[u.done.length-1]=t:Ei(t,u.done),u.lastSelTime=+new Date,u.lastSelOrigin=c,u.lastSelOp=r,n&&!1!==n.clearRedo&&Di(u.undone)}function Ei(e,t){var r=q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Pi(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function zi(e){if(!e)return null;for(var t,r=0;r=t.ch:s.to>t.ch))){if(i&&(st(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=Ji(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=me(u,r))&&(n<0?c<0:0e.first?Se(e,ve(t.line-1)):null:0e.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ve(o,ae(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ue(e,t.from,t.to),r||(r=wi(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=fe(Ge(ae(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0}));-1i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiert.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&qn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&qi(t.doc)),t&&cr(t,"markerCleared",t,this,i,o),r&&Bn(t),this.parent&&this.parent.clear()}},yo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,l){i=Se(this,i),o=Se(this,o);var s=[],a=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r=n.to||null==n.from&&a!=i.line||null!=n.from&&a==o.line&&n.from>=o.ch||l&&!l(n.marker)||s.push(n.marker.parent||n.marker)}++a}),s},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;rt&&(t=e.from),null!=e.to&&e.tol.doc.first){var o=ae(l.doc,n.line-1).text;o&&(n=new ve(n.line,1),l.replaceRange(i.charAt(0)+l.doc.lineSeparator()+o.charAt(o.length-1),ve(n.line-1,o.length-1),n,"+transpose"))}t.push(new vi(n,n))}l.setSelections(t)})},newlineAndIndent:function(n){return jn(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;rc&&t.push(new vi(ve(s,c),ve(s,X(u,l,r))))}t.length||t.push(new vi(m,m)),Xi(b,mi(C.ranges.slice(0,w).concat(t),w),{origin:"*mouse",scroll:!1}),v.scrollIntoView(e)}else{var h,f=x,d=ll(v,e,y.unit),p=f.anchor;p=0=n.to||r.linel.bottom?20:0;i&&setTimeout(Xn(v,function(){s==t&&(o.scroller.scrollTop+=i,a(e))}),50)}}function n(e){v.state.selectingText=!1,s=1/0,ft(e),o.input.focus(),lt(document,"mousemove",i),lt(document,"mouseup",u),b.history.lastSelOrigin=null}var i=Xn(v,function(e){mt(e)?a(e):n(e)}),u=Xn(v,n);v.state.selectingText=u,it(document,"mousemove",i),it(document,"mouseup",u)}(e,n,t,o)}(t,l,a,e):vt(e)==r.scroller&&ft(e):2==s?(l&&Gi(t.doc,l),setTimeout(function(){return r.input.focus()},20)):3==s&&(S?ul(t,e):pn(t)))}}function ll(e,t,r){if("char"==r)return new vi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new vi(ve(t.line,0),Se(e.doc,ve(t.line+1,0)));var n=r(e,t);return new vi(n.from,n.to)}function sl(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ft(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!ct(e,r))return pt(t);o-=s.top-l.viewOffset;for(var a=0;a=i)return st(e,r,e,de(e.doc,o),e.options.gutters[a],t),pt(t)}}function al(e,t){return sl(e,t,"gutterClick",!0)}function ul(e,t){var r,n;Sr(e.display,t)||(n=t,ct(r=e,"gutterContextMenu")&&sl(r,n,"gutterContextMenu",!1))||(at(e,t,"contextmenu")||e.display.input.onContextMenu(t))}function cl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gr(e)}il.prototype.compare=function(e,t,r){return this.time+400>e&&0==me(t,this.pos)&&r==this.button};var hl={toString:function(){return"CodeMirror.Init"}},fl={},dl={};function pl(e){ai(e),qn(e),xn(e)}function gl(e,t,r){if(!t!=!(r&&r!=hl)){var n=e.display.dragFunctions,i=t?it:lt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function vl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),Ye(e)),on(e),qn(e),Gr(e),setTimeout(function(){return Fn(e)},100)}function ml(e,t){var r=this;if(!(this instanceof ml))return new ml(e,t);this.options=t=t?z(t):{},z(fl,t,!1),ui(t);var n=t.value;"string"==typeof n&&(n=new Lo(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new ml.inputStyles[t.inputStyle](this),o=this.display=new se(e,n,i);for(var l in ai(o.wrapper.CodeMirror=this),cl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),w&&C<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;it(o.scroller,"mousedown",Xn(i,ol)),it(o.scroller,"dblclick",w&&C<11?Xn(i,function(e){if(!at(i,e)){var t=ln(i,e);if(t&&!al(i,e)&&!Sr(i.display,e)){ft(e);var r=i.findWordAt(t);Gi(i.doc,r.anchor,r.head)}}}):function(e){return at(i,e)||ft(e)});S||it(o.scroller,"contextmenu",function(e){return ul(i,e)});var r,n={end:0};function l(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400o.first?I(ae(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f=n.first+n.size||(i=new ve(r,i.ch,i.sticky),!(s=ae(n,r))))return!1;i=tt(l,n.cm,s,i.line,o)}else i=t;return!0}if("char"==e)a();else if("column"==e)a(!0);else if("word"==e||"group"==e)for(var u=null,c="group"==e,h=n.cm&&n.cm.getHelper(i,"wordChars"),f=!0;!(o<0)||a(!f);f=!1){var d=s.text.charAt(i.ch)||"\n",p=te(d,h)?"w":c&&"\n"==d?"n":!c||/\s/.test(d)?null:"p";if(!c||f||p||(p="s"),u&&u!=p){o<0&&(o=1,a(),i.sticky="after");break}if(p&&(u=p),0=l.height){o.hitSide=!0;break}i+=5*r}return o}var Al=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Wl(e,t){var r=Dr(e,t.line);if(!r||r.hidden)return null;var n=ae(e.doc,t.line),i=Ar(r,n,t.line),o=Qe(n,e.doc.direction),l="left";o&&(l=$e(o,t.ch)%2?"right":"left");var s=zr(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Dl(e,t){return t&&(e.bad=!0),e}function Hl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Dl(e.clipPos(ve(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||i.line=t.display.viewFrom&&Wl(t,n)||{node:s[0].measure.map[2],offset:0},u=i.linen.firstLine()&&(l=ve(l.line-1,ae(n.doc,l.line-1).length)),s.ch==ae(n.doc,s.line).text.length&&s.linei.viewTo-1)return!1;r=l.line==i.viewFrom||0==(e=sn(n,l.line))?(t=fe(i.view[0].line),i.view[0].node):(t=fe(i.view[e].line),i.view[e-1].node.nextSibling);var a,u,c=sn(n,s.line);if(u=c==i.view.length-1?(a=i.viewTo-1,i.lineDiv.lastChild):(a=fe(i.view[c+1].line)-1,i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(a,e,t,u,c){var r="",h=!1,f=a.doc.lineSeparator();function d(){h&&(r+=f,h=!1)}function p(e){e&&(d(),r+=e)}function g(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(null!=t)return void p(t||e.textContent.replace(/\u200b/g,""));var r,n=e.getAttribute("cm-marker");if(n){var i=a.findMarks(ve(u,0),ve(c+1,0),(s=+n,function(e){return e.id==s}));return void(i.length&&(r=i[0].find())&&p(ue(a.doc,r.from,r.to).join(f)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p)$/i.test(e.nodeName);o&&d();for(var l=0;ll.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var w=ve(t,d),C=ve(a,f.length?q(f).length-p:0);return 1n&&(bl(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Ln(t));else{var l=o.from(),s=o.to(),a=Math.max(n,l.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Cn(o,l)).scrollTop&&Nn(o,s.scrollTop),null!=s.scrollLeft&&An(o,s.scrollLeft))},triggerOnKeyDown:_n(Jo),triggerOnKeyPress:_n(tl),triggerOnKeyUp:el,triggerOnMouseDown:_n(ol),execCommand:function(e){if(jo.hasOwnProperty(e))return jo[e].call(null,this)},triggerElectric:_n(function(e){Ll(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Se(this.doc,e),l=0;l=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w(" \ No newline at end of file diff --git a/web/venus.js b/web/venus.js new file mode 100644 index 0000000..cd2ad33 --- /dev/null +++ b/web/venus.js @@ -0,0 +1,3 @@ +/*! venus 09-08-2019 */ + +if(function(t,e){"function"==typeof define&&define.amd?define("kotlin",["exports"],e):"object"==typeof exports?e(module.exports):(t.kotlin={},e(t.kotlin))}(this,function(ro){var n,io=ro;function t(t,e){return(4294901760&t)*(65535&e)+(65535&t)*(0|e)|0}if(ro.defineInlineFunction=function(t,e){return e},void 0===String.prototype.startsWith&&(String.prototype.startsWith=function(t,e){return e=e||0,this.lastIndexOf(t,e)===e}),void 0===String.prototype.endsWith&&(String.prototype.endsWith=function(t,e){var n=this.toString();(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(t){return null!=t&&null!=t.__proto__&&t.__proto__.__proto__===Int8Array.prototype.__proto__}),ro.compareTo=function(t,e){var n=typeof t,r=typeof t;return ro.isChar(t)&&"number"===r?ro.primitiveCompareTo(t.charCodeAt(0),e):"number"===n&&ro.isChar(e)?ro.primitiveCompareTo(t,e.charCodeAt(0)):"number"===n||"string"===n||"boolean"===n?ro.primitiveCompareTo(t,e):t.compareTo_11rb$(e)},ro.primitiveCompareTo=function(t,e){return t=ro.Long.TWO_PWR_63_DBL_?ro.Long.MAX_VALUE:t<0?ro.Long.fromNumber(-t).negate():new ro.Long(t%ro.Long.TWO_PWR_32_DBL_|0,t/ro.Long.TWO_PWR_32_DBL_|0)},ro.Long.fromBits=function(t,e){return new ro.Long(t,e)},ro.Long.fromString=function(t,e){if(0==t.length)throw Error("number format error: empty string");var n=e||10;if(n<2||36>>16,n=65535&this.high_,r=this.low_>>>16,i=65535&this.low_,o=t.high_>>>16,a=65535&t.high_,s=t.low_>>>16,u=0,l=0,c=0,p=0;return c+=(p+=i+(65535&t.low_))>>>16,p&=65535,l+=(c+=r+s)>>>16,c&=65535,u+=(l+=n+a)>>>16,l&=65535,u+=e+o,u&=65535,ro.Long.fromBits(c<<16|p,u<<16|l)},ro.Long.prototype.subtract=function(t){return this.add(t.negate())},ro.Long.prototype.multiply=function(t){if(this.isZero())return ro.Long.ZERO;if(t.isZero())return ro.Long.ZERO;if(this.equalsLong(ro.Long.MIN_VALUE))return t.isOdd()?ro.Long.MIN_VALUE:ro.Long.ZERO;if(t.equalsLong(ro.Long.MIN_VALUE))return this.isOdd()?ro.Long.MIN_VALUE:ro.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().multiply(t.negate()):this.negate().multiply(t).negate();if(t.isNegative())return this.multiply(t.negate()).negate();if(this.lessThan(ro.Long.TWO_PWR_24_)&&t.lessThan(ro.Long.TWO_PWR_24_))return ro.Long.fromNumber(this.toNumber()*t.toNumber());var e=this.high_>>>16,n=65535&this.high_,r=this.low_>>>16,i=65535&this.low_,o=t.high_>>>16,a=65535&t.high_,s=t.low_>>>16,u=65535&t.low_,l=0,c=0,p=0,f=0;return p+=(f+=i*u)>>>16,f&=65535,c+=(p+=r*u)>>>16,p&=65535,c+=(p+=i*s)>>>16,p&=65535,l+=(c+=n*u)>>>16,c&=65535,l+=(c+=r*s)>>>16,c&=65535,l+=(c+=i*a)>>>16,c&=65535,l+=e*u+n*s+r*a+i*o,l&=65535,ro.Long.fromBits(p<<16|f,l<<16|c)},ro.Long.prototype.div=function(t){if(t.isZero())throw Error("division by zero");if(this.isZero())return ro.Long.ZERO;if(this.equalsLong(ro.Long.MIN_VALUE)){if(t.equalsLong(ro.Long.ONE)||t.equalsLong(ro.Long.NEG_ONE))return ro.Long.MIN_VALUE;if(t.equalsLong(ro.Long.MIN_VALUE))return ro.Long.ONE;if((r=this.shiftRight(1).div(t).shiftLeft(1)).equalsLong(ro.Long.ZERO))return t.isNegative()?ro.Long.ONE:ro.Long.NEG_ONE;var e=this.subtract(t.multiply(r));return r.add(e.div(t))}if(t.equalsLong(ro.Long.MIN_VALUE))return ro.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().div(t.negate()):this.negate().div(t).negate();if(t.isNegative())return this.div(t.negate()).negate();var n=ro.Long.ZERO;for(e=this;e.greaterThanOrEqual(t);){for(var r=Math.max(1,Math.floor(e.toNumber()/t.toNumber())),i=Math.ceil(Math.log(r)/Math.LN2),o=i<=48?1:Math.pow(2,i-48),a=ro.Long.fromNumber(r),s=a.multiply(t);s.isNegative()||s.greaterThan(e);)r-=o,s=(a=ro.Long.fromNumber(r)).multiply(t);a.isZero()&&(a=ro.Long.ONE),n=n.add(a),e=e.subtract(s)}return n},ro.Long.prototype.modulo=function(t){return this.subtract(this.div(t).multiply(t))},ro.Long.prototype.not=function(){return ro.Long.fromBits(~this.low_,~this.high_)},ro.Long.prototype.and=function(t){return ro.Long.fromBits(this.low_&t.low_,this.high_&t.high_)},ro.Long.prototype.or=function(t){return ro.Long.fromBits(this.low_|t.low_,this.high_|t.high_)},ro.Long.prototype.xor=function(t){return ro.Long.fromBits(this.low_^t.low_,this.high_^t.high_)},ro.Long.prototype.shiftLeft=function(t){if(0==(t&=63))return this;var e=this.low_;if(t<32){var n=this.high_;return ro.Long.fromBits(e<>>32-t)}return ro.Long.fromBits(0,e<>>t|e<<32-t,e>>t)}return ro.Long.fromBits(e>>t-32,0<=e?0:-1)},ro.Long.prototype.shiftRightUnsigned=function(t){if(0==(t&=63))return this;var e=this.high_;if(t<32){var n=this.low_;return ro.Long.fromBits(n>>>t|e<<32-t,e>>>t)}return 32==t?ro.Long.fromBits(e,0):ro.Long.fromBits(e>>>t-32,0)},ro.Long.prototype.equals=function(t){return t instanceof ro.Long&&this.equalsLong(t)},ro.Long.prototype.compareTo_11rb$=ro.Long.prototype.compare,ro.Long.prototype.inc=function(){return this.add(ro.Long.ONE)},ro.Long.prototype.dec=function(){return this.add(ro.Long.NEG_ONE)},ro.Long.prototype.valueOf=function(){return this.toNumber()},ro.Long.prototype.unaryPlus=function(){return this},ro.Long.prototype.unaryMinus=ro.Long.prototype.negate,ro.Long.prototype.inv=ro.Long.prototype.not,ro.Long.prototype.rangeTo=function(t){return new ro.kotlin.ranges.LongRange(this,t)},ro.Kind={CLASS:"class",INTERFACE:"interface",OBJECT:"object"},ro.isType=function(t,e){if(e===Object)switch(typeof t){case"string":case"number":case"boolean":case"function":return!0;default:return t instanceof Object}if(null==t||null==e||"object"!=typeof t&&"function"!=typeof t)return!1;if("function"==typeof e&&t instanceof e)return!0;var n=Object.getPrototypeOf(e),r=null!=n?n.constructor:null;if(null!=r&&"$metadata$"in r){var i=r.$metadata$;if(i.kind===ro.Kind.OBJECT)return t===e}var o=e.$metadata$;return null==o?t instanceof e:o.kind===ro.Kind.INTERFACE&&null!=t.constructor&&null!=(i=t.constructor.$metadata$)&&function t(e,n){if(null==e)return!1;var r,i=e.interfaces;for(r=0;r>24},ro.toChar=function(t){return 65535&t},ro.numberToLong=function(t){return t instanceof ro.Long?t:ro.Long.fromNumber(t)},ro.numberToInt=function(t){return t instanceof ro.Long?t.toInt():0|t},ro.toBoxedChar=function(t){return null==t?t:t instanceof ro.BoxedChar?t:new ro.BoxedChar(t)},ro.unboxChar=function(t){return null==t?t:ro.toChar(t)},ro.isArrayish=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)},ro.arrayToString=function(t){return"["+t.map(ro.toString).join(", ")+"]"},function(){"use strict";function t(){r(),this.name$="",this.ordinal$=0}function e(){n=this}Object.defineProperty(t.prototype,"name",{get:function(){return this.name$}}),Object.defineProperty(t.prototype,"ordinal",{get:function(){return this.ordinal$}}),t.prototype.compareTo_11rb$=function(t){return ro.primitiveCompareTo(this.ordinal,t.ordinal)},t.prototype.equals=function(t){return this===t},t.prototype.hashCode=function(){return ro.identityHashCode(this)},t.prototype.toString=function(){return this.name},e.$metadata$={kind:ro.Kind.OBJECT,simpleName:"Companion",interfaces:[]};var n=null;function r(){return null===n&&new e,n}function i(){(o=this).MIN_VALUE=Number.MIN_VALUE,this.MAX_VALUE=Number.MAX_VALUE,this.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,this.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,this.NaN=Number.NaN}t.$metadata$={kind:ro.Kind.CLASS,simpleName:"Enum",interfaces:[u]},i.$metadata$={kind:ro.Kind.OBJECT,simpleName:"DoubleCompanionObject",interfaces:[]};var o=null;function a(){(s=this).MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647}a.$metadata$={kind:ro.Kind.OBJECT,simpleName:"IntCompanionObject",interfaces:[]};var s=null;function u(){}u.$metadata$={kind:ro.Kind.INTERFACE,simpleName:"Comparable",interfaces:[]},Object.defineProperty(t,"Companion",{get:r});var l=io.kotlin||(io.kotlin={});l.Enum=t,io.newArray=function(t,e){return function(t,e){var n;n=t.length-1|0;for(var r=0;r<=n;r++)t[r]=e;return t}(Array(t),e)};var c=l.js||(l.js={}),p=c.internal||(c.internal={});Object.defineProperty(p,"DoubleCompanionObject",{get:function(){return null===o&&new i,o}}),Object.defineProperty(p,"IntCompanionObject",{get:function(){return null===s&&new a,s}}),l.Comparable=u}(),function(){"use strict";var t=ro.kotlin.Comparable,i=Object,e=ro.arrayToString,n=Error,r=ro.kotlin.js.internal.DoubleCompanionObject,f=ro.kotlin.js.internal.IntCompanionObject;ro.kotlin.Enum;function o(t){this.closure$arr=t,this.index=0}function a(t){this.closure$array=t,fn.call(this),this.index=0}function s(t){return new a(t)}function u(t){this.closure$array=t,on.call(this),this.index=0}function l(t){return new u(t)}function c(t){this.closure$array=t,sn.call(this),this.index=0}function p(t){return new c(t)}function h(t){this.closure$array=t,an.call(this),this.index=0}function d(t){return new h(t)}function _(t){this.closure$array=t,un.call(this),this.index=0}function m(t){return new _(t)}function $(t){this.closure$array=t,cn.call(this),this.index=0}function y(t){return new $(t)}function g(t){this.closure$array=t,pn.call(this),this.index=0}function v(t){return new g(t)}function b(t){this.closure$array=t,ln.call(this),this.index=0}function x(t){return new b(t)}function w(t){this.c=t}function C(t){for(var e=[],n=t.iterator();n.hasNext();)e.push(n.next());return e}function S(t,e){var n;if(e.lengththis.last:this.firstthis.last},Cn.prototype.equals=function(t){return ro.isType(t,Cn)&&(this.isEmpty()&&t.isEmpty()||this.first===t.first&&this.last===t.last)},Cn.prototype.hashCode=function(){return this.isEmpty()?-1:(31*this.first|0)+this.last|0},Cn.prototype.toString=function(){return this.first.toString()+".."+this.last},Sn.$metadata$={kind:ro.Kind.OBJECT,simpleName:"Companion",interfaces:[]};var kn=null;function Nn(){return null===kn&&new Sn,kn}function In(t,e){zn(),gn.call(this,t,e,ro.Long.ONE)}function En(){(On=this).EMPTY=new In(ro.Long.ONE,ro.Long.ZERO)}Cn.$metadata$={kind:ro.Kind.CLASS,simpleName:"IntRange",interfaces:[wn,_n]},Object.defineProperty(In.prototype,"start",{get:function(){return this.first}}),Object.defineProperty(In.prototype,"endInclusive",{get:function(){return this.last}}),In.prototype.contains_mef7kx$=function(t){return this.first.compareTo_11rb$(t)<=0&&t.compareTo_11rb$(this.last)<=0},In.prototype.isEmpty=function(){return 0 toIndex: "+e)},cr.prototype.orderedHashCode_nykoif$=function(t){var e,n,r=1;for(e=t.iterator();e.hasNext();){var i=e.next();r=(31*r|0)+(null!=(n=null!=i?ro.hashCode(i):null)?n:0)|0}return r},cr.prototype.orderedEquals_e92ka7$=function(t,e){var n;if(t.size!==e.size)return!1;var r=e.iterator();for(n=t.iterator();n.hasNext();){var i=n.next(),o=r.next();if(!ro.equals(i,o))return!1}return!0},cr.$metadata$={kind:ro.Kind.OBJECT,simpleName:"Companion",interfaces:[]};var pr=null;function fr(){return null===pr&&new cr,pr}function hr(){vr(),this._keys_gfqcsa$_0=null,this._values_gfqcsa$_0=null}function dr(t){this.this$AbstractMap=t,br.call(this)}function _r(t){this.closure$entryIterator=t}function mr(t){this.this$AbstractMap=t,or.call(this)}function $r(t){this.closure$entryIterator=t}function yr(){gr=this}ar.$metadata$={kind:ro.Kind.CLASS,simpleName:"AbstractList",interfaces:[Ue,or]},hr.prototype.containsKey_11rb$=function(t){return null!=this.implFindEntry_cbwyw1$_0(t)},hr.prototype.containsValue_11rc$=function(t){var e,n=this.entries;t:do{var r;for(r=n.iterator();r.hasNext();){var i=r.next();if(ro.equals(i.value,t)){e=!0;break t}}e=!1}while(0);return e},hr.prototype.containsEntry_8hxqw4$=function(t){if(!ro.isType(t,Ze))return!1;var e=t.key,n=t.value,r=(ro.isType(this,io.kotlin.collections.Map)?this:ro.throwCCE()).get_11rb$(e);if(!ro.equals(n,r))return!1;var i=null==r;i&&(i=!(ro.isType(this,io.kotlin.collections.Map)?this:ro.throwCCE()).containsKey_11rb$(e));return!i},hr.prototype.equals=function(t){if(t===this)return!0;if(!ro.isType(t,Ge))return!1;if(this.size!==t.size)return!1;var e,n=t.entries;t:do{var r;for(r=n.iterator();r.hasNext();){var i=r.next();if(!this.containsEntry_8hxqw4$(i)){e=!1;break t}}e=!0}while(0);return e},hr.prototype.get_11rb$=function(t){var e;return null!=(e=this.implFindEntry_cbwyw1$_0(t))?e.value:null},hr.prototype.hashCode=function(){return ro.hashCode(this.entries)},hr.prototype.isEmpty=function(){return 0===this.size},Object.defineProperty(hr.prototype,"size",{get:function(){return this.entries.size}}),dr.prototype.contains_11rb$=function(t){return this.this$AbstractMap.containsKey_11rb$(t)},_r.prototype.hasNext=function(){return this.closure$entryIterator.hasNext()},_r.prototype.next=function(){return this.closure$entryIterator.next().key},_r.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},dr.prototype.iterator=function(){return new _r(this.this$AbstractMap.entries.iterator())},Object.defineProperty(dr.prototype,"size",{get:function(){return this.this$AbstractMap.size}}),dr.$metadata$={kind:ro.Kind.CLASS,interfaces:[br]},Object.defineProperty(hr.prototype,"keys",{get:function(){var t;return null==this._keys_gfqcsa$_0&&(this._keys_gfqcsa$_0=new dr(this)),null!=(t=this._keys_gfqcsa$_0)?t:ro.throwNPE()}}),hr.prototype.toString=function(){return re(this.entries,", ","{","}",void 0,void 0,(e=this,function(t){return e.toString_pmt6ib$_0(t)}));var e},hr.prototype.toString_pmt6ib$_0=function(t){return this.toString_w3q7ga$_0(t.key)+"="+this.toString_w3q7ga$_0(t.value)},hr.prototype.toString_w3q7ga$_0=function(t){return t===this?"(this Map)":ro.toString(t)},mr.prototype.contains_11rb$=function(t){return this.this$AbstractMap.containsValue_11rc$(t)},$r.prototype.hasNext=function(){return this.closure$entryIterator.hasNext()},$r.prototype.next=function(){return this.closure$entryIterator.next().value},$r.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},mr.prototype.iterator=function(){return new $r(this.this$AbstractMap.entries.iterator())},Object.defineProperty(mr.prototype,"size",{get:function(){return this.this$AbstractMap.size}}),mr.$metadata$={kind:ro.Kind.CLASS,interfaces:[or]},Object.defineProperty(hr.prototype,"values",{get:function(){var t;return null==this._values_gfqcsa$_0&&(this._values_gfqcsa$_0=new mr(this)),null!=(t=this._values_gfqcsa$_0)?t:ro.throwNPE()}}),hr.prototype.implFindEntry_cbwyw1$_0=function(t){var e,n=this.entries;t:do{var r;for(r=n.iterator();r.hasNext();){var i=r.next();if(ro.equals(i.key,t)){e=i;break t}}e=null}while(0);return e},yr.prototype.entryHashCode_9fthdn$=function(t){var e,n,r,i;return(null!=(n=null!=(e=t.key)?ro.hashCode(e):null)?n:0)^(null!=(i=null!=(r=t.value)?ro.hashCode(r):null)?i:0)},yr.prototype.entryToString_9fthdn$=function(t){return ro.toString(t.key)+"="+ro.toString(t.value)},yr.prototype.entryEquals_js7fox$=function(t,e){return!!ro.isType(e,Ze)&&(ro.equals(t.key,e.key)&&ro.equals(t.value,e.value))},yr.$metadata$={kind:ro.Kind.OBJECT,simpleName:"Companion",interfaces:[]};var gr=null;function vr(){return null===gr&&new yr,gr}function br(){Cr(),or.call(this)}function xr(){wr=this}hr.$metadata$={kind:ro.Kind.CLASS,simpleName:"AbstractMap",interfaces:[Ge]},br.prototype.equals=function(t){return t===this||!!ro.isType(t,We)&&Cr().setEquals_y8f7en$(this,t)},br.prototype.hashCode=function(){return Cr().unorderedHashCode_nykoif$(this)},xr.prototype.unorderedHashCode_nykoif$=function(t){var e,n=0;for(e=t.iterator();e.hasNext();){var r,i=e.next();n=n+(null!=(r=null!=i?ro.hashCode(i):null)?r:0)|0}return n},xr.prototype.setEquals_y8f7en$=function(t,e){return t.size===e.size&&t.containsAll_brywnq$(e)},xr.$metadata$={kind:ro.Kind.OBJECT,simpleName:"Companion",interfaces:[]};var wr=null;function Cr(){return null===wr&&new xr,wr}function Sr(){kr=this}br.$metadata$={kind:ro.Kind.CLASS,simpleName:"AbstractSet",interfaces:[We,or]},Sr.prototype.hasNext=function(){return!1},Sr.prototype.hasPrevious=function(){return!1},Sr.prototype.nextIndex=function(){return 0},Sr.prototype.previousIndex=function(){return-1},Sr.prototype.next=function(){throw new Ot},Sr.prototype.previous=function(){throw new Ot},Sr.$metadata$={kind:ro.Kind.OBJECT,simpleName:"EmptyIterator",interfaces:[nn]};var kr=null;function Nr(){return null===kr&&new Sr,kr}function Ir(){(Er=this).serialVersionUID_0=new ro.Long(-1478467534,-1720727600)}Ir.prototype.equals=function(t){return ro.isType(t,Ue)&&t.isEmpty()},Ir.prototype.hashCode=function(){return 1},Ir.prototype.toString=function(){return"[]"},Object.defineProperty(Ir.prototype,"size",{get:function(){return 0}}),Ir.prototype.isEmpty=function(){return!0},Ir.prototype.contains_11rb$=function(t){return!1},Ir.prototype.containsAll_brywnq$=function(t){return t.isEmpty()},Ir.prototype.get_za3lpa$=function(t){throw new St("Empty list doesn't contain element at index "+t+".")},Ir.prototype.indexOf_11rb$=function(t){return-1},Ir.prototype.lastIndexOf_11rb$=function(t){return-1},Ir.prototype.iterator=function(){return Nr()},Ir.prototype.listIterator=function(){return Nr()},Ir.prototype.listIterator_za3lpa$=function(t){if(0!==t)throw new St("Index: "+t);return Nr()},Ir.prototype.subList_vux9f0$=function(t,e){if(0===t&&0===e)return this;throw new St("fromIndex: "+t+", toIndex: "+e)},Ir.prototype.readResolve_0=function(){return Or()},Ir.$metadata$={kind:ro.Kind.OBJECT,simpleName:"EmptyList",interfaces:[_t,_e,Ue]};var Er=null;function Or(){return null===Er&&new Ir,Er}function zr(t,e){this.values=t,this.isVarargs=e}function Lr(){return Or()}function Tr(t){return 0===t.length?B():D(new zr(t,!0))}function Ar(t){return new Cn(0,t.size-1|0)}function jr(t){return t.size-1|0}function Pr(t){var e;return 0===(e=t.size)?Lr():1===e?k(t.get_za3lpa$(0)):t}function qr(t,e){return ro.isType(t,Fe)?t.size:e}function Mr(t,e){return ro.isType(t,We)?t:ro.isType(t,Fe)?ro.isType(e,Fe)&&e.size<2?t:2<(n=t).size&&ro.isType(n,K)?Zt(t):t:Zt(t);var n}Object.defineProperty(zr.prototype,"size",{get:function(){return this.values.length}}),zr.prototype.isEmpty=function(){return 0===this.values.length},zr.prototype.contains_11rb$=function(t){return zt(this.values,t)},zr.prototype.containsAll_brywnq$=function(t){var e;t:do{var n;for(n=t.iterator();n.hasNext();){var r=n.next();if(!this.contains_11rb$(r)){e=!1;break t}}e=!0}while(0);return e},zr.prototype.iterator=function(){return ro.arrayIterator(this.values)},zr.prototype.toArray=function(){var t=this.values;return this.isVarargs?t:t.slice()},zr.$metadata$={kind:ro.Kind.CLASS,simpleName:"ArrayAsCollection",interfaces:[Fe]};var Rr;function Kr(t){return t<3?t+1|0:t=this.startIndex_0)){var o="endIndex should be not less than startIndex, but was "+this.endIndex_0+" < "+this.startIndex_0;throw new io.kotlin.IllegalArgumentException(o.toString())}}function ri(t){this.this$SubSequence=t,this.iterator=t.sequence_0.iterator(),this.position=0}function ii(t,e){if(this.sequence_0=t,this.count_0=e,!(0<=this.count_0)){var n="count must be non-negative, but was "+this.count_0+".";throw new io.kotlin.IllegalArgumentException(n.toString())}}function oi(t){this.left=t.count_0,this.iterator=t.sequence_0.iterator()}function ai(t,e){this.getInitialValue_0=t,this.getNextValue_0=e}function si(t){this.this$GeneratorSequence=t,this.nextItem=null,this.nextState=-2}function ui(t,e){return new ai(t,e)}function li(){(ci=this).serialVersionUID_0=new ro.Long(1993859828,793161749)}Xr.prototype.next=function(){return this.this$TransformingSequence.transformer_0(this.iterator.next())},Xr.prototype.hasNext=function(){return this.iterator.hasNext()},Xr.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},Yr.prototype.iterator=function(){return new Xr(this)},Yr.prototype.flatten_1tglza$=function(t){return new Qr(this.sequence_0,this.transformer_0,t)},Yr.$metadata$={kind:ro.Kind.CLASS,simpleName:"TransformingSequence",interfaces:[Ur]},ti.prototype.next=function(){var t;if(!this.ensureItemIterator_0())throw new Ot;return(null!=(t=this.itemIterator)?t:ro.throwNPE()).next()},ti.prototype.hasNext=function(){return this.ensureItemIterator_0()},ti.prototype.ensureItemIterator_0=function(){var t;for(!1===(null!=(t=this.itemIterator)?t.hasNext():null)&&(this.itemIterator=null);null==this.itemIterator;){if(!this.iterator.hasNext())return!1;var e=this.iterator.next(),n=this.this$FlatteningSequence.iterator_0(this.this$FlatteningSequence.transformer_0(e));if(n.hasNext())return this.itemIterator=n,!0}return!0},ti.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},Qr.prototype.iterator=function(){return new ti(this)},Qr.$metadata$={kind:ro.Kind.CLASS,simpleName:"FlatteningSequence",interfaces:[Ur]},ei.$metadata$={kind:ro.Kind.INTERFACE,simpleName:"DropTakeSequence",interfaces:[Ur]},Object.defineProperty(ni.prototype,"count_0",{get:function(){return this.endIndex_0-this.startIndex_0|0}}),ni.prototype.drop_za3lpa$=function(t){return t>=this.count_0?Wr():new ni(this.sequence_0,this.startIndex_0+t|0,this.endIndex_0)},ni.prototype.take_za3lpa$=function(t){return t>=this.count_0?this:new ni(this.sequence_0,this.startIndex_0,this.startIndex_0+t|0)},ri.prototype.drop_0=function(){for(;this.position=this.this$SubSequence.endIndex_0)throw new Ot;return this.position=this.position+1|0,this.iterator.next()},ri.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},ni.prototype.iterator=function(){return new ri(this)},ni.$metadata$={kind:ro.Kind.CLASS,simpleName:"SubSequence",interfaces:[ei,Ur]},ii.prototype.drop_za3lpa$=function(t){return t>=this.count_0?Wr():new ni(this.sequence_0,t,this.count_0)},ii.prototype.take_za3lpa$=function(t){return t>=this.count_0?this:new ii(this.sequence_0,t)},oi.prototype.next=function(){if(0===this.left)throw new Ot;return this.left=this.left-1|0,this.iterator.next()},oi.prototype.hasNext=function(){return 0(t.length-i|0)||r>(n.length-i|0))return!1;a=i-1|0;for(var s=0;s<=a;s++)if(!_i(ro.unboxChar(t.charCodeAt(e+s|0)),ro.unboxChar(n.charCodeAt(r+s|0)),o))return!1;return!0}function Ni(t,e,n){return void 0===n&&(n=!1),0=this.this$DelimitedRangesSequence.limit_0)||this.nextSearchIndex>this.this$DelimitedRangesSequence.input_0.length)this.nextItem=new Cn(this.currentStartIndex,Ci(this.this$DelimitedRangesSequence.input_0)),this.nextSearchIndex=-1;else{var t=this.this$DelimitedRangesSequence.getNextMatch_0(this.this$DelimitedRangesSequence.input_0,this.nextSearchIndex);if(null==t)this.nextItem=new Cn(this.currentStartIndex,Ci(this.this$DelimitedRangesSequence.input_0)),this.nextSearchIndex=-1;else{var e=t,n=e.component1(),r=e.component2();this.nextItem=new Cn(this.currentStartIndex,n-1|0),this.currentStartIndex=n+r|0,this.nextSearchIndex=this.currentStartIndex+(0===r?1:0)|0}}this.nextState=1}},Pi.prototype.next=function(){var t;if(-1===this.nextState&&this.calcNext_0(),0===this.nextState)throw new Ot;var e=ro.isType(t=this.nextItem,Cn)?t:ro.throwCCE();return this.nextItem=null,this.nextState=-1,e},Pi.prototype.hasNext=function(){return-1===this.nextState&&this.calcNext_0(),1===this.nextState},Pi.$metadata$={kind:ro.Kind.CLASS,interfaces:[tn]},ji.prototype.iterator=function(){return new Pi(this)},ji.$metadata$={kind:ro.Kind.CLASS,simpleName:"DelimitedRangesSequence",interfaces:[Ur]};function Ki(){}function Bi(){}function Di(t){this.match=t}Ki.$metadata$={kind:ro.Kind.INTERFACE,simpleName:"MatchGroupCollection",interfaces:[Fe]},Object.defineProperty(Bi.prototype,"destructured",{get:function(){return new Di(this)}}),Di.prototype.component1=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component1",function(){return this.match.groupValues.get_za3lpa$(1)}),Di.prototype.component2=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component2",function(){return this.match.groupValues.get_za3lpa$(2)}),Di.prototype.component3=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component3",function(){return this.match.groupValues.get_za3lpa$(3)}),Di.prototype.component4=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component4",function(){return this.match.groupValues.get_za3lpa$(4)}),Di.prototype.component5=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component5",function(){return this.match.groupValues.get_za3lpa$(5)}),Di.prototype.component6=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component6",function(){return this.match.groupValues.get_za3lpa$(6)}),Di.prototype.component7=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component7",function(){return this.match.groupValues.get_za3lpa$(7)}),Di.prototype.component8=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component8",function(){return this.match.groupValues.get_za3lpa$(8)}),Di.prototype.component9=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component9",function(){return this.match.groupValues.get_za3lpa$(9)}),Di.prototype.component10=ro.defineInlineFunction("kotlin.kotlin.text.MatchResult.Destructured.component10",function(){return this.match.groupValues.get_za3lpa$(10)}),Di.prototype.toList=function(){return this.match.groupValues.subList_vux9f0$(1,this.match.groupValues.size)},Di.$metadata$={kind:ro.Kind.CLASS,simpleName:"Destructured",interfaces:[]},Bi.$metadata$={kind:ro.Kind.INTERFACE,simpleName:"MatchResult",interfaces:[]};function Fi(t){void 0===t&&(t="An operation is not implemented."),vt.call(this,t),this.name="NotImplementedError"}function Hi(t,e){this.first=t,this.second=e}function Ui(t,e){return new Hi(t,e)}Fi.$metadata$={kind:ro.Kind.CLASS,simpleName:"NotImplementedError",interfaces:[vt]},Hi.prototype.toString=function(){return"("+this.first+", "+this.second+")"},Hi.$metadata$={kind:ro.Kind.CLASS,simpleName:"Pair",interfaces:[_e]},Hi.prototype.component1=function(){return this.first},Hi.prototype.component2=function(){return this.second},Hi.prototype.copy_xwzc9p$=function(t,e){return new Hi(void 0===t?this.first:t,void 0===e?this.second:e)},Hi.prototype.hashCode=function(){var t=0;return t=31*(t=31*t+ro.hashCode(this.first)|0)+ro.hashCode(this.second)|0},Hi.prototype.equals=function(t){return this===t||null!==t&&"object"==typeof t&&Object.getPrototypeOf(this)===Object.getPrototypeOf(t)&&ro.equals(this.first,t.first)&&ro.equals(this.second,t.second)};var Ji=io.kotlin||(io.kotlin={}),Wi=Ji.js||(Ji.js={});io.arrayIterator=function(t,e){if(null==e)return new o(t);if(ro.equals(e,"BooleanArray"))return s(t);if(ro.equals(e,"ByteArray"))return l(t);if(ro.equals(e,"ShortArray"))return p(t);if(ro.equals(e,"CharArray"))return d(t);if(ro.equals(e,"IntArray"))return m(t);if(ro.equals(e,"LongArray"))return x(t);if(ro.equals(e,"FloatArray"))return y(t);if(ro.equals(e,"DoubleArray"))return v(t);throw new Ct("Unsupported type argument for arrayIterator: "+ro.toString(e))},io.booleanArrayIterator=s,io.byteArrayIterator=l,io.shortArrayIterator=p,io.charArrayIterator=d,io.intArrayIterator=m,io.floatArrayIterator=y,io.doubleArrayIterator=v,io.longArrayIterator=x,io.subSequence=function(t,e,n){return"string"==typeof t?t.substring(e,n):t.subSequence_vux9f0$(e,n)},io.captureStack=function(t,e){Error.captureStackTrace?Error.captureStackTrace(e,Me(ro.getKClassFromExpression(e))):e.stack=(new Error).stack},io.BoxedChar=w;var Vi=Ji.text||(Ji.text={}),Gi=Ji.collections||(Ji.collections={});Gi.copyToArray=function(t){return void 0!==t.toArray?t.toArray():C(t)},Gi.copyToArrayImpl=C,Gi.copyToExistingArrayImpl=S,Gi.listOf_mh5how$=k,Gi.setOf_mh5how$=N,Gi.AbstractMutableCollection=I,Gi.AbstractMutableList=E,T.SimpleEntry_init_trwmqg$=function(t,e){return e=e||Object.create(A.prototype),A.call(e,t.key,t.value),e},T.SimpleEntry=A,Gi.AbstractMutableMap=T,Gi.AbstractMutableSet=R,Gi.ArrayList_init_ww73n8$=B,Gi.ArrayList_init_mqih57$=D,Gi.ArrayList=K,Object.defineProperty(F,"HashCode",{get:W}),Gi.EqualityComparator=F,Gi.HashMap_init_va96d4$=Z,Gi.HashMap_init_q3lmfv$=Y,Gi.HashMap_init_xf5xz2$=X,Gi.HashMap=V,Gi.HashSet_init_287e2$=function(t){return t=t||Object.create(Q.prototype),R.call(t),Q.call(t),t.map_biaydw$_0=Y(),t},Gi.HashSet_init_2wofer$=tt,Gi.HashSet_init_nn01ho$=et,Gi.HashSet=Q,Gi.InternalHashCodeMap=nt,Gi.InternalMap=it,Gi.LinkedHashMap_init_q3lmfv$=lt,Gi.LinkedHashMap_init_xf5xz2$=ct,Gi.LinkedHashMap=ot,Gi.LinkedHashSet_init_287e2$=ft,Gi.LinkedHashSet_init_mqih57$=ht,Gi.LinkedHashSet_init_2wofer$=dt,Gi.LinkedHashSet=pt,Gi.RandomAccess=_t;var Zi=Ji.io||(Ji.io={});Zi.NodeJsOutput=$t,Zi.BufferedOutput=yt,Zi.BufferedOutputToConsoleLog=gt,Zi.println_s8jyv4$=function(t){U.println_s8jyv4$(t)},io.throwNPE=function(t){throw new It(t)},io.throwCCE=function(){throw new Et("Illegal cast")},io.throwISE=function(t){throw new Ct(t)},Ji.Error=vt,Ji.Exception=bt,Ji.RuntimeException=xt,Ji.IllegalArgumentException=wt,Ji.IllegalStateException=Ct,Ji.IndexOutOfBoundsException=St,Ji.UnsupportedOperationException=kt,Ji.NumberFormatException=Nt,Ji.NullPointerException=It,Ji.ClassCastException=Et,Ji.NoSuchElementException=Ot,Gi.contains_mjy6jw$=zt,Gi.contains_o2f9me$=Lt,Gi.get_lastIndex_m7z4lg$=Rt,Gi.get_lastIndex_355ntz$=Kt,Gi.indexOf_mjy6jw$=Tt,Gi.indexOf_o2f9me$=At,Gi.get_indices_m7z4lg$=qt,Gi.get_indices_355ntz$=Mt,Gi.reversed_7wnvza$=Vt,Gi.lastIndexOf_mjy6jw$=jt,Gi.single_355ntz$=Pt;var Yi=Ji.ranges||(Ji.ranges={});Yi.downTo_dqglrj$=oe,Gi.emptyList_287e2$=Lr,Gi.mapCapacity_za3lpa$=Kr,Yi.coerceAtLeast_dqglrj$=ae,Gi.toCollection_5n4o2z$=Bt,Gi.collectionSizeOrDefault_ba2ldo$=qr,Gi.asList_us0mfu$=Dt,Gi.get_lastIndex_55thoc$=jr,Gi.first_2p1efm$=function(t){if(t.isEmpty())throw new Ot("List is empty.");return t.get_za3lpa$(0)},Gi.last_7wnvza$=Ft,Gi.last_2p1efm$=Ht,Gi.single_7wnvza$=Ut,Gi.single_2p1efm$=Jt,Gi.drop_ba2ldo$=function(t,e){var n,r,i,o,a;if(!(0<=e)){var s="Requested element count "+e+" is less than zero.";throw new io.kotlin.IllegalArgumentException(s.toString())}if(0===e)return Yt(t);if(ro.isType(t,Fe)){var u=t.size-e|0;if(u<=0)return Lr();if(1===u)return k(Ft(t));if(a=B(u),ro.isType(t,Ue)){if(ro.isType(t,_t)){n=t.size-1|0;for(var l=e;l<=n;l++)a.add_11rb$(t.get_za3lpa$(l))}else for(r=t.listIterator_za3lpa$(e);r.hasNext();){var c=r.next();a.add_11rb$(c)}return a}}else a=B();var p=0;for(i=t.iterator();i.hasNext();){var f=i.next();p=(o=p)+1|0,e<=o&&a.add_11rb$(f)}return Pr(a)},Gi.toList_7wnvza$=Yt,Gi.reverse_vvxzk3$=Wt,Gi.toCollection_5cfyqp$=Gt,Gi.toHashSet_7wnvza$=Zt,Gi.toMutableList_7wnvza$=Xt,Gi.toMutableList_4c7yge$=Qt,Gi.toSet_7wnvza$=te,Gi.intersect_q4559j$=function(t,e){var n=ee(t);return Hr(n,e),n},Gi.toMutableSet_7wnvza$=ee,Gi.joinTo_gcc71v$=ne,Gi.joinToString_fmv235$=re,Gi.asSequence_7wnvza$=ie,Yi.reversed_zf1xzc$=function(t){return yn().fromClosedRange_qt1dr2$(t.last,t.first,-t.step)},Yi.until_dqglrj$=function(t,e){return e<=f.MIN_VALUE?Nn().EMPTY:new Cn(t,e-1|0)},Yi.coerceAtMost_dqglrj$=se,Yi.coerceIn_e4yvb3$=ue;var Xi=Ji.sequences||(Ji.sequences={});Xi.Sequence=Ur,Xi.take_wuwhe2$=le,Xi.toCollection_gtszxp$=ce,Xi.toList_veqyi0$=pe,Xi.toMutableList_veqyi0$=fe,Xi.map_z5avom$=he,Vi.get_lastIndex_gw00vp$=Ci,Vi.first_gw00vp$=function(t){if(0===t.length)throw new Ot("Char sequence is empty.");return ro.unboxChar(t.charCodeAt(0))},Vi.iterator_gw00vp$=function(t){return new wi(t)},Vi.get_indices_gw00vp$=function(t){return new Cn(0,t.length-1|0)},Vi.last_gw00vp$=function(t){if(0===t.length)throw new Ot("Char sequence is empty.");return ro.unboxChar(t.charCodeAt(Ci(t)))},Vi.drop_6ic1pp$=function(t,e){if(0<=e)return t.substring(se(e,t.length));var n="Requested character count "+e+" is less than zero.";throw new io.kotlin.IllegalArgumentException(n.toString())},Vi.dropLast_6ic1pp$=function(t,e){if(0<=e)return de(t,ae(t.length-e|0,0));var n="Requested character count "+e+" is less than zero.";throw new io.kotlin.IllegalArgumentException(n.toString())},Vi.take_6ic1pp$=de,Ji.Serializable=_e,Vi.toInt_pdl1vz$=function(t){var e;return null!=(e=$i(t))?e:ye(t)},Vi.toLong_pdl1vz$=function(t){var e;return null!=(e=gi(t))?e:ye(t)},Vi.toLong_6ic1pp$=function(t,e){var n;return null!=(n=vi(t,e))?n:ye(t)},Vi.checkRadix_za3lpa$=me,Vi.digitOf_xvg9q0$=$e,Ji.isNaN_yrwdxr$=ge,Ji.isInfinite_yrwdxr$=ve,Ji.isFinite_yrwdxr$=function(t){return!ve(t)&&!ge(t)},Vi.MatchGroup=be,Vi.StringBuilder_init_za3lpa$=function(t,e){return e=e||Object.create(Pe.prototype),Pe.call(e),e},Object.defineProperty(xe,"Companion",{get:ke}),Vi.Regex=xe,Vi.Regex_61zpoe$=Ne,Wi.reset_xjqeni$=Le,Vi.startsWith_7epoxm$=Te,Vi.endsWith_7epoxm$=function(t,e,n){return void 0===n&&(n=!1),n?Ae(t,t.length-e.length|0,e,0,e.length,n):t.endsWith(e)},Vi.regionMatches_h3ii2q$=Ae,Vi.Appendable=je,Vi.StringBuilder=Pe,Wi.get_jsClass_irb06o$=qe,Wi.get_js_1yb8b7$=Me;var Qi=Ji.reflect||(Ji.reflect={}),to=Qi.js||(Qi.js={});(to.internal||(to.internal={})).KClassImpl=Re,io.getKClassFromExpression=function(t){return function(t){var e,n=t.$metadata$;if(null!=n)if(null==n.$kClass$){var r=new Re(t);n.$kClass$=r,e=r}else e=n.$kClass$;else e=new Re(t);return e}(qe(t))},Ji.CharSequence=Ke,Gi.Iterable=Be,Gi.MutableIterable=De,Gi.Collection=Fe,Gi.MutableCollection=He,Gi.List=Ue,Gi.MutableList=Je,Gi.Set=We,Gi.MutableSet=Ve,Ge.Entry=Ze,Gi.Map=Ge,Ye.MutableEntry=Xe,Gi.MutableMap=Ye,Ji.Function=Qe,Gi.Iterator=tn,Gi.MutableIterator=en,Gi.ListIterator=nn,Gi.MutableListIterator=rn,Gi.ByteIterator=on,Gi.CharIterator=an,Gi.ShortIterator=sn,Gi.IntIterator=un,Gi.LongIterator=ln,Gi.FloatIterator=cn,Gi.DoubleIterator=pn,Gi.BooleanIterator=fn,Yi.IntProgressionIterator=hn,Yi.LongProgressionIterator=dn,Object.defineProperty(_n,"Companion",{get:yn}),Yi.IntProgression=_n,Object.defineProperty(gn,"Companion",{get:xn}),Yi.LongProgression=gn,Yi.ClosedRange=wn,Object.defineProperty(Cn,"Companion",{get:Nn}),Yi.IntRange=Cn,Object.defineProperty(In,"Companion",{get:zn}),Yi.LongRange=In,Object.defineProperty(Ji,"Unit",{get:function(){return null===Tn&&new Ln,Tn}});var eo=Ji.internal||(Ji.internal={});eo.getProgressionLastElement_cub51b$=Mn,eo.getProgressionLastElement_e84ct6$=Rn,Qi.KAnnotatedElement=Kn,Qi.KCallable=Bn,Qi.KClass=Dn,Qi.KClassifier=Fn,Qi.KDeclarationContainer=Hn,Qi.KFunction=Un,Jn.Accessor=Wn,Jn.Getter=Vn,Qi.KProperty=Jn,Gn.Setter=Zn,Qi.KMutableProperty=Gn,Yn.Getter=Xn,Qi.KProperty0=Yn,Qn.Setter=tr,Qi.KMutableProperty0=Qn,er.Getter=nr,Qi.KProperty1=er,rr.Setter=ir,Qi.KMutableProperty1=rr,Gi.AbstractCollection=or,Object.defineProperty(ar,"Companion",{get:fr}),Gi.AbstractList=ar,Object.defineProperty(hr,"Companion",{get:vr}),Gi.AbstractMap=hr,Object.defineProperty(br,"Companion",{get:Cr}),Gi.AbstractSet=br,Object.defineProperty(Gi,"EmptyIterator",{get:Nr}),Object.defineProperty(Gi,"EmptyList",{get:Or}),Gi.listOf_i5x0yv$=function(t){return 0>8)),this.prog_0.addToData_s8j3t7$(Q.toByte(l>>16)),this.prog_0.addToData_s8j3t7$(Q.toByte(l>>24))}catch(t){if(!Q.isType(t,v))throw t;this.prog_0.addDataRelocation_3m52m6$(this.prog_0.symbolPart_61zpoe$(u),this.prog_0.labelOffsetPart_61zpoe$(u),this.currentDataOffset_0-Ki().STATIC_BEGIN|0),this.prog_0.addToData_s8j3t7$(0),this.prog_0.addToData_s8j3t7$(0),this.prog_0.addToData_s8j3t7$(0),this.prog_0.addToData_s8j3t7$(0)}this.currentDataOffset_0=this.currentDataOffset_0+4|0}else if(Q.equals(t,".space")){Ar(e,1);try{for(var c=as(e.get_za3lpa$(0)),p=1;p<=c;p++)this.prog_0.addToData_s8j3t7$(0);this.currentDataOffset_0=this.currentDataOffset_0+c|0}catch(t){throw Q.isType(t,v)?nt(e.get_za3lpa$(0)+" not a valid argument"):t}}else if(Q.equals(t,".globl")){var f,h=Q.getCallableRef("makeLabelGlobal",function(t,e){return t.makeLabelGlobal_61zpoe$(e)}.bind(null,this.prog_0));for(f=e.iterator();f.hasNext();){h(f.next())}}else if(Q.equals(t,".align")){Ar(e,1);var d=as(e.get_za3lpa$(0));if(d<0||8>>12,o=r-(i<<12)|0,a=_(["lui",t.get_za3lpa$(1),i.toString()]),s=_(["addi",t.get_za3lpa$(1),t.get_za3lpa$(1),o.toString()]);return _([a,s])},An.$metadata$={kind:Q.Kind.OBJECT,simpleName:"LI",interfaces:[Me]};var jn=null;function Pn(){return null===jn&&new An,jn}function qn(){Me.call(Mn=this)}qn.prototype.invoke_qa4inh$=function(t,e){if(4===t.size){if(m(t.get_za3lpa$(3),40)){var n=t.get_za3lpa$(0),r=t.get_za3lpa$(1),i=t.get_za3lpa$(2),o=t.get_za3lpa$(3),a=t.get_za3lpa$(3).length-1|0;return c(_([n,r,i,o.substring(1,a)]))}return c(t)}Ar(t,3);var s=_(["auipc",t.get_za3lpa$(1),"0"]);e.addRelocation_j8eou1$(Ja,e.getOffset(),t.get_za3lpa$(2));var u=_([t.get_za3lpa$(0),t.get_za3lpa$(1),"0",t.get_za3lpa$(1)]);return e.addRelocation_j8eou1$(Ga,e.getOffset()+4|0,t.get_za3lpa$(2)),_([s,u])},qn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"Load",interfaces:[Me]};var Mn=null;function Rn(){return null===Mn&&new qn,Mn}function Kn(){Me.call(Bn=this)}Kn.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["addi",t.get_za3lpa$(1),t.get_za3lpa$(2),"0"]))},Kn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"MV",interfaces:[Me]};var Bn=null;function Dn(){return null===Bn&&new Kn,Bn}function Fn(){Me.call(Hn=this)}Fn.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["sub",t.get_za3lpa$(1),"x0",t.get_za3lpa$(2)]))},Fn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"NEG",interfaces:[Me]};var Hn=null;function Un(){return null===Hn&&new Fn,Hn}function Jn(){Me.call(Wn=this)}Jn.prototype.invoke_qa4inh$=function(t,e){return Ar(t,1),c(_(["addi","x0","x0","0"]))},Jn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"NOP",interfaces:[Me]};var Wn=null;function Vn(){return null===Wn&&new Jn,Wn}function Gn(){Me.call(Zn=this)}Gn.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["xori",t.get_za3lpa$(1),t.get_za3lpa$(2),"-1"]))},Gn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"NOT",interfaces:[Me]};var Zn=null;function Yn(){return null===Zn&&new Gn,Zn}function Xn(){Me.call(Qn=this)}Xn.prototype.invoke_qa4inh$=function(t,e){return Ar(t,1),c(_(["jalr","x0","x1","0"]))},Xn.$metadata$={kind:Q.Kind.OBJECT,simpleName:"RET",interfaces:[Me]};var Qn=null;function tr(){return null===Qn&&new Xn,Qn}function er(){Me.call(nr=this)}er.prototype.invoke_qa4inh$=function(t,e){Ar(t,4),jr();var n=_(["sub",t.get_za3lpa$(1),t.get_za3lpa$(2),t.get_za3lpa$(3)]),r=_(["sltiu",t.get_za3lpa$(1),t.get_za3lpa$(1),"1"]);return _([n,r])},er.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SEQ",interfaces:[Me]};var nr=null;function rr(){return null===nr&&new er,nr}function ir(){Me.call(or=this)}ir.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["sltiu",t.get_za3lpa$(1),t.get_za3lpa$(2),"1"]))},ir.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SEQZ",interfaces:[Me]};var or=null;function ar(){return null===or&&new ir,or}function sr(){Me.call(ur=this)}sr.prototype.invoke_qa4inh$=function(t,e){Ar(t,4),jr();var n=o(t.get_za3lpa$(0),"u")?"u":"",r=_(["slt"+n,t.get_za3lpa$(1),t.get_za3lpa$(2),t.get_za3lpa$(3)]),i=_(["xori",t.get_za3lpa$(1),t.get_za3lpa$(1),"1"]);return _([r,i])},sr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SGE",interfaces:[Me]};var ur=null;function lr(){return null===ur&&new sr,ur}function cr(){Me.call(pr=this)}cr.prototype.invoke_qa4inh$=function(t,e){Ar(t,4),jr();var n=o(t.get_za3lpa$(0),"u")?"u":"";return c(_(["slt"+n,t.get_za3lpa$(1),t.get_za3lpa$(3),t.get_za3lpa$(2)]))},cr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SGT",interfaces:[Me]};var pr=null;function fr(){return null===pr&&new cr,pr}function hr(){Me.call(dr=this)}hr.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["slt",t.get_za3lpa$(1),"x0",t.get_za3lpa$(2)]))},hr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SGTZ",interfaces:[Me]};var dr=null;function _r(){return null===dr&&new hr,dr}function mr(){Me.call($r=this)}mr.prototype.invoke_qa4inh$=function(t,e){Ar(t,4),jr();var n=o(t.get_za3lpa$(0),"u")?"u":"",r=_(["slt"+n,t.get_za3lpa$(1),t.get_za3lpa$(3),t.get_za3lpa$(2)]),i=_(["xori",t.get_za3lpa$(1),t.get_za3lpa$(1),"1"]);return _([r,i])},mr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SLE",interfaces:[Me]};var $r=null;function yr(){return null===$r&&new mr,$r}function gr(){Me.call(vr=this)}gr.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["slt",t.get_za3lpa$(1),t.get_za3lpa$(2),"x0"]))},gr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SLTZ",interfaces:[Me]};var vr=null;function br(){return null===vr&&new gr,vr}function xr(){Me.call(wr=this)}xr.prototype.invoke_qa4inh$=function(t,e){Ar(t,4),jr();var n=_(["sub",t.get_za3lpa$(1),t.get_za3lpa$(2),t.get_za3lpa$(3)]),r=_(["sltu",t.get_za3lpa$(1),"x0",t.get_za3lpa$(1)]);return _([n,r])},xr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SNE",interfaces:[Me]};var wr=null;function Cr(){return null===wr&&new xr,wr}function Sr(){Me.call(kr=this)}Sr.prototype.invoke_qa4inh$=function(t,e){return Ar(t,3),c(_(["sltu",t.get_za3lpa$(1),"x0",t.get_za3lpa$(2)]))},Sr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"SNEZ",interfaces:[Me]};var kr=null;function Nr(){return null===kr&&new Sr,kr}function Ir(){Me.call(Er=this)}Ir.prototype.invoke_qa4inh$=function(e,n){Ar(e,4);var t,r=m(e.get_za3lpa$(3),40),i=e.get_za3lpa$(2);if(r){var o=e.get_za3lpa$(3),a=e.get_za3lpa$(3).length-1|0;t=o.substring(1,a)}else t=e.get_za3lpa$(3);var s=t;try{return as(i),c(_([e.get_za3lpa$(0),e.get_za3lpa$(1),i,s]))}catch(t){if(!Q.isType(t,v))throw t;if(r)return n.addRelocation_j8eou1$(qa,n.getOffset(),i),c(_([e.get_za3lpa$(0),e.get_za3lpa$(1),"0",s]))}var u=_(["auipc",s,"0"]);n.addRelocation_j8eou1$(Ja,n.getOffset(),i);var l=_([e.get_za3lpa$(0),e.get_za3lpa$(1),"0",s]);return n.addRelocation_j8eou1$(Xa,n.getOffset()+4|0,i),_([u,l])},Ir.$metadata$={kind:Q.Kind.OBJECT,simpleName:"Store",interfaces:[Me]};var Er=null;function Or(){return null===Er&&new Ir,Er}function zr(){Me.call(Lr=this)}zr.prototype.invoke_qa4inh$=function(t,e){Ar(t,2);var n=_(["auipc","x6","0"]);e.addRelocation_j8eou1$(Ja,e.getOffset(),t.get_za3lpa$(1));var r=_(["jalr","x0","x6","0"]);return e.addRelocation_j8eou1$(Ga,e.getOffset()+4|0,t.get_za3lpa$(1)),_([n,r])},zr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"TAIL",interfaces:[Me]};var Lr=null;function Tr(){return null===Lr&&new zr,Lr}function Ar(t,e){if(t.size!==e)throw nt("wrong # of arguments")}function jr(){if(Hi().strict)throw nt("can't use this instruction in strict mode")}function Pr(){(qr=this).sim=this.sim,this.timer_0=null,this.TIMEOUT_CYCLES_8be2vx$=100,this.TIMEOUT_TIME_8be2vx$=10}Pr.prototype.openSimulator=function(){this.assemble_y4putb$(this.getText_8be2vx$())&&Br().renderSimulator_vo69o7$(this.sim)},Pr.prototype.openEditor=function(){this.runEnd_8be2vx$(),Br().renderEditor()},Pr.prototype.getText_8be2vx$=function(){var t;return(Q.isType(t=document.getElementById("asm-editor"),HTMLTextAreaElement)?t:Q.throwCCE()).value},Pr.prototype.assemble_y4putb$=function(t){var e=q().assemble_61zpoe$(t),n=e.component1(),r=e.component2();if(!r.isEmpty())return Br().displayError_k2a3eh$(a(r)),!1;try{var i=di().link_1l4nab$(c(n));return this.sim=new ps(i),!0}catch(t){if(Q.isType(t,U))return Br().displayError_k2a3eh$(t),!1;throw t}},Pr.prototype.run=function(){this.currentlyRunning_8be2vx$()?this.runEnd_8be2vx$():(Br().setRunButtonSpinning_6taknv$(!0),this.timer_0=window.setTimeout(Q.getCallableRef("runStart",function(t){return t.runStart_8be2vx$()}.bind(null,Mr())),this.TIMEOUT_TIME_8be2vx$),this.sim.step())},Pr.prototype.reset=function(){this.openSimulator()},Pr.prototype.toggleBreakpoint=function(t){var e=this.sim.toggleBreakpointAt_za3lpa$(t);Br().renderBreakpointAt_fzusl$(t,e)},Pr.prototype.runStart_8be2vx$=function(){for(var t=0;t>2<<2;this.mustMoveMemoryDisplay_0(n)&&(this.activeMemoryAddress_0=n),e=this.MEMORY_CONTEXT;for(var r=-6;r<=e;r++){var i=this.getElement_61zpoe$("mem-row-"+r),o=this.activeMemoryAddress_0+(4*r|0)|0;this.renderMemoryRow_0(i,o)}},Rr.prototype.mustMoveMemoryDisplay_0=function(t){return!new y(-6,this.MEMORY_CONTEXT).contains_mef7kx$(this.activeMemoryAddress_0-t>>2)},Rr.prototype.renderMemoryRow_0=function(t,e){var n,r,i,o,a,s=Q.isType(n=t.childNodes[0],HTMLTableCellElement)?n:Q.throwCCE();if(0<=e){s.innerText=this.toHex_za3lpa$(e);for(var u=1;u<=4;u++){var l=Q.isType(r=t.childNodes[u],HTMLTableCellElement)?r:Q.throwCCE(),c=this.sim_0.loadByte_za3lpa$(e+u-1|0);i=this.displayType_0,o=Q.equals(i,"Hex")?this.byteToHex_0(c):Q.equals(i,"Decimal")?this.byteToDec_0(c):Q.equals(i,"Unsigned")?this.byteToUnsign_0(c):Q.equals(i,"ASCII")?this.toAscii_0(c):this.byteToHex_0(c),l.innerText=o}}else{s.innerText="----------";for(var p=1;p<=4;p++){(Q.isType(a=t.childNodes[p],HTMLTableCellElement)?a:Q.throwCCE()).innerText="--"}}},Rr.prototype.byteToHex_0=function(t){var e=Q.unboxChar(this.hexMap_0.get_za3lpa$(t>>>4)),n=Q.unboxChar(this.hexMap_0.get_za3lpa$(15&t));return String.fromCharCode(Q.unboxChar(e))+String.fromCharCode(Q.unboxChar(n))},Rr.prototype.byteToDec_0=function(t){return Q.toByte(t).toString()},Rr.prototype.byteToUnsign_0=function(t){return t.toString()},Rr.prototype.toHex_za3lpa$=function(t){var e={v:Q.Long.fromInt(t)},n={v:""};for(var r=0;r<=7;r++){var i=Q.unboxChar(this.hexMap_0.get_za3lpa$(e.v.and(Q.Long.fromInt(15)).toInt())),o=Q.unboxChar(i);n.v=String.fromCharCode(Q.toBoxedChar(o))+n.v,e.v=e.v.shiftRightUnsigned(4)}return"0x"+n.v},Rr.prototype.toUnsigned_0=function(t){return 0<=t?t.toString():Q.Long.fromInt(t).add(new Q.Long(0,1)).toString()},Rr.prototype.toAscii_0=function(t){return t<0||255=Ki().STATIC_BEGIN?d:h)+y|0;if(_.isGlobalLabel_61zpoe$($)){if(null!=c.put_xwzc9p$($,g))throw nt("label "+$+" defined global in two different files");Q.equals($,"main")&&(l.startPC=g)}}var v,b,x=_.insts,w=Q.getCallableRef("add",function(t,e){return t.add_4vgyas$(e)}.bind(null,l.prog));for(v=x.iterator();v.hasNext();){w(v.next())}for(b=_.debugInfo.iterator();b.hasNext();){var C=b.next();l.dbg.add_11rb$(new Dr(_.name,C))}var S,k=_.dataSegment,N=Q.getCallableRef("addToData",function(t,e){return t.addToData_s8j3t7$(e)}.bind(null,l.prog));for(S=k.iterator();S.hasNext();){N(S.next())}for(r=_.relocationTable.iterator();r.hasNext();){var I=r.next(),E=I.component1(),O=I.component2(),z=I.component3(),L=I.component4(),T=h+O|0,A=l.prog.insts.get_za3lpa$(T/4|0);if(Q.equals(z,""))E.invoke_6r4k1d$(A,T,L);else{var j=_.labels.get_11rb$(z);null!=j?E.invoke_6r4k1d$(A,T,j+L|0):p.add_11rb$(new Hr(E,T,z,L))}}for(i=_.dataRelocationTable.iterator();i.hasNext();){var P=i.next(),q=P.component1(),M=P.component2(),R=P.component3(),K=_.labels.get_11rb$(M),B=d+q|0;if(null!=K){var D=K+R|0;l.prog.overwriteData_6t1wet$(B,Q.toByte(D)),l.prog.overwriteData_6t1wet$(B+1|0,Q.toByte(D>>8)),l.prog.overwriteData_6t1wet$(B+2|0,Q.toByte(D>>16)),l.prog.overwriteData_6t1wet$(B+3|0,Q.toByte(D>>24))}else f.add_11rb$(new Ur(B,M,R))}h=h+_.textSize|0,d=d+_.dataSize|0}for(o=p.iterator();o.hasNext();){var F=o.next(),H=F.component1(),U=F.component2(),J=F.component3();if(null==(a=c.get_11rb$(J)))throw nt("label "+J+" used but not defined");var W=a,V=l.prog.insts.get_za3lpa$(U/4|0);H.invoke_6r4k1d$(V,U,W)}for(s=f.iterator();s.hasNext();){var G=s.next(),Z=G.component1(),Y=G.component2();if(null==(u=c.get_11rb$(Y)))throw nt("label "+Y+" used but not defined");var X=u;l.prog.overwriteData_6t1wet$(Z,Q.toByte(X)),l.prog.overwriteData_6t1wet$(Z+1|0,Q.toByte(X>>8)),l.prog.overwriteData_6t1wet$(Z+2|0,Q.toByte(X>>16)),l.prog.overwriteData_6t1wet$(Z+3|0,Q.toByte(X>>24))}return l},Jr.$metadata$={kind:Q.Kind.OBJECT,simpleName:"Linker",interfaces:[]};var Wr,Vr,Gr,Zr,Yr,Xr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,li,ci,pi,fi,hi=null;function di(){return null===hi&&new Jr,hi}function _i(t,e,n,r){i.call(this),this.lo=n,this.hi=r,this.name$=t,this.ordinal$=e}function mi(){mi=function(){},Wr=new _i("ENTIRE",0,0,32),Vr=new _i("OPCODE",1,0,7),Gr=new _i("RD",2,7,12),Zr=new _i("FUNCT3",3,12,15),Yr=new _i("RS1",4,15,20),Xr=new _i("RS2",5,20,25),Qr=new _i("FUNCT7",6,25,32),ti=new _i("IMM_11_0",7,20,32),ei=new _i("IMM_4_0",8,7,12),ni=new _i("IMM_11_5",9,25,32),ri=new _i("IMM_11_B",10,7,8),ii=new _i("IMM_4_1",11,8,12),oi=new _i("IMM_10_5",12,25,31),ai=new _i("IMM_12",13,31,32),si=new _i("IMM_31_12",14,12,32),ui=new _i("IMM_19_12",15,12,20),li=new _i("IMM_11_J",16,20,21),ci=new _i("IMM_10_1",17,21,31),pi=new _i("IMM_20",18,31,32),fi=new _i("SHAMT",19,20,25)}function $i(){return mi(),Wr}function yi(){return mi(),Vr}function gi(){return mi(),Gr}function vi(){return mi(),Zr}function bi(){return mi(),Yr}function xi(){return mi(),Xr}function wi(){return mi(),Qr}function Ci(){return mi(),ti}function Si(){return mi(),ei}function ki(){return mi(),ni}function Ni(){return mi(),ri}function Ii(){return mi(),ii}function Ei(){return mi(),oi}function Oi(){return mi(),ai}function zi(){return mi(),si}function Li(){return mi(),ui}function Ti(){return mi(),li}function Ai(){return mi(),ci}function ji(){return mi(),pi}function Pi(){return mi(),fi}function qi(t){this.encoding_0=t,this.length=4}function Mi(){(Ri=this).STACK_BEGIN=2147483632,this.HEAP_BEGIN=268468224,this.STATIC_BEGIN=268435456,this.TEXT_BEGIN=0}_i.$metadata$={kind:Q.Kind.CLASS,simpleName:"InstructionField",interfaces:[i]},_i.values=function(){return[$i(),yi(),gi(),vi(),bi(),xi(),wi(),Ci(),Si(),ki(),Ni(),Ii(),Ei(),Oi(),zi(),Li(),Ti(),Ai(),ji(),Pi()]},_i.valueOf_61zpoe$=function(t){switch(t){case"ENTIRE":return $i();case"OPCODE":return yi();case"RD":return gi();case"FUNCT3":return vi();case"RS1":return bi();case"RS2":return xi();case"FUNCT7":return wi();case"IMM_11_0":return Ci();case"IMM_4_0":return Si();case"IMM_11_5":return ki();case"IMM_11_B":return Ni();case"IMM_4_1":return Ii();case"IMM_10_5":return Ei();case"IMM_12":return Oi();case"IMM_31_12":return zi();case"IMM_19_12":return Li();case"IMM_11_J":return Ti();case"IMM_10_1":return Ai();case"IMM_20":return ji();case"SHAMT":return Pi();default:Q.throwISE("No enum constant venus.riscv.InstructionField."+t)}},qi.prototype.get_12yce4$=function(t){var e=Q.Long.ONE.shiftLeft(t.hi).subtract(Q.Long.ONE.shiftLeft(t.lo)).toInt();return(this.encoding_0&e)>>>t.lo},qi.prototype.set_olc5hu$=function(t,e){var n=Q.Long.ONE.shiftLeft(t.hi).subtract(Q.Long.ONE.shiftLeft(t.lo)).toInt();this.encoding_0=this.encoding_0&~n,this.encoding_0=this.encoding_0|e<>32-e}function ia(t,e,n,r){return Q.Long.ONE.shiftLeft(r).subtract(Q.Long.ONE.shiftLeft(n)).inv().toInt()&t|e<>11),e.set_olc5hu$(Ii(),o>>1),e.set_olc5hu$(Oi(),o>>12),e.set_olc5hu$(Ei(),o>>5)},oa.$metadata$={kind:Q.Kind.OBJECT,simpleName:"BTypeParser",interfaces:[da]};var aa=null;function sa(){return null===aa&&new oa,aa}function ua(){(la=this).B_TYPE_MIN=-2048,this.B_TYPE_MAX=2047}ua.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,0)},ua.$metadata$={kind:Q.Kind.OBJECT,simpleName:"DoNothingParser",interfaces:[da]};var la=null;function ca(){return null===la&&new ua,la}function pa(){(fa=this).I_TYPE_MIN=-2048,this.I_TYPE_MAX=2047}pa.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,3),e.set_olc5hu$(gi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(bi(),La(n.get_za3lpa$(1))),ss(n.get_za3lpa$(2))?e.set_olc5hu$(Ci(),t.getImmediate_nc2td$(n.get_za3lpa$(2),this.I_TYPE_MIN,this.I_TYPE_MAX)):t.addRelocation_f5izfr$(Aa,t.symbolPart_61zpoe$(n.get_za3lpa$(2)),t.labelOffsetPart_61zpoe$(n.get_za3lpa$(2)))},pa.$metadata$={kind:Q.Kind.OBJECT,simpleName:"ITypeParser",interfaces:[da]};var fa=null;function ha(){return null===fa&&new pa,fa}function da(){}function _a(){(ma=this).I_TYPE_MIN=-2048,this.I_TYPE_MAX=2047}da.$metadata$={kind:Q.Kind.INTERFACE,simpleName:"InstructionParser",interfaces:[]},_a.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,3),e.set_olc5hu$(gi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(bi(),La(n.get_za3lpa$(2))),e.set_olc5hu$(Ci(),t.getImmediate_nc2td$(n.get_za3lpa$(1),this.I_TYPE_MIN,this.I_TYPE_MAX))},_a.$metadata$={kind:Q.Kind.OBJECT,simpleName:"LoadParser",interfaces:[da]};var ma=null;function $a(){return null===ma&&new _a,ma}function ya(){ga=this}ya.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,3),e.set_olc5hu$(gi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(bi(),La(n.get_za3lpa$(1))),e.set_olc5hu$(xi(),La(n.get_za3lpa$(2)))},ya.$metadata$={kind:Q.Kind.OBJECT,simpleName:"RTypeParser",interfaces:[da]};var ga=null;function va(){return null===ga&&new ya,ga}function ba(t){this.eval_0=t}function xa(){(wa=this).S_TYPE_MIN=-2048,this.S_TYPE_MAX=2047}ba.prototype.invoke_5czv3h$=function(t,e,n){this.eval_0(t,e,n)},ba.$metadata$={kind:Q.Kind.CLASS,simpleName:"RawParser",interfaces:[da]},xa.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,3);var r=t.getImmediate_nc2td$(n.get_za3lpa$(1),this.S_TYPE_MIN,this.S_TYPE_MAX);e.set_olc5hu$(bi(),La(n.get_za3lpa$(2))),e.set_olc5hu$(xi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(Si(),r),e.set_olc5hu$(ki(),r>>5)},xa.$metadata$={kind:Q.Kind.OBJECT,simpleName:"STypeParser",interfaces:[da]};var wa=null;function Ca(){return null===wa&&new xa,wa}function Sa(){(ka=this).SHIFT_MIN=0,this.SHIFT_MAX=31}Sa.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,3),e.set_olc5hu$(gi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(bi(),La(n.get_za3lpa$(1))),e.set_olc5hu$(Pi(),t.getImmediate_nc2td$(n.get_za3lpa$(2),this.SHIFT_MIN,this.SHIFT_MAX))},Sa.$metadata$={kind:Q.Kind.OBJECT,simpleName:"ShiftImmediateParser",interfaces:[da]};var ka=null;function Na(){return null===ka&&new Sa,ka}function Ia(){(Ea=this).U_TYPE_MIN=0,this.U_TYPE_MAX=1048575}Ia.prototype.invoke_5czv3h$=function(t,e,n){za(n.size,2),e.set_olc5hu$(gi(),La(n.get_za3lpa$(0))),e.set_olc5hu$(zi(),t.getImmediate_nc2td$(n.get_za3lpa$(1),this.U_TYPE_MIN,this.U_TYPE_MAX))},Ia.$metadata$={kind:Q.Kind.OBJECT,simpleName:"UTypeParser",interfaces:[da]};var Ea=null;function Oa(){return null===Ea&&new Ia,Ea}function za(t,e){if(t!==e)throw nt("got "+t+" arguments but expected "+e)}function La(t){var e;if(s(t,"x")){var n=S(k(t,1));if(new y(0,31).contains_mef7kx$(n))return n;throw nt("register "+t+" not recognized")}if(Q.equals(t,"zero"))e=0;else if(Q.equals(t,"ra"))e=1;else if(Q.equals(t,"sp"))e=2;else if(Q.equals(t,"gp"))e=3;else if(Q.equals(t,"tp"))e=4;else if(Q.equals(t,"t0"))e=5;else if(Q.equals(t,"t1"))e=6;else if(Q.equals(t,"t2"))e=7;else if(Q.equals(t,"s0")||Q.equals(t,"fp"))e=8;else if(Q.equals(t,"s1"))e=9;else if(Q.equals(t,"a0"))e=10;else if(Q.equals(t,"a1"))e=11;else if(Q.equals(t,"a2"))e=12;else if(Q.equals(t,"a3"))e=13;else if(Q.equals(t,"a4"))e=14;else if(Q.equals(t,"a5"))e=15;else if(Q.equals(t,"a6"))e=16;else if(Q.equals(t,"a7"))e=17;else if(Q.equals(t,"s2"))e=18;else if(Q.equals(t,"s3"))e=19;else if(Q.equals(t,"s4"))e=20;else if(Q.equals(t,"s5"))e=21;else if(Q.equals(t,"s6"))e=22;else if(Q.equals(t,"s7"))e=23;else if(Q.equals(t,"s8"))e=24;else if(Q.equals(t,"s9"))e=25;else if(Q.equals(t,"s10"))e=26;else if(Q.equals(t,"s11"))e=27;else if(Q.equals(t,"t3"))e=28;else if(Q.equals(t,"t4"))e=29;else if(Q.equals(t,"t5"))e=30;else{if(!Q.equals(t,"t6"))throw nt("register "+t+" not recognized");e=31}return e}function Ta(){ja=this}Ta.prototype.invoke_tubppg$=function(t,e,n){if(!new y(-2048,2047).contains_mef7kx$(n))throw nt("immediate value out of range: "+n);t.set_olc5hu$(Ci(),n)},Ta.$metadata$={kind:Q.Kind.OBJECT,simpleName:"ImmAbsRelocator32",interfaces:[ts]};var Aa,ja=null;function Pa(){Ma=this}Pa.prototype.invoke_tubppg$=function(t,e,n){if(!new y(-2048,2047).contains_mef7kx$(n))throw nt("immediate value out of range: "+n);t.set_olc5hu$(Si(),n),t.set_olc5hu$(ki(),n>>5)},Pa.$metadata$={kind:Q.Kind.OBJECT,simpleName:"ImmAbsStoreRelocator32",interfaces:[ts]};var qa,Ma=null;function Ra(){Ba=this}Ra.prototype.invoke_tubppg$=function(t,e,n){var r=n-e|0;t.set_olc5hu$(ji(),r>>20),t.set_olc5hu$(Ai(),r>>1),t.set_olc5hu$(Li(),r>>12),t.set_olc5hu$(Ti(),r>>11)},Ra.$metadata$={kind:Q.Kind.OBJECT,simpleName:"JALRelocator32",interfaces:[ts]};var Ka,Ba=null;function Da(){Fa=this}Da.prototype.invoke_nuphlu$=function(t,e,n){throw new r("no relocator64 for "+t)},Da.$metadata$={kind:Q.Kind.OBJECT,simpleName:"NoRelocator64",interfaces:[es]};var Fa=null;function Ha(){return null===Fa&&new Da,Fa}function Ua(){Wa=this}Ua.prototype.invoke_tubppg$=function(t,e,n){t.set_olc5hu$(zi(),n-e+2048>>12)},Ua.$metadata$={kind:Q.Kind.OBJECT,simpleName:"PCRelHiRelocator32",interfaces:[ts]};var Ja,Wa=null;function Va(){Za=this}Va.prototype.invoke_tubppg$=function(t,e,n){t.set_olc5hu$(Ci(),n-(e-4)|0)},Va.$metadata$={kind:Q.Kind.OBJECT,simpleName:"PCRelLoRelocator32",interfaces:[ts]};var Ga,Za=null;function Ya(){Qa=this}Ya.prototype.invoke_tubppg$=function(t,e,n){var r=n-(e-4)|0;t.set_olc5hu$(Si(),r),t.set_olc5hu$(ki(),r>>5)},Ya.$metadata$={kind:Q.Kind.OBJECT,simpleName:"PCRelLoStoreRelocator32",interfaces:[ts]};var Xa,Qa=null;function ts(){}function es(){}function ns(t,e){this.relocator32_0=t,this.relocator64_0=e}function rs(t,e){return Q.primitiveCompareTo(t^n.MIN_VALUE,e^n.MIN_VALUE)}function is(t,e){return t.xor(new Q.Long(0,-2147483648)).compareTo_11rb$(e.xor(new Q.Long(0,-2147483648)))}function os(t){var e=t.get_12yce4$(ji()),n=t.get_12yce4$(Ai()),r=t.get_12yce4$(Ti()),i=t.get_12yce4$(Li()),o=0;return ra(o=ia(o=ia(o=ia(o=ia(o,e,20,21),n,1,11),r,11,12),i,12,20),21)}function as(t){var e,n,r;if(r=t,39===Q.unboxChar(I(r))&&39===Q.unboxChar(z(r)))return function(e){var t=L(k(e,1),1);if(Q.equals(t,"\\'"))return 39;if(Q.equals(t,'"'))return 34;var n='"'+t+'"';try{var r=JSON.parse(n);if(0===r.length)throw new v("character literal "+e+" is empty");if(1>8)},cs.prototype.storeWord_vux9f0$=function(t,e){this.storeHalfWord_vux9f0$(t,e),this.storeHalfWord_vux9f0$(t+2|0,e>>16)},cs.$metadata$={kind:Q.Kind.CLASS,simpleName:"Memory",interfaces:[]},ps.prototype.isDone=function(){return this.getPC()>=this.maxpc_0},ps.prototype.run=function(){for(;!this.isDone();)this.step(),this.cycles_0=this.cycles_0+1|0},ps.prototype.step=function(){this.preInstruction_0.clear(),this.postInstruction_0.clear();var t=this.getNextInstruction_0();return Xi().get_4vgyas$(t).impl32.invoke_23eu0x$(t,this),this.history_0.add_mwsh3f$(this.preInstruction_0),T(this.postInstruction_0)},ps.prototype.undo=function(){var t;if(!this.canUndo())return A();var e=this.history_0.pop();for(t=e.iterator();t.hasNext();){t.next().invoke_gdqidk$(this.state_0)}return e},ps.prototype.canUndo=function(){return!this.history_0.isEmpty()},ps.prototype.getReg_za3lpa$=function(t){return this.state_0.getReg_za3lpa$(t)},ps.prototype.setReg_vux9f0$=function(t,e){this.preInstruction_0.add_11rb$(new ys(t,this.state_0.getReg_za3lpa$(t))),this.state_0.setReg_vux9f0$(t,e),this.postInstruction_0.add_11rb$(new ys(t,this.state_0.getReg_za3lpa$(t)))},ps.prototype.setRegNoUndo_vux9f0$=function(t,e){this.state_0.setReg_vux9f0$(t,e)},ps.prototype.toggleBreakpointAt_za3lpa$=function(t){return this.breakpoints_0[t]=!this.breakpoints_0[t],this.breakpoints_0[t]},ps.prototype.atBreakpoint=function(){return this.breakpoints_0[this.state_0.pc/4|0]},ps.prototype.getPC=function(){return this.state_0.pc},ps.prototype.setPC_za3lpa$=function(t){this.preInstruction_0.add_11rb$(new $s(this.state_0.pc)),this.state_0.pc=t,this.postInstruction_0.add_11rb$(new $s(this.state_0.pc))},ps.prototype.incrementPC_za3lpa$=function(t){var e;this.preInstruction_0.add_11rb$(new $s(this.state_0.pc)),(e=this.state_0).pc=e.pc+t|0,this.postInstruction_0.add_11rb$(new $s(this.state_0.pc))},ps.prototype.loadByte_za3lpa$=function(t){return this.state_0.mem.loadByte_za3lpa$(t)},ps.prototype.loadHalfWord_za3lpa$=function(t){return this.state_0.mem.loadHalfWord_za3lpa$(t)},ps.prototype.loadWord_za3lpa$=function(t){return this.state_0.mem.loadWord_za3lpa$(t)},ps.prototype.storeByte_vux9f0$=function(t,e){this.preInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t))),this.state_0.mem.storeByte_vux9f0$(t,e),this.postInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t)))},ps.prototype.storeHalfWord_vux9f0$=function(t,e){this.preInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t))),this.state_0.mem.storeHalfWord_vux9f0$(t,e),this.postInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t)))},ps.prototype.storeWord_vux9f0$=function(t,e){this.preInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t))),this.state_0.mem.storeWord_vux9f0$(t,e),this.postInstruction_0.add_11rb$(new ms(t,this.loadWord_za3lpa$(t)))},ps.prototype.getHeapEnd=function(){return this.state_0.heapEnd},ps.prototype.addHeapSpace_za3lpa$=function(t){var e;this.preInstruction_0.add_11rb$(new _s(this.state_0.heapEnd)),(e=this.state_0).heapEnd=e.heapEnd+t|0,this.postInstruction_0.add_11rb$(new _s(this.state_0.heapEnd))},ps.prototype.getInstructionLength_0=function(t){if(3!=(3&t))return 2;if(31!=(31&t))return 4;if(31==(63&t))return 6;if(63==(127&t))return 8;throw hs("instruction lengths > 8 not supported")},ps.prototype.getNextInstruction_0=function(){var t=this.loadHalfWord_za3lpa$(this.getPC());if(4!==this.getInstructionLength_0(t))throw hs("instruction length != 4 not supported");return new qi(this.loadHalfWord_za3lpa$(this.getPC()+2|0)<<16|t)},ps.$metadata$={kind:Q.Kind.CLASS,simpleName:"Simulator",interfaces:[]},Object.defineProperty(fs.prototype,"message",{get:function(){return this.message_3ylwkb$_0}}),Object.defineProperty(fs.prototype,"cause",{get:function(){return this.cause_3ylwkb$_0}}),fs.$metadata$={kind:Q.Kind.CLASS,simpleName:"SimulatorError",interfaces:[$]},ds.prototype.getReg_za3lpa$=function(t){return this.regs_0[t]},ds.prototype.setReg_vux9f0$=function(t,e){0!==t&&(this.regs_0[t]=e)},ds.$metadata$={kind:Q.Kind.CLASS,simpleName:"SimulatorState",interfaces:[]},_s.prototype.invoke_gdqidk$=function(t){t.heapEnd=this.heapEnd},_s.$metadata$={kind:Q.Kind.CLASS,simpleName:"HeapSpaceDiff",interfaces:[us]},ms.prototype.invoke_gdqidk$=function(t){t.mem.storeWord_vux9f0$(this.addr,this.value)},ms.$metadata$={kind:Q.Kind.CLASS,simpleName:"MemoryDiff",interfaces:[us]},$s.prototype.invoke_gdqidk$=function(t){t.pc=this.pc},$s.$metadata$={kind:Q.Kind.CLASS,simpleName:"PCDiff",interfaces:[us]},ys.prototype.invoke_gdqidk$=function(t){t.setReg_vux9f0$(this.id,this.v)},ys.$metadata$={kind:Q.Kind.CLASS,simpleName:"RegisterDiff",interfaces:[us]};var gs=t.venus||(t.venus={}),vs=gs.assembler||(gs.assembler={});Object.defineProperty(vs,"Assembler",{get:q}),vs.DebugInfo=M,vs.DebugInstruction=R,vs.PassOneOutput=K,vs.AssemblerOutput=B,vs.AssemblerPassOne=D,vs.AssemblerPassTwo=F,vs.AssemblerError_init_pdl1vj$=nt,vs.AssemblerError_init_h1fdkt$=J,vs.AssemblerError=U,Object.defineProperty(vs,"Lexer",{get:G}),vs.LintError=Z,Object.defineProperty(vs,"Linter",{get:function(){return null===Ut&&new Y,Ut}}),Object.defineProperty(Jt,"beqz",{get:Vt}),Object.defineProperty(Jt,"bgez",{get:Gt}),Object.defineProperty(Jt,"bgt",{get:Zt}),Object.defineProperty(Jt,"bgtu",{get:Yt}),Object.defineProperty(Jt,"bgtz",{get:Xt}),Object.defineProperty(Jt,"ble",{get:Qt}),Object.defineProperty(Jt,"bleu",{get:te}),Object.defineProperty(Jt,"blez",{get:ee}),Object.defineProperty(Jt,"bltz",{get:ne}),Object.defineProperty(Jt,"bnez",{get:re}),Object.defineProperty(Jt,"call",{get:ie}),Object.defineProperty(Jt,"jal",{get:oe}),Object.defineProperty(Jt,"jalr",{get:ae}),Object.defineProperty(Jt,"j",{get:se}),Object.defineProperty(Jt,"jr",{get:ue}),Object.defineProperty(Jt,"la",{get:le}),Object.defineProperty(Jt,"lb",{get:ce}),Object.defineProperty(Jt,"lbu",{get:pe}),Object.defineProperty(Jt,"lh",{get:fe}),Object.defineProperty(Jt,"lhu",{get:he}),Object.defineProperty(Jt,"li",{get:de}),Object.defineProperty(Jt,"lw",{get:_e}),Object.defineProperty(Jt,"mv",{get:me}),Object.defineProperty(Jt,"neg",{get:$e}),Object.defineProperty(Jt,"nop",{get:ye}),Object.defineProperty(Jt,"not",{get:ge}),Object.defineProperty(Jt,"ret",{get:ve}),Object.defineProperty(Jt,"sb",{get:be}),Object.defineProperty(Jt,"seqz",{get:xe}),Object.defineProperty(Jt,"sgtz",{get:we}),Object.defineProperty(Jt,"sh",{get:Ce}),Object.defineProperty(Jt,"sltz",{get:Se}),Object.defineProperty(Jt,"snez",{get:ke}),Object.defineProperty(Jt,"sw",{get:Ne}),Object.defineProperty(Jt,"tail",{get:Ie}),Object.defineProperty(Jt,"seq",{get:Ee}),Object.defineProperty(Jt,"sge",{get:Oe}),Object.defineProperty(Jt,"sgeu",{get:ze}),Object.defineProperty(Jt,"sgt",{get:Le}),Object.defineProperty(Jt,"sgtu",{get:Te}),Object.defineProperty(Jt,"sle",{get:Ae}),Object.defineProperty(Jt,"sleu",{get:je}),Object.defineProperty(Jt,"sne",{get:Pe}),vs.PseudoDispatcher=Jt,vs.PseudoWriter=Me;var bs=vs.pseudos||(vs.pseudos={});Object.defineProperty(bs,"BEQZ",{get:Be}),Object.defineProperty(bs,"BGEZ",{get:He}),Object.defineProperty(bs,"BGT",{get:We}),Object.defineProperty(bs,"BGTU",{get:Ze}),Object.defineProperty(bs,"BGTZ",{get:Qe}),Object.defineProperty(bs,"BLE",{get:nn}),Object.defineProperty(bs,"BLEU",{get:an}),Object.defineProperty(bs,"BLEZ",{get:ln}),Object.defineProperty(bs,"BLTZ",{get:fn}),Object.defineProperty(bs,"BNEZ",{get:_n}),Object.defineProperty(bs,"CALL",{get:yn}),Object.defineProperty(bs,"J",{get:bn}),Object.defineProperty(bs,"JAL",{get:Cn}),Object.defineProperty(bs,"JALR",{get:Nn}),Object.defineProperty(bs,"JR",{get:On}),Object.defineProperty(bs,"LA",{get:Tn}),Object.defineProperty(bs,"LI",{get:Pn}),Object.defineProperty(bs,"Load",{get:Rn}),Object.defineProperty(bs,"MV",{get:Dn}),Object.defineProperty(bs,"NEG",{get:Un}),Object.defineProperty(bs,"NOP",{get:Vn}),Object.defineProperty(bs,"NOT",{get:Yn}),Object.defineProperty(bs,"RET",{get:tr}),Object.defineProperty(bs,"SEQ",{get:rr}),Object.defineProperty(bs,"SEQZ",{get:ar}),Object.defineProperty(bs,"SGE",{get:lr}),Object.defineProperty(bs,"SGT",{get:fr}),Object.defineProperty(bs,"SGTZ",{get:_r}),Object.defineProperty(bs,"SLE",{get:yr}),Object.defineProperty(bs,"SLTZ",{get:br}),Object.defineProperty(bs,"SNE",{get:Cr}),Object.defineProperty(bs,"SNEZ",{get:Nr}),Object.defineProperty(bs,"Store",{get:Or}),Object.defineProperty(bs,"TAIL",{get:Tr}),bs.checkArgsLength_udy8vv$=Ar,bs.checkStrictMode=jr;var xs=gs.glue||(gs.glue={});Object.defineProperty(xs,"Driver",{get:Mr}),Object.defineProperty(xs,"Renderer",{get:Br});var ws=gs.linker||(gs.linker={});ws.ProgramDebugInfo=Dr,ws.LinkedProgram=Fr,ws.RelocationInfo=Hr,ws.DataRelocationInfo=Ur,Object.defineProperty(ws,"Linker",{get:di}),Object.defineProperty(_i,"ENTIRE",{get:$i}),Object.defineProperty(_i,"OPCODE",{get:yi}),Object.defineProperty(_i,"RD",{get:gi}),Object.defineProperty(_i,"FUNCT3",{get:vi}),Object.defineProperty(_i,"RS1",{get:bi}),Object.defineProperty(_i,"RS2",{get:xi}),Object.defineProperty(_i,"FUNCT7",{get:wi}),Object.defineProperty(_i,"IMM_11_0",{get:Ci}),Object.defineProperty(_i,"IMM_4_0",{get:Si}),Object.defineProperty(_i,"IMM_11_5",{get:ki}),Object.defineProperty(_i,"IMM_11_B",{get:Ni}),Object.defineProperty(_i,"IMM_4_1",{get:Ii}),Object.defineProperty(_i,"IMM_10_5",{get:Ei}),Object.defineProperty(_i,"IMM_12",{get:Oi}),Object.defineProperty(_i,"IMM_31_12",{get:zi}),Object.defineProperty(_i,"IMM_19_12",{get:Li}),Object.defineProperty(_i,"IMM_11_J",{get:Ti}),Object.defineProperty(_i,"IMM_10_1",{get:Ai}),Object.defineProperty(_i,"IMM_20",{get:ji}),Object.defineProperty(_i,"SHAMT",{get:Pi});var Cs=gs.riscv||(gs.riscv={});Cs.InstructionField=_i,Cs.MachineCode=qi,Object.defineProperty(Cs,"MemorySegments",{get:Ki}),Cs.Program=Bi,Object.defineProperty(Cs,"Settings",{get:Hi});var Ss=Cs.insts||(Cs.insts={}),ks=Ss.dsl||(Ss.dsl={});ks.BTypeInstruction=Ui,ks.ITypeInstruction=Wi,Object.defineProperty(Gi,"Companion",{get:Xi}),ks.Instruction=Gi,ks.LoadTypeInstruction=Qi,ks.RTypeInstruction=ro,ks.STypeInstruction=oo,ks.ShiftImmediateInstruction=so,ks.UTypeInstruction=lo;var Ns=ks.disasms||(ks.disasms={});Object.defineProperty(Ns,"BTypeDisassembler",{get:ho}),Object.defineProperty(Ns,"ITypeDisassembler",{get:$o}),Ns.InstructionDisassembler=yo,Object.defineProperty(Ns,"LoadDisassembler",{get:bo}),Object.defineProperty(Ns,"RTypeDisassembler",{get:Co}),Ns.RawDisassembler=So,Object.defineProperty(Ns,"STypeDisassembler",{get:Io}),Object.defineProperty(Ns,"ShiftImmediateDisassembler",{get:zo}),Object.defineProperty(Ns,"UTypeDisassembler",{get:Ao});var Is=ks.formats||(ks.formats={});Is.BTypeFormat=jo,Is.ITypeFormat=Po,Is.FieldEqual=qo,Is.InstructionFormat=Mo,Is.OpcodeFormat=Ro,Is.OpcodeFunct3Format=Ko,Is.RTypeFormat=Bo,Is.STypeFormat=Do,Is.UTypeFormat=Fo;var Es=ks.impls||(ks.impls={});Es.BTypeImplementation32=Ho,Es.constructBranchImmediate_4vgyas$=Uo,Es.ITypeImplementation32=Jo,Es.InstructionImplementation=Wo,Es.LoadImplementation32=Vo,Object.defineProperty(Es,"NoImplementation",{get:Yo}),Es.RTypeImplementation32=Xo,Es.RawImplementation=Qo,Es.STypeImplementation32=ta,Es.constructStoreImmediate_4vgyas$=ea,Es.ShiftImmediateImplementation32=na,Es.signExtend_6xvm5r$=ra,Es.setBitslice_r9yya9$=ia;var Os=ks.parsers||(ks.parsers={});Object.defineProperty(Os,"BTypeParser",{get:sa}),Object.defineProperty(Os,"DoNothingParser",{get:ca}),Object.defineProperty(Os,"ITypeParser",{get:ha}),Os.InstructionParser=da,Object.defineProperty(Os,"LoadParser",{get:$a}),Object.defineProperty(Os,"RTypeParser",{get:va}),Os.RawParser=ba,Object.defineProperty(Os,"STypeParser",{get:Ca}),Object.defineProperty(Os,"ShiftImmediateParser",{get:Na}),Object.defineProperty(Os,"UTypeParser",{get:Oa}),Os.checkArgsLength_6xvm5r$=za,Os.regNameToNumber_y4putb$=La;var zs=ks.relocators||(ks.relocators={});Object.defineProperty(zs,"NoRelocator64",{get:Ha}),zs.Relocator32=ts,zs.Relocator64=es,zs.Relocator=ns,ks.compareUnsigned_6xvm5r$=rs,ks.compareUnsignedLong_cfj5zr$=is,Cs.userStringToInt_61zpoe$=as,Cs.isNumeral_61zpoe$=ss;var Ls=gs.simulator||(gs.simulator={});Ls.Diff=us,Ls.History=ls,Ls.Memory=cs,Ls.Simulator=ps,Ls.SimulatorError_init_pdl1vj$=hs,Ls.SimulatorError=fs,Ls.SimulatorState=ds;var Ts=Ls.diffs||(Ls.diffs={});return Ts.HeapSpaceDiff=_s,Ts.MemoryDiff=ms,Ts.PCDiff=$s,Ts.RegisterDiff=ys,new ro("add",51,0,0,function(t,e){return t+e|0},function(t,e){return t.add(e)}),new Wi("addi",19,0,function(t,e){return t+e|0},function(t,e){return t.add(e)}),new ro("and",51,7,0,function(t,e){return t&e},function(t,e){return t.and(e)}),new Wi("andi",19,7,function(t,e){return t&e},function(t,e){return t.and(e)}),new lo("auipc",23,function(t,e){var n=t.get_12yce4$(zi())<<12;e.setReg_vux9f0$(t.get_12yce4$(gi()),e.getPC()+n|0),e.incrementPC_za3lpa$(t.length)},Q.getCallableRef("invoke",function(t,e,n){return t.invoke_23eu0x$(e,n)}.bind(null,Yo()))),new Ui("beq",99,0,function(t,e){return t===e},function(t,e){return Q.equals(t,e)}),new Ui("bge",99,5,function(t,e){return e<=t},function(t,e){return 0<=t.compareTo_11rb$(e)}),new Ui("bgeu",99,7,function(t,e){return 0<=rs(t,e)},function(t,e){return 0<=is(t,e)}),new Ui("blt",99,4,function(t,e){return t>1<<1)}),Yo(),new So(function(t){return"jalr x"+t.get_12yce4$(gi())+" x"+t.get_12yce4$(bi())+" "+ra(t.get_12yce4$(Ci()),12)})),new Qi("lb",3,0,Q.getCallableRef("loadByte",function(t,e){return t.loadByte_za3lpa$(e)}),function(t){return ra(t,8)}),new Qi("lbu",3,4,Q.getCallableRef("loadByte",function(t,e){return t.loadByte_za3lpa$(e)})),new Qi("lh",3,1,Q.getCallableRef("loadHalfWord",function(t,e){return t.loadHalfWord_za3lpa$(e)}),function(t){return ra(t,16)}),new Qi("lhu",3,5,Q.getCallableRef("loadHalfWord",function(t,e){return t.loadHalfWord_za3lpa$(e)})),new lo("lui",55,function(t,e){var n=t.get_12yce4$(zi())<<12;e.setReg_vux9f0$(t.get_12yce4$(gi()),n),e.incrementPC_za3lpa$(t.length)}),new Qi("lw",3,2,Q.getCallableRef("loadWord",function(t,e){return t.loadWord_za3lpa$(e)})),new ro("mul",51,0,1,function(t,e){return Q.imul(t,e)},function(t,e){return t.multiply(e)}),new ro("mulh",51,1,1,function(t,e){var n=Q.Long.fromInt(t),r=Q.Long.fromInt(e);return n.multiply(r).shiftRightUnsigned(32).toInt()}),new ro("mulhsu",51,2,1,function(t,e){var n=Q.Long.fromInt(t),r=Q.Long.fromInt(e).shiftLeft(32).shiftRightUnsigned(32);return n.multiply(r).shiftRightUnsigned(32).toInt()}),new ro("mulhu",51,3,1,function(t,e){var n=Q.Long.fromInt(t).shiftLeft(32).shiftRightUnsigned(32),r=Q.Long.fromInt(e).shiftLeft(32).shiftRightUnsigned(32);return n.multiply(r).shiftRightUnsigned(32).toInt()}),new ro("or",51,6,0,function(t,e){return t|e},function(t,e){return t.or(e)}),new Wi("ori",19,6,function(t,e){return t|e},function(t,e){return t.or(e)}),new ro("rem",51,6,1,function(t,e){return 0===e?t:t===n.MIN_VALUE&&-1===e?0:t%e}),new ro("remu",51,7,1,function(t,e){var n=Q.Long.fromInt(t).shiftLeft(32).shiftRightUnsigned(32),r=Q.Long.fromInt(e).shiftLeft(32).shiftRightUnsigned(32);return 0===e?t:n.modulo(r).toInt()}),new oo("sb",35,0,Q.getCallableRef("storeByte",function(t,e,n){return t.storeByte_vux9f0$(e,n)})),new oo("sh",35,1,Q.getCallableRef("storeHalfWord",function(t,e,n){return t.storeHalfWord_vux9f0$(e,n)})),new ro("sll",51,1,0,function(t,e){var n=31&e;return 0===n?t:t<>n},function(t,e){var n=63&e.toInt();return 0===n?t:t.shiftRight(n)}),new so("srai",5,32,function(t,e){return 0===e?t:t>>e}),new ro("srl",51,5,0,function(t,e){var n=31&e;return 0===n?t:t>>>n},function(t,e){var n=63&e.toInt();return 0===n?t:t.shiftRightUnsigned(n)}),new so("srli",5,0,function(t,e){return 0===e?t:t>>>e}),new ro("sub",51,0,32,function(t,e){return t-e|0},function(t,e){return t.subtract(e)}),new oo("sw",35,2,Q.getCallableRef("storeWord",function(t,e,n){return t.storeWord_vux9f0$(e,n)})),new ro("xor",51,4,0,function(t,e){return t^e},function(t,e){return t.xor(e)}),new Wi("xori",19,4,function(t,e){return t^e},function(t,e){return t.xor(e)}),t}(void 0===venus_main?{}:venus_main,kotlin); \ No newline at end of file