jaclang 0.7.34__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/__init__.py +7 -414
- jaclang/cli/cli.md +5 -5
- jaclang/cli/cli.py +311 -214
- jaclang/cli/cmdreg.py +188 -31
- jaclang/compiler/__init__.py +10 -15
- jaclang/compiler/{codeloc.py → codeinfo.py} +11 -30
- jaclang/compiler/constant.py +10 -33
- jaclang/compiler/jac.lark +61 -92
- jaclang/compiler/larkparse/jac_parser.py +3444 -0
- jaclang/compiler/parser.py +1004 -1223
- jaclang/compiler/passes/__init__.py +2 -2
- jaclang/compiler/passes/main/__init__.py +33 -14
- jaclang/compiler/passes/main/annex_pass.py +85 -0
- jaclang/compiler/passes/main/cfg_build_pass.py +275 -0
- jaclang/compiler/passes/main/def_impl_match_pass.py +146 -102
- jaclang/compiler/passes/main/def_use_pass.py +64 -269
- jaclang/compiler/passes/main/import_pass.py +175 -360
- jaclang/compiler/passes/main/inheritance_pass.py +107 -105
- jaclang/compiler/passes/main/pyast_gen_pass.py +1129 -1600
- jaclang/compiler/passes/main/pyast_load_pass.py +540 -584
- jaclang/compiler/passes/main/pybc_gen_pass.py +38 -35
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +46 -160
- jaclang/compiler/passes/main/sym_tab_build_pass.py +113 -1202
- jaclang/compiler/passes/main/sym_tab_link_pass.py +141 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/access_modifier.jac +10 -9
- jaclang/compiler/passes/main/tests/fixtures/atest.impl.jac +3 -0
- jaclang/compiler/passes/main/tests/fixtures/atest.jac +11 -0
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl/getme.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.jac +3 -3
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.something.else.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/base.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/base2.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base2.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/blip.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/cfg_ability_test.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/cfg_gen.jac +19 -0
- jaclang/compiler/passes/main/tests/fixtures/circular_import.jac +7 -0
- jaclang/compiler/passes/main/tests/fixtures/data_spatial_types.jac +12 -12
- jaclang/compiler/passes/main/tests/fixtures/decls.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defn_decl_mismatch.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defs_and_uses.jac +6 -6
- jaclang/compiler/passes/main/tests/fixtures/enumerations.jac +13 -0
- jaclang/compiler/passes/main/tests/fixtures/fstrings.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/func.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/func2.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/game1.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/impl/defs1.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/defs2.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/imps.jac +0 -8
- jaclang/compiler/passes/main/tests/fixtures/impl_grab.impl.jac +5 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/impl_grab.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/incautoimpl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/main_err.impl.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/main_err.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/mod_type_assign.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/mtest.impl.jac +6 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/mtest.jac +1 -1
- jaclang/{tests → compiler/passes/main/tests}/fixtures/nested_impls.jac +14 -15
- jaclang/compiler/passes/main/tests/fixtures/py_imp_test.jac +7 -7
- jaclang/compiler/passes/main/tests/fixtures/second_err.jac +4 -0
- jaclang/compiler/passes/main/tests/fixtures/str2doc.py +3 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/__init__.py +5 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/actions.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/main.jac +14 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/no_dupls.jac +35 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/one.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/type_info.jac +4 -4
- jaclang/compiler/passes/main/tests/test_cfg_build_pass.py +99 -0
- jaclang/compiler/passes/main/tests/test_decl_impl_match_pass.py +157 -0
- jaclang/compiler/passes/main/tests/test_def_use_pass.py +4 -6
- jaclang/compiler/passes/main/tests/test_import_pass.py +59 -46
- jaclang/compiler/passes/main/tests/test_pyast_build_pass.py +15 -0
- jaclang/compiler/passes/main/tests/test_pyast_gen_pass.py +25 -34
- jaclang/compiler/passes/main/tests/test_pybc_gen_pass.py +3 -3
- jaclang/compiler/passes/main/tests/test_sub_node_pass.py +8 -7
- jaclang/compiler/passes/main/tests/test_sym_tab_build_pass.py +4 -4
- jaclang/compiler/passes/main/tests/test_sym_tab_link_pass.py +62 -0
- jaclang/compiler/passes/tool/__init__.py +2 -0
- jaclang/compiler/passes/tool/doc_ir.py +179 -0
- jaclang/compiler/passes/tool/doc_ir_gen_pass.py +1210 -0
- jaclang/compiler/passes/tool/fuse_comments_pass.py +90 -70
- jaclang/compiler/passes/tool/jac_formatter_pass.py +122 -2554
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +249 -97
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +94 -97
- jaclang/compiler/passes/tool/tests/fixtures/doc_string.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/access_mod_check.jac +5 -5
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/archetype_test.jac +13 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/decorator_stack.jac +7 -7
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/line_spacing.jac +8 -8
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.dot +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.txt +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/ability_impl_long_comprehension.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/call_with_many_parameters.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/simple_walker.jac +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/try_block_and_walker_spawn_and_fstrings.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/type_annotation.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac +10 -4
- jaclang/compiler/passes/tool/tests/test_doc_ir_gen_pass.py +29 -0
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +63 -88
- jaclang/compiler/passes/tool/tests/test_unparse_validate.py +27 -28
- jaclang/compiler/passes/transform.py +56 -16
- jaclang/compiler/passes/{ir_pass.py → uni_pass.py} +35 -52
- jaclang/compiler/program.py +205 -0
- jaclang/compiler/tests/fixtures/codegentext.jac +31 -0
- jaclang/compiler/tests/fixtures/fam.jac +10 -10
- jaclang/compiler/tests/fixtures/hello_world.jac +1 -1
- jaclang/compiler/tests/fixtures/staticcheck.jac +2 -2
- jaclang/compiler/tests/test_importer.py +21 -16
- jaclang/compiler/tests/test_parser.py +38 -17
- jaclang/compiler/{absyntree.py → unitree.py} +1120 -1012
- jaclang/langserve/engine.py +183 -171
- jaclang/langserve/sem_manager.py +26 -22
- jaclang/langserve/server.py +6 -15
- jaclang/langserve/tests/fixtures/base_module_structure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_err.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_pure.impl.jac +5 -5
- jaclang/langserve/tests/fixtures/circle_pure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle_pure_err.impl.jac +2 -2
- jaclang/langserve/tests/fixtures/circle_pure_err.jac +7 -7
- jaclang/langserve/tests/fixtures/import_include_statements.jac +6 -6
- jaclang/langserve/tests/fixtures/rename.jac +6 -6
- jaclang/langserve/tests/server_test/test_lang_serve.py +262 -0
- jaclang/langserve/tests/server_test/utils.py +115 -0
- jaclang/langserve/tests/test_sem_tokens.py +2 -2
- jaclang/langserve/tests/test_server.py +41 -23
- jaclang/langserve/utils.jac +438 -0
- jaclang/runtimelib/{architype.py → archetype.py} +85 -61
- jaclang/runtimelib/builtin.py +92 -0
- jaclang/runtimelib/constructs.py +11 -13
- jaclang/runtimelib/importer.py +63 -51
- jaclang/runtimelib/machine.py +1551 -144
- jaclang/runtimelib/memory.py +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/graph_purger.jac +1 -1
- jaclang/{plugin → runtimelib}/tests/fixtures/impl_match.jac +2 -2
- jaclang/runtimelib/tests/fixtures/impl_match_impl.jac +3 -0
- jaclang/{plugin → runtimelib}/tests/fixtures/other_root_access.jac +7 -7
- jaclang/{plugin → runtimelib}/tests/fixtures/savable_object.jac +3 -5
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_node_connection.jac +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_persistent.jac +1 -1
- jaclang/runtimelib/tests/test_features.py +72 -0
- jaclang/{plugin → runtimelib}/tests/test_jaseci.py +6 -5
- jaclang/runtimelib/utils.py +31 -63
- jaclang/settings.py +1 -6
- jaclang/tests/fixtures/{abc.jac → abc_check.jac} +6 -6
- jaclang/tests/fixtures/arch_rel_import_creation.jac +4 -4
- jaclang/tests/fixtures/async_ability.jac +18 -0
- jaclang/tests/fixtures/async_walker.jac +23 -0
- jaclang/tests/fixtures/baddy.jac +1 -1
- jaclang/tests/fixtures/base_class1.jac +2 -2
- jaclang/tests/fixtures/base_class2.jac +2 -2
- jaclang/tests/fixtures/base_class_complex_expr.jac +3 -3
- jaclang/tests/fixtures/builtin_dotgen.jac +1 -1
- jaclang/tests/fixtures/builtin_dotgen_json.jac +21 -0
- jaclang/tests/fixtures/byllmissue.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs2.jac +1 -1
- jaclang/tests/fixtures/cls_method.jac +6 -6
- jaclang/tests/fixtures/concurrency.jac +39 -0
- jaclang/tests/fixtures/connect_traverse_syntax.jac +18 -0
- jaclang/tests/fixtures/create_dynamic_archetype.jac +35 -0
- jaclang/tests/fixtures/decl_defn_param_name.jac +4 -4
- jaclang/tests/fixtures/deep/deeper/__init__.jac +1 -0
- jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac +2 -3
- jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac +3 -3
- jaclang/tests/fixtures/deep/deeper/snd_lev.jac +2 -2
- jaclang/tests/fixtures/deep/mycode.jac +1 -1
- jaclang/tests/fixtures/deep/one_lev.jac +3 -4
- jaclang/tests/fixtures/deep/one_lev_dup.jac +2 -2
- jaclang/tests/fixtures/deep_convert.jac +1 -1
- jaclang/tests/fixtures/deep_import.jac +2 -2
- jaclang/tests/fixtures/deep_import_interp.jac +8 -0
- jaclang/tests/fixtures/deep_import_mods.jac +3 -3
- jaclang/tests/fixtures/deferred_field.jac +1 -1
- jaclang/tests/fixtures/del_clean.jac +7 -0
- jaclang/tests/fixtures/disconn.jac +2 -2
- jaclang/tests/fixtures/dynamic_archetype.jac +34 -0
- jaclang/tests/fixtures/edge_node_walk.jac +12 -12
- jaclang/tests/fixtures/edge_ops.jac +7 -7
- jaclang/tests/fixtures/edges_walk.jac +10 -10
- jaclang/tests/fixtures/edgetypeissue.jac +1 -1
- jaclang/tests/fixtures/enum_inside_archtype.jac +4 -4
- jaclang/tests/fixtures/err.impl.jac +1 -1
- jaclang/tests/fixtures/err.jac +2 -2
- jaclang/tests/fixtures/err_runtime.jac +2 -2
- jaclang/tests/fixtures/foo.jac +7 -7
- jaclang/tests/fixtures/game1.jac +4 -4
- jaclang/tests/fixtures/gendot_bubble_sort.jac +4 -4
- jaclang/tests/fixtures/glob_multivar_statement.jac +1 -1
- jaclang/tests/fixtures/guess_game.jac +5 -5
- jaclang/tests/fixtures/has_goodness.jac +1 -1
- jaclang/tests/fixtures/hash_init_check.jac +3 -3
- jaclang/tests/fixtures/hello.jac +1 -1
- jaclang/tests/fixtures/ignore.jac +3 -3
- jaclang/tests/fixtures/ignore_dup.jac +3 -3
- jaclang/tests/fixtures/impl_match_confused.impl.jac +1 -1
- jaclang/tests/fixtures/import.jac +9 -9
- jaclang/tests/fixtures/import_all.jac +1 -1
- jaclang/tests/fixtures/index_slice.jac +1 -1
- jaclang/tests/fixtures/inherit_check.jac +3 -3
- jaclang/tests/fixtures/jac_from_py.py +4 -0
- jaclang/tests/fixtures/jacsamp.jac +1 -1
- jaclang/tests/fixtures/jactest_main.jac +1 -1
- jaclang/tests/fixtures/jp_importer.jac +7 -8
- jaclang/tests/fixtures/jp_importer_auto.jac +3 -3
- jaclang/tests/fixtures/lambda.jac +2 -2
- jaclang/tests/fixtures/needs_import.jac +6 -6
- jaclang/tests/fixtures/needs_import_1.jac +1 -1
- jaclang/tests/fixtures/needs_import_2.jac +1 -1
- jaclang/tests/fixtures/needs_import_3.jac +1 -1
- jaclang/tests/fixtures/needs_import_dup.jac +6 -6
- jaclang/tests/fixtures/node_del.jac +60 -0
- jaclang/tests/fixtures/nosigself.jac +3 -3
- jaclang/tests/fixtures/py2jac.py +30 -0
- jaclang/tests/fixtures/py_bool_expr.py +7 -0
- jaclang/tests/fixtures/py_namedexpr.py +7 -0
- jaclang/tests/fixtures/pyfunc_3.py +0 -2
- jaclang/tests/fixtures/random_check.jac +5 -5
- jaclang/tests/fixtures/simple_archs.jac +2 -2
- jaclang/tests/fixtures/simple_walk.jac +52 -0
- jaclang/tests/fixtures/slice_vals.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep_multilev.jac +3 -3
- jaclang/tests/fixtures/trailing_comma.jac +4 -4
- jaclang/tests/fixtures/type_info.jac +5 -5
- jaclang/{compiler/passes/main/tests → tests}/fixtures/uninitialized_hasvars.jac +1 -1
- jaclang/tests/fixtures/visit_order.jac +4 -4
- jaclang/tests/fixtures/walker_override.jac +2 -2
- jaclang/tests/fixtures/walker_update.jac +5 -5
- jaclang/tests/fixtures/with_context.jac +4 -4
- jaclang/tests/test_bugs.py +2 -2
- jaclang/tests/test_cli.py +118 -223
- jaclang/tests/test_language.py +466 -473
- jaclang/tests/test_man_code.py +2 -2
- jaclang/tests/test_reference.py +4 -4
- jaclang/tests/test_settings.py +16 -16
- jaclang/tests/test_typecheck.py +555 -0
- jaclang/utils/__init__.py +4 -0
- jaclang/utils/helpers.py +12 -27
- jaclang/utils/lang_tools.py +84 -74
- jaclang/utils/module_resolver.py +69 -0
- jaclang/utils/test.py +8 -5
- jaclang/utils/tests/test_lang_tools.py +38 -13
- jaclang/utils/treeprinter.py +177 -40
- jaclang/vendor/__init__.py +1 -2
- jaclang/vendor/attr/__init__.py +14 -44
- jaclang/vendor/attr/__init__.pyi +155 -321
- jaclang/vendor/attr/_cmp.py +25 -15
- jaclang/vendor/attr/_cmp.pyi +7 -7
- jaclang/vendor/attr/_compat.py +15 -8
- jaclang/vendor/attr/_config.py +1 -1
- jaclang/vendor/attr/_funcs.py +148 -163
- jaclang/vendor/attr/_make.py +859 -855
- jaclang/vendor/attr/_next_gen.py +426 -32
- jaclang/vendor/attr/converters.py +67 -49
- jaclang/vendor/attr/converters.pyi +13 -7
- jaclang/vendor/attr/filters.py +17 -11
- jaclang/vendor/attr/filters.pyi +3 -3
- jaclang/vendor/attr/setters.py +11 -5
- jaclang/vendor/attr/setters.pyi +2 -1
- jaclang/vendor/attr/validators.py +191 -162
- jaclang/vendor/attr/validators.pyi +25 -27
- jaclang/vendor/attrs/__init__.py +9 -5
- jaclang/vendor/attrs/__init__.pyi +225 -29
- jaclang/vendor/attrs-25.3.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/METADATA +83 -53
- jaclang/vendor/attrs-25.3.0.dist-info/RECORD +56 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/WHEEL +1 -1
- jaclang/vendor/bin/dmypy +8 -0
- jaclang/vendor/bin/mypy +8 -0
- jaclang/vendor/bin/mypyc +8 -0
- jaclang/vendor/bin/stubgen +8 -0
- jaclang/vendor/bin/stubtest +8 -0
- jaclang/vendor/cattr/gen.py +2 -2
- jaclang/vendor/cattr/preconf/bson.py +1 -0
- jaclang/vendor/cattr/preconf/json.py +1 -0
- jaclang/vendor/cattr/preconf/msgpack.py +1 -0
- jaclang/vendor/cattr/preconf/orjson.py +1 -0
- jaclang/vendor/cattr/preconf/pyyaml.py +1 -0
- jaclang/vendor/cattr/preconf/tomlkit.py +1 -0
- jaclang/vendor/cattr/preconf/ujson.py +1 -0
- jaclang/vendor/cattrs/__init__.py +21 -21
- jaclang/vendor/cattrs/_compat.py +176 -62
- jaclang/vendor/cattrs/_generics.py +5 -3
- jaclang/vendor/cattrs/cols.py +289 -0
- jaclang/vendor/cattrs/converters.py +505 -187
- jaclang/vendor/cattrs/disambiguators.py +118 -45
- jaclang/vendor/cattrs/dispatch.py +66 -36
- jaclang/vendor/cattrs/fns.py +6 -1
- jaclang/vendor/cattrs/gen/__init__.py +365 -202
- jaclang/vendor/cattrs/gen/_generics.py +41 -5
- jaclang/vendor/cattrs/gen/_lc.py +3 -2
- jaclang/vendor/cattrs/gen/_shared.py +39 -32
- jaclang/vendor/cattrs/gen/typeddicts.py +75 -88
- jaclang/vendor/cattrs/preconf/__init__.py +20 -0
- jaclang/vendor/cattrs/preconf/bson.py +7 -8
- jaclang/vendor/cattrs/preconf/cbor2.py +3 -0
- jaclang/vendor/cattrs/preconf/json.py +8 -4
- jaclang/vendor/cattrs/preconf/msgpack.py +3 -0
- jaclang/vendor/cattrs/preconf/msgspec.py +185 -0
- jaclang/vendor/cattrs/preconf/orjson.py +20 -7
- jaclang/vendor/cattrs/preconf/pyyaml.py +15 -3
- jaclang/vendor/cattrs/preconf/tomlkit.py +3 -1
- jaclang/vendor/cattrs/preconf/ujson.py +3 -0
- jaclang/vendor/cattrs/strategies/__init__.py +1 -0
- jaclang/vendor/cattrs/strategies/_class_methods.py +1 -1
- jaclang/vendor/cattrs/strategies/_subclasses.py +43 -29
- jaclang/vendor/cattrs/strategies/_unions.py +47 -24
- jaclang/vendor/cattrs/v.py +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/INSTALLER +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/METADATA +161 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/RECORD +96 -0
- jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/WHEEL +1 -1
- jaclang/vendor/lark/__init__.py +38 -38
- jaclang/vendor/lark/__pyinstaller/__init__.py +6 -6
- jaclang/vendor/lark/__pyinstaller/hook-lark.py +14 -14
- jaclang/vendor/lark/ast_utils.py +59 -59
- jaclang/vendor/lark/common.py +86 -89
- jaclang/vendor/lark/exceptions.py +292 -292
- jaclang/vendor/lark/grammar.py +130 -130
- jaclang/vendor/lark/grammars/common.lark +59 -59
- jaclang/vendor/lark/grammars/lark.lark +62 -62
- jaclang/vendor/lark/grammars/python.lark +302 -302
- jaclang/vendor/lark/grammars/unicode.lark +7 -7
- jaclang/vendor/lark/indenter.py +143 -112
- jaclang/vendor/lark/lark.py +658 -661
- jaclang/vendor/lark/lexer.py +678 -678
- jaclang/vendor/lark/load_grammar.py +1428 -1428
- jaclang/vendor/lark/parse_tree_builder.py +391 -391
- jaclang/vendor/lark/parser_frontends.py +257 -257
- jaclang/vendor/lark/parsers/cyk.py +340 -340
- jaclang/vendor/lark/parsers/earley.py +317 -308
- jaclang/vendor/lark/parsers/earley_common.py +42 -42
- jaclang/vendor/lark/parsers/earley_forest.py +802 -810
- jaclang/vendor/lark/parsers/grammar_analysis.py +203 -203
- jaclang/vendor/lark/parsers/lalr_analysis.py +332 -332
- jaclang/vendor/lark/parsers/lalr_interactive_parser.py +158 -157
- jaclang/vendor/lark/parsers/lalr_parser.py +122 -122
- jaclang/vendor/lark/parsers/lalr_parser_state.py +110 -110
- jaclang/vendor/lark/parsers/xearley.py +165 -165
- jaclang/vendor/lark/reconstruct.py +107 -107
- jaclang/vendor/lark/tools/__init__.py +70 -71
- jaclang/vendor/lark/tools/nearley.py +202 -202
- jaclang/vendor/lark/tools/serialize.py +32 -32
- jaclang/vendor/lark/tools/standalone.py +196 -196
- jaclang/vendor/lark/tree.py +267 -272
- jaclang/vendor/lark/tree_matcher.py +186 -186
- jaclang/vendor/lark/utils.py +346 -361
- jaclang/vendor/lark/visitors.py +596 -593
- jaclang/vendor/lark-1.2.2.dist-info/INSTALLER +1 -0
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/METADATA +48 -47
- jaclang/vendor/lark-1.2.2.dist-info/RECORD +83 -0
- jaclang/vendor/{mypy_extensions-1.0.0.dist-info → lark-1.2.2.dist-info}/WHEEL +1 -1
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info/licenses}/LICENSE +18 -18
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/METADATA +2 -1
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/RECORD +17 -10
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/WHEEL +1 -1
- jaclang/vendor/pluggy/_version.py +7 -2
- jaclang/vendor/pluggy-1.5.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/pluggy-1.5.0.dist-info/METADATA +6 -5
- jaclang/vendor/pluggy-1.5.0.dist-info/RECORD +24 -14
- jaclang/vendor/pluggy-1.5.0.dist-info/WHEEL +1 -1
- jaclang/vendor/pygls-1.3.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/pygls-1.3.1.dist-info/METADATA +2 -2
- jaclang/vendor/pygls-1.3.1.dist-info/RECORD +45 -24
- jaclang/vendor/pygls-1.3.1.dist-info/WHEEL +1 -1
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/METADATA +4 -4
- jaclang-0.8.0.dist-info/RECORD +552 -0
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/WHEEL +1 -1
- jaclang/compiler/.gitignore +0 -1
- jaclang/compiler/compile.py +0 -119
- jaclang/compiler/passes/main/access_modifier_pass.py +0 -130
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +0 -656
- jaclang/compiler/passes/main/py_collect_dep_pass.py +0 -78
- jaclang/compiler/passes/main/pyout_pass.py +0 -86
- jaclang/compiler/passes/main/registry_pass.py +0 -156
- jaclang/compiler/passes/main/schedules.py +0 -47
- jaclang/compiler/passes/main/sub_node_tab_pass.py +0 -36
- jaclang/compiler/passes/main/tests/fixtures/registry.jac +0 -36
- jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py +0 -114
- jaclang/compiler/passes/main/tests/test_registry_pass.py +0 -31
- jaclang/compiler/passes/main/tests/test_type_check_pass.py +0 -91
- jaclang/compiler/passes/main/tests/test_typeinfo_pass.py +0 -29
- jaclang/compiler/passes/main/type_check_pass.py +0 -128
- jaclang/compiler/passes/tool/schedules.py +0 -18
- jaclang/compiler/passes/tool/tests/fixtures/genai/essay_review.jac +0 -36
- jaclang/compiler/passes/tool/tests/fixtures/genai/expert_answer.jac +0 -17
- jaclang/compiler/passes/tool/tests/fixtures/genai/joke_gen.jac +0 -32
- jaclang/compiler/passes/tool/tests/fixtures/genai/odd_word_out.jac +0 -27
- jaclang/compiler/passes/tool/tests/fixtures/genai/personality_finder.jac +0 -35
- jaclang/compiler/passes/tool/tests/fixtures/genai/text_to_type.jac +0 -25
- jaclang/compiler/passes/tool/tests/fixtures/genai/translator.jac +0 -13
- jaclang/compiler/passes/tool/tests/fixtures/genai/wikipedia.jac +0 -63
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/architype_test.jac +0 -13
- jaclang/compiler/passes/utils/mypy_ast_build.py +0 -940
- jaclang/compiler/py_info.py +0 -22
- jaclang/compiler/semtable.py +0 -159
- jaclang/compiler/symtable.py +0 -297
- jaclang/langserve/utils.py +0 -458
- jaclang/plugin/__init__.py +0 -7
- jaclang/plugin/builtin.py +0 -57
- jaclang/plugin/default.py +0 -1443
- jaclang/plugin/feature.py +0 -574
- jaclang/plugin/plugin.md +0 -471
- jaclang/plugin/spec.py +0 -536
- jaclang/plugin/tests/fixtures/impl_match_impl.jac +0 -3
- jaclang/plugin/tests/test_features.py +0 -56
- jaclang/runtimelib/context.py +0 -191
- jaclang/tests/fixtures/create_dynamic_architype.jac +0 -35
- jaclang/tests/fixtures/dynamic_architype.jac +0 -34
- jaclang/tests/fixtures/impl_grab.impl.jac +0 -5
- jaclang/tests/fixtures/mtest.impl.jac +0 -6
- jaclang/tests/fixtures/registry.jac +0 -58
- jaclang/tests/fixtures/semstr.jac +0 -30
- jaclang/tests/main.jac +0 -2
- jaclang/utils/profiler.py +0 -62
- jaclang/vendor/attrs-23.2.0.dist-info/RECORD +0 -35
- jaclang/vendor/cattrs-23.2.3.dist-info/METADATA +0 -221
- jaclang/vendor/cattrs-23.2.3.dist-info/RECORD +0 -48
- jaclang/vendor/lark-1.1.9.dist-info/RECORD +0 -46
- jaclang/vendor/lark-1.1.9.dist-info/WHEEL +0 -5
- jaclang/vendor/mypy/__init__.py +0 -1
- jaclang/vendor/mypy/__main__.py +0 -37
- jaclang/vendor/mypy/api.py +0 -94
- jaclang/vendor/mypy/applytype.py +0 -172
- jaclang/vendor/mypy/argmap.py +0 -268
- jaclang/vendor/mypy/binder.py +0 -538
- jaclang/vendor/mypy/bogus_type.py +0 -27
- jaclang/vendor/mypy/build.py +0 -3562
- jaclang/vendor/mypy/checker.py +0 -8445
- jaclang/vendor/mypy/checkexpr.py +0 -6623
- jaclang/vendor/mypy/checkmember.py +0 -1363
- jaclang/vendor/mypy/checkpattern.py +0 -801
- jaclang/vendor/mypy/checkstrformat.py +0 -1109
- jaclang/vendor/mypy/config_parser.py +0 -670
- jaclang/vendor/mypy/constant_fold.py +0 -187
- jaclang/vendor/mypy/constraints.py +0 -1636
- jaclang/vendor/mypy/copytype.py +0 -133
- jaclang/vendor/mypy/defaults.py +0 -46
- jaclang/vendor/mypy/dmypy/__main__.py +0 -6
- jaclang/vendor/mypy/dmypy/client.py +0 -749
- jaclang/vendor/mypy/dmypy_os.py +0 -42
- jaclang/vendor/mypy/dmypy_server.py +0 -1107
- jaclang/vendor/mypy/dmypy_util.py +0 -117
- jaclang/vendor/mypy/erasetype.py +0 -278
- jaclang/vendor/mypy/errorcodes.py +0 -291
- jaclang/vendor/mypy/errors.py +0 -1280
- jaclang/vendor/mypy/evalexpr.py +0 -205
- jaclang/vendor/mypy/expandtype.py +0 -524
- jaclang/vendor/mypy/exprtotype.py +0 -209
- jaclang/vendor/mypy/fastparse.py +0 -2147
- jaclang/vendor/mypy/find_sources.py +0 -243
- jaclang/vendor/mypy/fixup.py +0 -428
- jaclang/vendor/mypy/freetree.py +0 -23
- jaclang/vendor/mypy/fscache.py +0 -309
- jaclang/vendor/mypy/fswatcher.py +0 -106
- jaclang/vendor/mypy/gclogger.py +0 -47
- jaclang/vendor/mypy/git.py +0 -34
- jaclang/vendor/mypy/graph_utils.py +0 -112
- jaclang/vendor/mypy/indirection.py +0 -121
- jaclang/vendor/mypy/infer.py +0 -75
- jaclang/vendor/mypy/inspections.py +0 -627
- jaclang/vendor/mypy/ipc.py +0 -310
- jaclang/vendor/mypy/join.py +0 -871
- jaclang/vendor/mypy/literals.py +0 -306
- jaclang/vendor/mypy/lookup.py +0 -61
- jaclang/vendor/mypy/main.py +0 -1574
- jaclang/vendor/mypy/maptype.py +0 -106
- jaclang/vendor/mypy/meet.py +0 -1140
- jaclang/vendor/mypy/memprofile.py +0 -121
- jaclang/vendor/mypy/message_registry.py +0 -329
- jaclang/vendor/mypy/messages.py +0 -3186
- jaclang/vendor/mypy/metastore.py +0 -225
- jaclang/vendor/mypy/mixedtraverser.py +0 -112
- jaclang/vendor/mypy/modulefinder.py +0 -875
- jaclang/vendor/mypy/moduleinspect.py +0 -184
- jaclang/vendor/mypy/mro.py +0 -62
- jaclang/vendor/mypy/nodes.py +0 -4115
- jaclang/vendor/mypy/operators.py +0 -126
- jaclang/vendor/mypy/options.py +0 -556
- jaclang/vendor/mypy/parse.py +0 -30
- jaclang/vendor/mypy/partially_defined.py +0 -675
- jaclang/vendor/mypy/patterns.py +0 -150
- jaclang/vendor/mypy/plugin.py +0 -901
- jaclang/vendor/mypy/plugins/attrs.py +0 -1166
- jaclang/vendor/mypy/plugins/common.py +0 -440
- jaclang/vendor/mypy/plugins/ctypes.py +0 -245
- jaclang/vendor/mypy/plugins/dataclasses.py +0 -1108
- jaclang/vendor/mypy/plugins/default.py +0 -531
- jaclang/vendor/mypy/plugins/enums.py +0 -259
- jaclang/vendor/mypy/plugins/functools.py +0 -104
- jaclang/vendor/mypy/plugins/proper_plugin.py +0 -175
- jaclang/vendor/mypy/plugins/singledispatch.py +0 -224
- jaclang/vendor/mypy/py.typed +0 -1
- jaclang/vendor/mypy/pyinfo.py +0 -78
- jaclang/vendor/mypy/reachability.py +0 -362
- jaclang/vendor/mypy/refinfo.py +0 -92
- jaclang/vendor/mypy/renaming.py +0 -568
- jaclang/vendor/mypy/report.py +0 -924
- jaclang/vendor/mypy/scope.py +0 -125
- jaclang/vendor/mypy/semanal.py +0 -7187
- jaclang/vendor/mypy/semanal_classprop.py +0 -187
- jaclang/vendor/mypy/semanal_enum.py +0 -253
- jaclang/vendor/mypy/semanal_infer.py +0 -128
- jaclang/vendor/mypy/semanal_main.py +0 -511
- jaclang/vendor/mypy/semanal_namedtuple.py +0 -670
- jaclang/vendor/mypy/semanal_newtype.py +0 -273
- jaclang/vendor/mypy/semanal_pass1.py +0 -156
- jaclang/vendor/mypy/semanal_shared.py +0 -490
- jaclang/vendor/mypy/semanal_typeargs.py +0 -265
- jaclang/vendor/mypy/semanal_typeddict.py +0 -575
- jaclang/vendor/mypy/server/astdiff.py +0 -518
- jaclang/vendor/mypy/server/astmerge.py +0 -562
- jaclang/vendor/mypy/server/aststrip.py +0 -281
- jaclang/vendor/mypy/server/deps.py +0 -1137
- jaclang/vendor/mypy/server/mergecheck.py +0 -83
- jaclang/vendor/mypy/server/objgraph.py +0 -101
- jaclang/vendor/mypy/server/subexpr.py +0 -198
- jaclang/vendor/mypy/server/target.py +0 -11
- jaclang/vendor/mypy/server/trigger.py +0 -26
- jaclang/vendor/mypy/server/update.py +0 -1339
- jaclang/vendor/mypy/sharedparse.py +0 -112
- jaclang/vendor/mypy/solve.py +0 -562
- jaclang/vendor/mypy/split_namespace.py +0 -35
- jaclang/vendor/mypy/state.py +0 -28
- jaclang/vendor/mypy/stats.py +0 -489
- jaclang/vendor/mypy/strconv.py +0 -641
- jaclang/vendor/mypy/stubdoc.py +0 -491
- jaclang/vendor/mypy/stubgen.py +0 -1886
- jaclang/vendor/mypy/stubgenc.py +0 -993
- jaclang/vendor/mypy/stubinfo.py +0 -173
- jaclang/vendor/mypy/stubtest.py +0 -2079
- jaclang/vendor/mypy/stubutil.py +0 -834
- jaclang/vendor/mypy/subtypes.py +0 -1980
- jaclang/vendor/mypy/suggestions.py +0 -1046
- jaclang/vendor/mypy/test/config.py +0 -28
- jaclang/vendor/mypy/test/data.py +0 -821
- jaclang/vendor/mypy/test/helpers.py +0 -476
- jaclang/vendor/mypy/test/meta/_pytest.py +0 -72
- jaclang/vendor/mypy/test/meta/test_diff_helper.py +0 -47
- jaclang/vendor/mypy/test/meta/test_parse_data.py +0 -73
- jaclang/vendor/mypy/test/meta/test_update_data.py +0 -135
- jaclang/vendor/mypy/test/test_find_sources.py +0 -376
- jaclang/vendor/mypy/test/test_ref_info.py +0 -45
- jaclang/vendor/mypy/test/testapi.py +0 -45
- jaclang/vendor/mypy/test/testargs.py +0 -77
- jaclang/vendor/mypy/test/testcheck.py +0 -322
- jaclang/vendor/mypy/test/testcmdline.py +0 -152
- jaclang/vendor/mypy/test/testconstraints.py +0 -134
- jaclang/vendor/mypy/test/testdaemon.py +0 -132
- jaclang/vendor/mypy/test/testdeps.py +0 -77
- jaclang/vendor/mypy/test/testdiff.py +0 -67
- jaclang/vendor/mypy/test/testerrorstream.py +0 -46
- jaclang/vendor/mypy/test/testfinegrained.py +0 -438
- jaclang/vendor/mypy/test/testfinegrainedcache.py +0 -18
- jaclang/vendor/mypy/test/testformatter.py +0 -85
- jaclang/vendor/mypy/test/testfscache.py +0 -101
- jaclang/vendor/mypy/test/testgraph.py +0 -83
- jaclang/vendor/mypy/test/testinfer.py +0 -373
- jaclang/vendor/mypy/test/testipc.py +0 -119
- jaclang/vendor/mypy/test/testmerge.py +0 -238
- jaclang/vendor/mypy/test/testmodulefinder.py +0 -278
- jaclang/vendor/mypy/test/testmypyc.py +0 -14
- jaclang/vendor/mypy/test/testparse.py +0 -107
- jaclang/vendor/mypy/test/testpep561.py +0 -211
- jaclang/vendor/mypy/test/testpythoneval.py +0 -117
- jaclang/vendor/mypy/test/testreports.py +0 -55
- jaclang/vendor/mypy/test/testsemanal.py +0 -209
- jaclang/vendor/mypy/test/testsolve.py +0 -285
- jaclang/vendor/mypy/test/teststubgen.py +0 -1412
- jaclang/vendor/mypy/test/teststubinfo.py +0 -12
- jaclang/vendor/mypy/test/teststubtest.py +0 -2492
- jaclang/vendor/mypy/test/testsubtypes.py +0 -303
- jaclang/vendor/mypy/test/testtransform.py +0 -64
- jaclang/vendor/mypy/test/testtypegen.py +0 -83
- jaclang/vendor/mypy/test/testtypes.py +0 -1551
- jaclang/vendor/mypy/test/testutil.py +0 -111
- jaclang/vendor/mypy/test/typefixture.py +0 -415
- jaclang/vendor/mypy/test/update_data.py +0 -87
- jaclang/vendor/mypy/test/visitors.py +0 -63
- jaclang/vendor/mypy/traverser.py +0 -961
- jaclang/vendor/mypy/treetransform.py +0 -800
- jaclang/vendor/mypy/tvar_scope.py +0 -169
- jaclang/vendor/mypy/type_visitor.py +0 -564
- jaclang/vendor/mypy/typeanal.py +0 -2596
- jaclang/vendor/mypy/typeops.py +0 -1082
- jaclang/vendor/mypy/types.py +0 -3708
- jaclang/vendor/mypy/types_utils.py +0 -166
- jaclang/vendor/mypy/typeshed/LICENSE +0 -237
- jaclang/vendor/mypy/typeshed/stdlib/VERSIONS +0 -309
- jaclang/vendor/mypy/typeshed/stdlib/__future__.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/__main__.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/_ast.pyi +0 -591
- jaclang/vendor/mypy/typeshed/stdlib/_bisect.pyi +0 -84
- jaclang/vendor/mypy/typeshed/stdlib/_bootlocale.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/_codecs.pyi +0 -133
- jaclang/vendor/mypy/typeshed/stdlib/_collections_abc.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/_compat_pickle.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/_compression.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/_csv.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/_ctypes.pyi +0 -207
- jaclang/vendor/mypy/typeshed/stdlib/_curses.pyi +0 -566
- jaclang/vendor/mypy/typeshed/stdlib/_decimal.pyi +0 -281
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_thread.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_threading.pyi +0 -164
- jaclang/vendor/mypy/typeshed/stdlib/_heapq.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/_imp.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/_json.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/_locale.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/_lsprof.pyi +0 -35
- jaclang/vendor/mypy/typeshed/stdlib/_markupbase.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_msi.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/_operator.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/_osx_support.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/_posixsubprocess.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_py_abc.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/_pydecimal.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/_random.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/_sitebuiltins.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_socket.pyi +0 -803
- jaclang/vendor/mypy/typeshed/stdlib/_stat.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/_thread.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/_threading_local.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_tkinter.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/_tracemalloc.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/__init__.pyi +0 -347
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/xml.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/_warnings.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/_weakref.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/_weakrefset.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/_winapi.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/abc.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/aifc.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/antigravity.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/argparse.pyi +0 -595
- jaclang/vendor/mypy/typeshed/stdlib/array.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/ast.pyi +0 -277
- jaclang/vendor/mypy/typeshed/stdlib/asynchat.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/__init__.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_events.pyi +0 -440
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_futures.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/constants.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/coroutines.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/events.pyi +0 -580
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/exceptions.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/futures.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/locks.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/log.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/mixins.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +0 -64
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/protocols.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/queues.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/runners.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/selector_events.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/sslproto.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/staggered.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/streams.pyi +0 -153
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/subprocess.pyi +0 -229
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/tasks.pyi +0 -497
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/threads.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/timeouts.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/transports.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/trsock.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/unix_events.pyi +0 -196
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_events.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/asyncore.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/atexit.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/audioop.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/base64.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/bdb.pyi +0 -102
- jaclang/vendor/mypy/typeshed/stdlib/binascii.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/binhex.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/bisect.pyi +0 -4
- jaclang/vendor/mypy/typeshed/stdlib/builtins.pyi +0 -1936
- jaclang/vendor/mypy/typeshed/stdlib/bz2.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/cProfile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/calendar.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/cgi.pyi +0 -118
- jaclang/vendor/mypy/typeshed/stdlib/cgitb.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/chunk.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/cmath.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/cmd.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/code.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/codecs.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/codeop.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/collections/__init__.pyi +0 -485
- jaclang/vendor/mypy/typeshed/stdlib/collections/abc.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/colorsys.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/compileall.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +0 -126
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/process.pyi +0 -233
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/configparser.pyi +0 -313
- jaclang/vendor/mypy/typeshed/stdlib/contextlib.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/contextvars.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/copy.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/copyreg.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/crypt.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/csv.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/__init__.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/_endian.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/util.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/wintypes.pyi +0 -298
- jaclang/vendor/mypy/typeshed/stdlib/curses/__init__.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/ascii.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/curses/has_key.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/curses/panel.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/textpad.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/dataclasses.pyi +0 -315
- jaclang/vendor/mypy/typeshed/stdlib/datetime.pyi +0 -295
- jaclang/vendor/mypy/typeshed/stdlib/dbm/__init__.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/dbm/dumb.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/dbm/gnu.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/dbm/ndbm.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/decimal.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/difflib.pyi +0 -140
- jaclang/vendor/mypy/typeshed/stdlib/dis.pyi +0 -144
- jaclang/vendor/mypy/typeshed/stdlib/distutils/__init__.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/distutils/archive_util.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/ccompiler.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cmd.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_py.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/check.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/clean.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/config.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_data.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/register.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/sdist.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/upload.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/config.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/core.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/debug.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dep_util.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dir_util.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dist.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/distutils/errors.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/extension.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/distutils/file_util.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/distutils/filelist.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/log.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/spawn.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/distutils/sysconfig.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/text_file.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/util.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/distutils/version.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/doctest.pyi +0 -248
- jaclang/vendor/mypy/typeshed/stdlib/dummy_threading.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/email/__init__.pyi +0 -29
- jaclang/vendor/mypy/typeshed/stdlib/email/_header_value_parser.pyi +0 -392
- jaclang/vendor/mypy/typeshed/stdlib/email/_policybase.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/email/base64mime.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/email/charset.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/email/contentmanager.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/email/encoders.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/errors.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/email/feedparser.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/email/generator.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/email/header.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/email/headerregistry.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/email/iterators.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/email/message.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/application.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/audio.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/base.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/image.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/message.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/multipart.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/text.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/email/parser.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/email/policy.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/email/quoprimime.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/email/utils.pyi +0 -70
- jaclang/vendor/mypy/typeshed/stdlib/encodings/__init__.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/ensurepip/__init__.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/enum.pyi +0 -320
- jaclang/vendor/mypy/typeshed/stdlib/errno.pyi +0 -222
- jaclang/vendor/mypy/typeshed/stdlib/faulthandler.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/fcntl.pyi +0 -127
- jaclang/vendor/mypy/typeshed/stdlib/filecmp.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/fileinput.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/fnmatch.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/formatter.pyi +0 -88
- jaclang/vendor/mypy/typeshed/stdlib/fractions.pyi +0 -150
- jaclang/vendor/mypy/typeshed/stdlib/ftplib.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/functools.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/gc.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/genericpath.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/getopt.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/getpass.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/gettext.pyi +0 -169
- jaclang/vendor/mypy/typeshed/stdlib/glob.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/graphlib.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/grp.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/gzip.pyi +0 -160
- jaclang/vendor/mypy/typeshed/stdlib/hashlib.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/heapq.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/hmac.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/html/__init__.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/entities.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/parser.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/http/__init__.pyi +0 -105
- jaclang/vendor/mypy/typeshed/stdlib/http/client.pyi +0 -259
- jaclang/vendor/mypy/typeshed/stdlib/http/cookiejar.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/http/cookies.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/http/server.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/imaplib.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/imghdr.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/imp.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/importlib/__init__.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/importlib/_abc.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/importlib/abc.pyi +0 -172
- jaclang/vendor/mypy/typeshed/stdlib/importlib/machinery.pyi +0 -179
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/importlib/readers.pyi +0 -68
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/abc.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/readers.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/simple.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/importlib/simple.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/importlib/util.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/inspect.pyi +0 -632
- jaclang/vendor/mypy/typeshed/stdlib/io.pyi +0 -238
- jaclang/vendor/mypy/typeshed/stdlib/ipaddress.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/itertools.pyi +0 -273
- jaclang/vendor/mypy/typeshed/stdlib/json/__init__.pyi +0 -61
- jaclang/vendor/mypy/typeshed/stdlib/json/decoder.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/json/encoder.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/json/tool.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/keyword.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/main.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +0 -96
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pygram.pyi +0 -114
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pytree.pyi +0 -117
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/refactor.pyi +0 -82
- jaclang/vendor/mypy/typeshed/stdlib/linecache.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/locale.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/logging/__init__.pyi +0 -658
- jaclang/vendor/mypy/typeshed/stdlib/logging/config.pyi +0 -134
- jaclang/vendor/mypy/typeshed/stdlib/logging/handlers.pyi +0 -275
- jaclang/vendor/mypy/typeshed/stdlib/lzma.pyi +0 -197
- jaclang/vendor/mypy/typeshed/stdlib/mailbox.pyi +0 -256
- jaclang/vendor/mypy/typeshed/stdlib/mailcap.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/marshal.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/math.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/mimetypes.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/mmap.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/modulefinder.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/msilib/__init__.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/msilib/schema.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/msilib/sequence.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/msilib/text.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/msvcrt.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/connection.pyi +0 -75
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/context.pyi +0 -189
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +0 -77
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/heap.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/managers.pyi +0 -212
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/pool.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/process.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/queues.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +0 -107
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/util.pyi +0 -98
- jaclang/vendor/mypy/typeshed/stdlib/netrc.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/nis.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/nntplib.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/nt.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/ntpath.pyi +0 -119
- jaclang/vendor/mypy/typeshed/stdlib/nturl2path.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/numbers.pyi +0 -209
- jaclang/vendor/mypy/typeshed/stdlib/opcode.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/operator.pyi +0 -110
- jaclang/vendor/mypy/typeshed/stdlib/optparse.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/os/__init__.pyi +0 -1157
- jaclang/vendor/mypy/typeshed/stdlib/os/path.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/ossaudiodev.pyi +0 -131
- jaclang/vendor/mypy/typeshed/stdlib/parser.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/pathlib.pyi +0 -232
- jaclang/vendor/mypy/typeshed/stdlib/pdb.pyi +0 -181
- jaclang/vendor/mypy/typeshed/stdlib/pickle.pyi +0 -271
- jaclang/vendor/mypy/typeshed/stdlib/pickletools.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/pipes.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/pkgutil.pyi +0 -53
- jaclang/vendor/mypy/typeshed/stdlib/platform.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/plistlib.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/poplib.pyi +0 -71
- jaclang/vendor/mypy/typeshed/stdlib/posix.pyi +0 -361
- jaclang/vendor/mypy/typeshed/stdlib/posixpath.pyi +0 -161
- jaclang/vendor/mypy/typeshed/stdlib/pprint.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/profile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/pstats.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/pty.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/pwd.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/py_compile.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/pyclbr.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/pydoc.pyi +0 -261
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/topics.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/__init__.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/errors.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/model.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/queue.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/quopri.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/random.pyi +0 -138
- jaclang/vendor/mypy/typeshed/stdlib/re.pyi +0 -290
- jaclang/vendor/mypy/typeshed/stdlib/readline.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/reprlib.pyi +0 -65
- jaclang/vendor/mypy/typeshed/stdlib/resource.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/rlcompleter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/runpy.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/sched.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/secrets.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/select.pyi +0 -155
- jaclang/vendor/mypy/typeshed/stdlib/selectors.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/shelve.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/shlex.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/shutil.pyi +0 -185
- jaclang/vendor/mypy/typeshed/stdlib/signal.pyi +0 -188
- jaclang/vendor/mypy/typeshed/stdlib/site.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/smtpd.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/smtplib.pyi +0 -204
- jaclang/vendor/mypy/typeshed/stdlib/sndhdr.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/socket.pyi +0 -825
- jaclang/vendor/mypy/typeshed/stdlib/socketserver.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/spwd.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +0 -551
- jaclang/vendor/mypy/typeshed/stdlib/sre_compile.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/sre_constants.pyi +0 -130
- jaclang/vendor/mypy/typeshed/stdlib/sre_parse.pyi +0 -104
- jaclang/vendor/mypy/typeshed/stdlib/ssl.pyi +0 -537
- jaclang/vendor/mypy/typeshed/stdlib/stat.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/statistics.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/string.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/stringprep.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/struct.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/subprocess.pyi +0 -2615
- jaclang/vendor/mypy/typeshed/stdlib/sunau.pyi +0 -86
- jaclang/vendor/mypy/typeshed/stdlib/symbol.pyi +0 -93
- jaclang/vendor/mypy/typeshed/stdlib/symtable.pyi +0 -58
- jaclang/vendor/mypy/typeshed/stdlib/sys/__init__.pyi +0 -373
- jaclang/vendor/mypy/typeshed/stdlib/sys/_monitoring.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/sysconfig.pyi +0 -48
- jaclang/vendor/mypy/typeshed/stdlib/syslog.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/tabnanny.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tarfile.pyi +0 -441
- jaclang/vendor/mypy/typeshed/stdlib/telnetlib.pyi +0 -122
- jaclang/vendor/mypy/typeshed/stdlib/tempfile.pyi +0 -477
- jaclang/vendor/mypy/typeshed/stdlib/termios.pyi +0 -267
- jaclang/vendor/mypy/typeshed/stdlib/textwrap.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/this.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/threading.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/time.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/timeit.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/__init__.pyi +0 -3654
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/commondialog.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/constants.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dialog.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dnd.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/filedialog.pyi +0 -151
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/font.pyi +0 -116
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/messagebox.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/tix.pyi +0 -299
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/ttk.pyi +0 -1204
- jaclang/vendor/mypy/typeshed/stdlib/token.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/tokenize.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/tomllib.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/trace.pyi +0 -79
- jaclang/vendor/mypy/typeshed/stdlib/traceback.pyi +0 -262
- jaclang/vendor/mypy/typeshed/stdlib/tracemalloc.pyi +0 -124
- jaclang/vendor/mypy/typeshed/stdlib/tty.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/turtle.pyi +0 -713
- jaclang/vendor/mypy/typeshed/stdlib/types.pyi +0 -614
- jaclang/vendor/mypy/typeshed/stdlib/typing.pyi +0 -976
- jaclang/vendor/mypy/typeshed/stdlib/typing_extensions.pyi +0 -509
- jaclang/vendor/mypy/typeshed/stdlib/unicodedata.pyi +0 -73
- jaclang/vendor/mypy/typeshed/stdlib/unittest/__init__.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/unittest/_log.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/unittest/async_case.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/unittest/case.pyi +0 -342
- jaclang/vendor/mypy/typeshed/stdlib/unittest/loader.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/unittest/main.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/unittest/mock.pyi +0 -430
- jaclang/vendor/mypy/typeshed/stdlib/unittest/result.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/unittest/runner.pyi +0 -72
- jaclang/vendor/mypy/typeshed/stdlib/unittest/signals.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/unittest/suite.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/unittest/util.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/urllib/error.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/parse.pyi +0 -210
- jaclang/vendor/mypy/typeshed/stdlib/urllib/request.pyi +0 -400
- jaclang/vendor/mypy/typeshed/stdlib/urllib/response.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/urllib/robotparser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/uu.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/uuid.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/warnings.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/wave.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/weakref.pyi +0 -149
- jaclang/vendor/mypy/typeshed/stdlib/webbrowser.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/winreg.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/winsound.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/handlers.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/headers.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/types.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/util.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/validate.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/xdrlib.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/xml/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/__init__.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/domreg.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minidom.pyi +0 -404
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +0 -327
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/__init__.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/handler.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +0 -87
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/client.pyi +0 -296
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/server.pyi +0 -143
- jaclang/vendor/mypy/typeshed/stdlib/xxlimited.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/zipapp.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/__init__.pyi +0 -306
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/_path.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/zipimport.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/zlib.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +0 -218
- jaclang/vendor/mypy/typestate.py +0 -323
- jaclang/vendor/mypy/typetraverser.py +0 -148
- jaclang/vendor/mypy/typevars.py +0 -93
- jaclang/vendor/mypy/typevartuples.py +0 -32
- jaclang/vendor/mypy/util.py +0 -869
- jaclang/vendor/mypy/version.py +0 -1
- jaclang/vendor/mypy/visitor.py +0 -621
- jaclang/vendor/mypy/xml/mypy-html.css +0 -104
- jaclang/vendor/mypy/xml/mypy-html.xslt +0 -81
- jaclang/vendor/mypy/xml/mypy-txt.xslt +0 -100
- jaclang/vendor/mypy/xml/mypy.xsd +0 -50
- jaclang/vendor/mypy-1.10.0.dist-info/LICENSE +0 -229
- jaclang/vendor/mypy-1.10.0.dist-info/METADATA +0 -48
- jaclang/vendor/mypy-1.10.0.dist-info/RECORD +0 -1241
- jaclang/vendor/mypy-1.10.0.dist-info/WHEEL +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/entry_points.txt +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/top_level.txt +0 -3
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/LICENSE +0 -27
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/METADATA +0 -29
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/RECORD +0 -6
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/top_level.txt +0 -1
- jaclang/vendor/mypy_extensions.py +0 -213
- jaclang/vendor/mypyc/README.md +0 -133
- jaclang/vendor/mypyc/__init__.py +0 -0
- jaclang/vendor/mypyc/__main__.py +0 -57
- jaclang/vendor/mypyc/analysis/__init__.py +0 -0
- jaclang/vendor/mypyc/analysis/attrdefined.py +0 -436
- jaclang/vendor/mypyc/analysis/blockfreq.py +0 -32
- jaclang/vendor/mypyc/analysis/dataflow.py +0 -628
- jaclang/vendor/mypyc/analysis/ircheck.py +0 -433
- jaclang/vendor/mypyc/analysis/selfleaks.py +0 -211
- jaclang/vendor/mypyc/build.py +0 -616
- jaclang/vendor/mypyc/codegen/__init__.py +0 -0
- jaclang/vendor/mypyc/codegen/cstring.py +0 -54
- jaclang/vendor/mypyc/codegen/emit.py +0 -1193
- jaclang/vendor/mypyc/codegen/emitclass.py +0 -1060
- jaclang/vendor/mypyc/codegen/emitfunc.py +0 -852
- jaclang/vendor/mypyc/codegen/emitmodule.py +0 -1136
- jaclang/vendor/mypyc/codegen/emitwrapper.py +0 -979
- jaclang/vendor/mypyc/codegen/literals.py +0 -302
- jaclang/vendor/mypyc/common.py +0 -136
- jaclang/vendor/mypyc/crash.py +0 -31
- jaclang/vendor/mypyc/doc/Makefile +0 -20
- jaclang/vendor/mypyc/doc/bool_operations.rst +0 -27
- jaclang/vendor/mypyc/doc/compilation_units.rst +0 -20
- jaclang/vendor/mypyc/doc/conf.py +0 -59
- jaclang/vendor/mypyc/doc/cpython-timings.md +0 -25
- jaclang/vendor/mypyc/doc/dev-intro.md +0 -548
- jaclang/vendor/mypyc/doc/dict_operations.rst +0 -59
- jaclang/vendor/mypyc/doc/differences_from_python.rst +0 -332
- jaclang/vendor/mypyc/doc/float_operations.rst +0 -50
- jaclang/vendor/mypyc/doc/future.md +0 -42
- jaclang/vendor/mypyc/doc/getting_started.rst +0 -240
- jaclang/vendor/mypyc/doc/index.rst +0 -61
- jaclang/vendor/mypyc/doc/int_operations.rst +0 -162
- jaclang/vendor/mypyc/doc/introduction.rst +0 -150
- jaclang/vendor/mypyc/doc/list_operations.rst +0 -65
- jaclang/vendor/mypyc/doc/make.bat +0 -35
- jaclang/vendor/mypyc/doc/native_classes.rst +0 -206
- jaclang/vendor/mypyc/doc/native_operations.rst +0 -55
- jaclang/vendor/mypyc/doc/performance_tips_and_tricks.rst +0 -244
- jaclang/vendor/mypyc/doc/set_operations.rst +0 -47
- jaclang/vendor/mypyc/doc/str_operations.rst +0 -35
- jaclang/vendor/mypyc/doc/tuple_operations.rst +0 -33
- jaclang/vendor/mypyc/doc/using_type_annotations.rst +0 -398
- jaclang/vendor/mypyc/errors.py +0 -29
- jaclang/vendor/mypyc/external/googletest/LICENSE +0 -28
- jaclang/vendor/mypyc/external/googletest/README.md +0 -280
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-death-test.h +0 -294
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-message.h +0 -250
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h +0 -1444
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +0 -510
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-printers.h +0 -993
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-spi.h +0 -232
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-test-part.h +0 -179
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-typed-test.h +0 -263
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest.h +0 -2236
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_pred_impl.h +0 -358
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_prod.h +0 -58
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +0 -69
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest.h +0 -41
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -319
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +0 -206
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-internal.h +0 -1238
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5146
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -286
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +0 -731
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +0 -93
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port.h +0 -2560
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-string.h +0 -167
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +0 -3331
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -297
- jaclang/vendor/mypyc/external/googletest/make/Makefile +0 -61
- jaclang/vendor/mypyc/external/googletest/src/gtest-all.cc +0 -48
- jaclang/vendor/mypyc/external/googletest/src/gtest-death-test.cc +0 -1342
- jaclang/vendor/mypyc/external/googletest/src/gtest-filepath.cc +0 -387
- jaclang/vendor/mypyc/external/googletest/src/gtest-internal-inl.h +0 -1183
- jaclang/vendor/mypyc/external/googletest/src/gtest-port.cc +0 -1259
- jaclang/vendor/mypyc/external/googletest/src/gtest-printers.cc +0 -373
- jaclang/vendor/mypyc/external/googletest/src/gtest-test-part.cc +0 -110
- jaclang/vendor/mypyc/external/googletest/src/gtest-typed-test.cc +0 -118
- jaclang/vendor/mypyc/external/googletest/src/gtest.cc +0 -5388
- jaclang/vendor/mypyc/external/googletest/src/gtest_main.cc +0 -38
- jaclang/vendor/mypyc/ir/__init__.py +0 -0
- jaclang/vendor/mypyc/ir/class_ir.py +0 -499
- jaclang/vendor/mypyc/ir/func_ir.py +0 -370
- jaclang/vendor/mypyc/ir/module_ir.py +0 -88
- jaclang/vendor/mypyc/ir/ops.py +0 -1727
- jaclang/vendor/mypyc/ir/pprint.py +0 -516
- jaclang/vendor/mypyc/ir/rtypes.py +0 -1038
- jaclang/vendor/mypyc/irbuild/__init__.py +0 -0
- jaclang/vendor/mypyc/irbuild/ast_helpers.py +0 -123
- jaclang/vendor/mypyc/irbuild/builder.py +0 -1394
- jaclang/vendor/mypyc/irbuild/callable_class.py +0 -173
- jaclang/vendor/mypyc/irbuild/classdef.py +0 -850
- jaclang/vendor/mypyc/irbuild/constant_fold.py +0 -95
- jaclang/vendor/mypyc/irbuild/context.py +0 -186
- jaclang/vendor/mypyc/irbuild/env_class.py +0 -223
- jaclang/vendor/mypyc/irbuild/expression.py +0 -1070
- jaclang/vendor/mypyc/irbuild/for_helpers.py +0 -1075
- jaclang/vendor/mypyc/irbuild/format_str_tokenizer.py +0 -250
- jaclang/vendor/mypyc/irbuild/function.py +0 -1088
- jaclang/vendor/mypyc/irbuild/generator.py +0 -346
- jaclang/vendor/mypyc/irbuild/ll_builder.py +0 -2389
- jaclang/vendor/mypyc/irbuild/main.py +0 -153
- jaclang/vendor/mypyc/irbuild/mapper.py +0 -221
- jaclang/vendor/mypyc/irbuild/match.py +0 -355
- jaclang/vendor/mypyc/irbuild/nonlocalcontrol.py +0 -197
- jaclang/vendor/mypyc/irbuild/prebuildvisitor.py +0 -203
- jaclang/vendor/mypyc/irbuild/prepare.py +0 -609
- jaclang/vendor/mypyc/irbuild/specialize.py +0 -822
- jaclang/vendor/mypyc/irbuild/statement.py +0 -1017
- jaclang/vendor/mypyc/irbuild/targets.py +0 -57
- jaclang/vendor/mypyc/irbuild/util.py +0 -189
- jaclang/vendor/mypyc/irbuild/visitor.py +0 -401
- jaclang/vendor/mypyc/irbuild/vtable.py +0 -82
- jaclang/vendor/mypyc/lib-rt/CPy.h +0 -638
- jaclang/vendor/mypyc/lib-rt/bytes_ops.c +0 -143
- jaclang/vendor/mypyc/lib-rt/dict_ops.c +0 -446
- jaclang/vendor/mypyc/lib-rt/exc_ops.c +0 -259
- jaclang/vendor/mypyc/lib-rt/float_ops.c +0 -192
- jaclang/vendor/mypyc/lib-rt/generic_ops.c +0 -64
- jaclang/vendor/mypyc/lib-rt/getargs.c +0 -450
- jaclang/vendor/mypyc/lib-rt/getargsfast.c +0 -569
- jaclang/vendor/mypyc/lib-rt/init.c +0 -13
- jaclang/vendor/mypyc/lib-rt/int_ops.c +0 -803
- jaclang/vendor/mypyc/lib-rt/list_ops.c +0 -335
- jaclang/vendor/mypyc/lib-rt/misc_ops.c +0 -942
- jaclang/vendor/mypyc/lib-rt/module_shim.tmpl +0 -18
- jaclang/vendor/mypyc/lib-rt/mypyc_util.h +0 -118
- jaclang/vendor/mypyc/lib-rt/pythoncapi_compat.h +0 -497
- jaclang/vendor/mypyc/lib-rt/pythonsupport.h +0 -533
- jaclang/vendor/mypyc/lib-rt/set_ops.c +0 -17
- jaclang/vendor/mypyc/lib-rt/setup.py +0 -70
- jaclang/vendor/mypyc/lib-rt/str_ops.c +0 -241
- jaclang/vendor/mypyc/lib-rt/test_capi.cc +0 -585
- jaclang/vendor/mypyc/lib-rt/tuple_ops.c +0 -61
- jaclang/vendor/mypyc/lower/__init__.py +0 -0
- jaclang/vendor/mypyc/lower/int_ops.py +0 -113
- jaclang/vendor/mypyc/lower/list_ops.py +0 -45
- jaclang/vendor/mypyc/lower/misc_ops.py +0 -12
- jaclang/vendor/mypyc/lower/registry.py +0 -26
- jaclang/vendor/mypyc/namegen.py +0 -115
- jaclang/vendor/mypyc/options.py +0 -32
- jaclang/vendor/mypyc/primitives/__init__.py +0 -0
- jaclang/vendor/mypyc/primitives/bytes_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/dict_ops.py +0 -325
- jaclang/vendor/mypyc/primitives/exc_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/float_ops.py +0 -168
- jaclang/vendor/mypyc/primitives/generic_ops.py +0 -384
- jaclang/vendor/mypyc/primitives/int_ops.py +0 -303
- jaclang/vendor/mypyc/primitives/list_ops.py +0 -310
- jaclang/vendor/mypyc/primitives/misc_ops.py +0 -267
- jaclang/vendor/mypyc/primitives/registry.py +0 -360
- jaclang/vendor/mypyc/primitives/set_ops.py +0 -121
- jaclang/vendor/mypyc/primitives/str_ops.py +0 -229
- jaclang/vendor/mypyc/primitives/tuple_ops.py +0 -83
- jaclang/vendor/mypyc/rt_subtype.py +0 -77
- jaclang/vendor/mypyc/sametype.py +0 -83
- jaclang/vendor/mypyc/subtype.py +0 -88
- jaclang/vendor/mypyc/test/__init__.py +0 -0
- jaclang/vendor/mypyc/test/config.py +0 -13
- jaclang/vendor/mypyc/test/test_alwaysdefined.py +0 -46
- jaclang/vendor/mypyc/test/test_analysis.py +0 -77
- jaclang/vendor/mypyc/test/test_cheader.py +0 -53
- jaclang/vendor/mypyc/test/test_commandline.py +0 -82
- jaclang/vendor/mypyc/test/test_emit.py +0 -69
- jaclang/vendor/mypyc/test/test_emitclass.py +0 -35
- jaclang/vendor/mypyc/test/test_emitfunc.py +0 -928
- jaclang/vendor/mypyc/test/test_emitwrapper.py +0 -60
- jaclang/vendor/mypyc/test/test_exceptions.py +0 -56
- jaclang/vendor/mypyc/test/test_external.py +0 -49
- jaclang/vendor/mypyc/test/test_irbuild.py +0 -87
- jaclang/vendor/mypyc/test/test_ircheck.py +0 -199
- jaclang/vendor/mypyc/test/test_literals.py +0 -90
- jaclang/vendor/mypyc/test/test_lowering.py +0 -56
- jaclang/vendor/mypyc/test/test_namegen.py +0 -48
- jaclang/vendor/mypyc/test/test_optimizations.py +0 -68
- jaclang/vendor/mypyc/test/test_pprint.py +0 -42
- jaclang/vendor/mypyc/test/test_rarray.py +0 -48
- jaclang/vendor/mypyc/test/test_refcount.py +0 -59
- jaclang/vendor/mypyc/test/test_run.py +0 -426
- jaclang/vendor/mypyc/test/test_serialization.py +0 -108
- jaclang/vendor/mypyc/test/test_struct.py +0 -112
- jaclang/vendor/mypyc/test/test_tuplename.py +0 -33
- jaclang/vendor/mypyc/test/test_typeops.py +0 -97
- jaclang/vendor/mypyc/test/testutil.py +0 -283
- jaclang/vendor/mypyc/test-data/alwaysdefined.test +0 -732
- jaclang/vendor/mypyc/test-data/analysis.test +0 -470
- jaclang/vendor/mypyc/test-data/commandline.test +0 -245
- jaclang/vendor/mypyc/test-data/driver/driver.py +0 -48
- jaclang/vendor/mypyc/test-data/exceptions-freq.test +0 -125
- jaclang/vendor/mypyc/test-data/exceptions.test +0 -699
- jaclang/vendor/mypyc/test-data/fixtures/ir.py +0 -373
- jaclang/vendor/mypyc/test-data/fixtures/testutil.py +0 -103
- jaclang/vendor/mypyc/test-data/fixtures/typing-full.pyi +0 -169
- jaclang/vendor/mypyc/test-data/irbuild-any.test +0 -236
- jaclang/vendor/mypyc/test-data/irbuild-basic.test +0 -3399
- jaclang/vendor/mypyc/test-data/irbuild-bool.test +0 -424
- jaclang/vendor/mypyc/test-data/irbuild-bytes.test +0 -181
- jaclang/vendor/mypyc/test-data/irbuild-classes.test +0 -1302
- jaclang/vendor/mypyc/test-data/irbuild-constant-fold.test +0 -480
- jaclang/vendor/mypyc/test-data/irbuild-dict.test +0 -584
- jaclang/vendor/mypyc/test-data/irbuild-dunders.test +0 -215
- jaclang/vendor/mypyc/test-data/irbuild-float.test +0 -497
- jaclang/vendor/mypyc/test-data/irbuild-generics.test +0 -150
- jaclang/vendor/mypyc/test-data/irbuild-glue-methods.test +0 -437
- jaclang/vendor/mypyc/test-data/irbuild-i16.test +0 -526
- jaclang/vendor/mypyc/test-data/irbuild-i32.test +0 -598
- jaclang/vendor/mypyc/test-data/irbuild-i64.test +0 -2144
- jaclang/vendor/mypyc/test-data/irbuild-int.test +0 -194
- jaclang/vendor/mypyc/test-data/irbuild-isinstance.test +0 -109
- jaclang/vendor/mypyc/test-data/irbuild-lists.test +0 -513
- jaclang/vendor/mypyc/test-data/irbuild-match.test +0 -1717
- jaclang/vendor/mypyc/test-data/irbuild-math.test +0 -64
- jaclang/vendor/mypyc/test-data/irbuild-nested.test +0 -807
- jaclang/vendor/mypyc/test-data/irbuild-optional.test +0 -536
- jaclang/vendor/mypyc/test-data/irbuild-set.test +0 -806
- jaclang/vendor/mypyc/test-data/irbuild-singledispatch.test +0 -257
- jaclang/vendor/mypyc/test-data/irbuild-statements.test +0 -1060
- jaclang/vendor/mypyc/test-data/irbuild-str.test +0 -312
- jaclang/vendor/mypyc/test-data/irbuild-strip-asserts.test +0 -12
- jaclang/vendor/mypyc/test-data/irbuild-try.test +0 -523
- jaclang/vendor/mypyc/test-data/irbuild-tuple.test +0 -386
- jaclang/vendor/mypyc/test-data/irbuild-u8.test +0 -543
- jaclang/vendor/mypyc/test-data/irbuild-unreachable.test +0 -241
- jaclang/vendor/mypyc/test-data/irbuild-vectorcall.test +0 -153
- jaclang/vendor/mypyc/test-data/lowering-int.test +0 -377
- jaclang/vendor/mypyc/test-data/lowering-list.test +0 -33
- jaclang/vendor/mypyc/test-data/opt-copy-propagation.test +0 -400
- jaclang/vendor/mypyc/test-data/opt-flag-elimination.test +0 -296
- jaclang/vendor/mypyc/test-data/refcount.test +0 -1482
- jaclang/vendor/mypyc/test-data/run-async.test +0 -173
- jaclang/vendor/mypyc/test-data/run-attrs.test +0 -318
- jaclang/vendor/mypyc/test-data/run-bench.test +0 -196
- jaclang/vendor/mypyc/test-data/run-bools.test +0 -229
- jaclang/vendor/mypyc/test-data/run-bytes.test +0 -302
- jaclang/vendor/mypyc/test-data/run-classes.test +0 -2505
- jaclang/vendor/mypyc/test-data/run-dicts.test +0 -334
- jaclang/vendor/mypyc/test-data/run-dunders.test +0 -945
- jaclang/vendor/mypyc/test-data/run-exceptions.test +0 -448
- jaclang/vendor/mypyc/test-data/run-floats.test +0 -516
- jaclang/vendor/mypyc/test-data/run-functions.test +0 -1310
- jaclang/vendor/mypyc/test-data/run-generators.test +0 -682
- jaclang/vendor/mypyc/test-data/run-i16.test +0 -338
- jaclang/vendor/mypyc/test-data/run-i32.test +0 -336
- jaclang/vendor/mypyc/test-data/run-i64.test +0 -1519
- jaclang/vendor/mypyc/test-data/run-imports.test +0 -265
- jaclang/vendor/mypyc/test-data/run-integers.test +0 -540
- jaclang/vendor/mypyc/test-data/run-lists.test +0 -411
- jaclang/vendor/mypyc/test-data/run-loops.test +0 -485
- jaclang/vendor/mypyc/test-data/run-match.test +0 -283
- jaclang/vendor/mypyc/test-data/run-math.test +0 -106
- jaclang/vendor/mypyc/test-data/run-misc.test +0 -1170
- jaclang/vendor/mypyc/test-data/run-multimodule.test +0 -887
- jaclang/vendor/mypyc/test-data/run-mypy-sim.test +0 -138
- jaclang/vendor/mypyc/test-data/run-primitives.test +0 -375
- jaclang/vendor/mypyc/test-data/run-python37.test +0 -159
- jaclang/vendor/mypyc/test-data/run-python38.test +0 -88
- jaclang/vendor/mypyc/test-data/run-sets.test +0 -150
- jaclang/vendor/mypyc/test-data/run-singledispatch.test +0 -698
- jaclang/vendor/mypyc/test-data/run-strings.test +0 -641
- jaclang/vendor/mypyc/test-data/run-traits.test +0 -411
- jaclang/vendor/mypyc/test-data/run-tuples.test +0 -258
- jaclang/vendor/mypyc/test-data/run-u8.test +0 -303
- jaclang/vendor/mypyc/transform/__init__.py +0 -0
- jaclang/vendor/mypyc/transform/copy_propagation.py +0 -94
- jaclang/vendor/mypyc/transform/exceptions.py +0 -182
- jaclang/vendor/mypyc/transform/flag_elimination.py +0 -108
- jaclang/vendor/mypyc/transform/ir_transform.py +0 -368
- jaclang/vendor/mypyc/transform/lower.py +0 -33
- jaclang/vendor/mypyc/transform/refcount.py +0 -294
- jaclang/vendor/mypyc/transform/uninit.py +0 -190
- jaclang/vendor/typing_extensions-4.12.2.dist-info/LICENSE +0 -279
- jaclang/vendor/typing_extensions-4.12.2.dist-info/METADATA +0 -67
- jaclang/vendor/typing_extensions-4.12.2.dist-info/RECORD +0 -5
- jaclang/vendor/typing_extensions-4.12.2.dist-info/WHEEL +0 -4
- jaclang/vendor/typing_extensions.py +0 -3641
- jaclang-0.7.34.dist-info/RECORD +0 -1563
- /jaclang/{vendor/mypy/dmypy → compiler/larkparse}/__init__.py +0 -0
- /jaclang/{tests → compiler/passes/main/tests}/fixtures/access_checker.jac +0 -0
- /jaclang/{vendor/mypy/plugins/__init__.py → langserve/tests/fixtures/deep_check_crash.jac} +0 -0
- /jaclang/{vendor/mypy/server/__init__.py → langserve/tests/server_test/code_test.py} +0 -0
- /jaclang/{plugin → runtimelib}/tests/__init__.py +0 -0
- /jaclang/{plugin → runtimelib}/tests/fixtures/traversing_save.jac +0 -0
- /jaclang/{vendor/mypy/test → tests}/__init__.py +0 -0
- /jaclang/{vendor/mypy/test/meta → tests/fixtures}/__init__.py +0 -0
- /jaclang/tests/fixtures/{architype_def_bug.jac → archetype_def_bug.jac} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/concurrent/__init__.pyi → attrs-25.3.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/__init__.pyi → cattrs-24.1.3.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi → lark-1.2.2.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/entry_points.txt +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/top_level.txt +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/email/mime/__init__.pyi → lsprotocol-2023.0.1.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/lsprotocol-2023.0.1.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/__init__.pyi → pluggy-1.5.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/pluggy-1.5.0.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi → pygls-1.3.1.dist-info/REQUESTED} +0 -0
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/entry_points.txt +0 -0
jaclang/vendor/mypy/fastparse.py
DELETED
|
@@ -1,2147 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import copy
|
|
4
|
-
import re
|
|
5
|
-
import sys
|
|
6
|
-
import warnings
|
|
7
|
-
from typing import Any, Callable, Final, List, Optional, Sequence, TypeVar, Union, cast
|
|
8
|
-
from typing_extensions import Literal, overload
|
|
9
|
-
|
|
10
|
-
from mypy import defaults, errorcodes as codes, message_registry
|
|
11
|
-
from mypy.errors import Errors
|
|
12
|
-
from mypy.message_registry import ErrorMessage
|
|
13
|
-
from mypy.nodes import (
|
|
14
|
-
ARG_NAMED,
|
|
15
|
-
ARG_NAMED_OPT,
|
|
16
|
-
ARG_OPT,
|
|
17
|
-
ARG_POS,
|
|
18
|
-
ARG_STAR,
|
|
19
|
-
ARG_STAR2,
|
|
20
|
-
ArgKind,
|
|
21
|
-
Argument,
|
|
22
|
-
AssertStmt,
|
|
23
|
-
AssignmentExpr,
|
|
24
|
-
AssignmentStmt,
|
|
25
|
-
AwaitExpr,
|
|
26
|
-
Block,
|
|
27
|
-
BreakStmt,
|
|
28
|
-
BytesExpr,
|
|
29
|
-
CallExpr,
|
|
30
|
-
ClassDef,
|
|
31
|
-
ComparisonExpr,
|
|
32
|
-
ComplexExpr,
|
|
33
|
-
ConditionalExpr,
|
|
34
|
-
ContinueStmt,
|
|
35
|
-
Decorator,
|
|
36
|
-
DelStmt,
|
|
37
|
-
DictExpr,
|
|
38
|
-
DictionaryComprehension,
|
|
39
|
-
EllipsisExpr,
|
|
40
|
-
Expression,
|
|
41
|
-
ExpressionStmt,
|
|
42
|
-
FakeInfo,
|
|
43
|
-
FloatExpr,
|
|
44
|
-
ForStmt,
|
|
45
|
-
FuncDef,
|
|
46
|
-
GeneratorExpr,
|
|
47
|
-
GlobalDecl,
|
|
48
|
-
IfStmt,
|
|
49
|
-
Import,
|
|
50
|
-
ImportAll,
|
|
51
|
-
ImportBase,
|
|
52
|
-
ImportFrom,
|
|
53
|
-
IndexExpr,
|
|
54
|
-
IntExpr,
|
|
55
|
-
LambdaExpr,
|
|
56
|
-
ListComprehension,
|
|
57
|
-
ListExpr,
|
|
58
|
-
MatchStmt,
|
|
59
|
-
MemberExpr,
|
|
60
|
-
MypyFile,
|
|
61
|
-
NameExpr,
|
|
62
|
-
Node,
|
|
63
|
-
NonlocalDecl,
|
|
64
|
-
OperatorAssignmentStmt,
|
|
65
|
-
OpExpr,
|
|
66
|
-
OverloadedFuncDef,
|
|
67
|
-
OverloadPart,
|
|
68
|
-
PassStmt,
|
|
69
|
-
RaiseStmt,
|
|
70
|
-
RefExpr,
|
|
71
|
-
ReturnStmt,
|
|
72
|
-
SetComprehension,
|
|
73
|
-
SetExpr,
|
|
74
|
-
SliceExpr,
|
|
75
|
-
StarExpr,
|
|
76
|
-
Statement,
|
|
77
|
-
StrExpr,
|
|
78
|
-
SuperExpr,
|
|
79
|
-
TempNode,
|
|
80
|
-
TryStmt,
|
|
81
|
-
TupleExpr,
|
|
82
|
-
UnaryExpr,
|
|
83
|
-
Var,
|
|
84
|
-
WhileStmt,
|
|
85
|
-
WithStmt,
|
|
86
|
-
YieldExpr,
|
|
87
|
-
YieldFromExpr,
|
|
88
|
-
check_arg_names,
|
|
89
|
-
)
|
|
90
|
-
from mypy.options import Options
|
|
91
|
-
from mypy.patterns import (
|
|
92
|
-
AsPattern,
|
|
93
|
-
ClassPattern,
|
|
94
|
-
MappingPattern,
|
|
95
|
-
OrPattern,
|
|
96
|
-
SequencePattern,
|
|
97
|
-
SingletonPattern,
|
|
98
|
-
StarredPattern,
|
|
99
|
-
ValuePattern,
|
|
100
|
-
)
|
|
101
|
-
from mypy.reachability import infer_reachability_of_if_statement, mark_block_unreachable
|
|
102
|
-
from mypy.sharedparse import argument_elide_name, special_function_elide_names
|
|
103
|
-
from mypy.traverser import TraverserVisitor
|
|
104
|
-
from mypy.types import (
|
|
105
|
-
AnyType,
|
|
106
|
-
CallableArgument,
|
|
107
|
-
CallableType,
|
|
108
|
-
EllipsisType,
|
|
109
|
-
Instance,
|
|
110
|
-
ProperType,
|
|
111
|
-
RawExpressionType,
|
|
112
|
-
TupleType,
|
|
113
|
-
Type,
|
|
114
|
-
TypeList,
|
|
115
|
-
TypeOfAny,
|
|
116
|
-
UnboundType,
|
|
117
|
-
UnionType,
|
|
118
|
-
UnpackType,
|
|
119
|
-
)
|
|
120
|
-
from mypy.util import bytes_to_human_readable_repr, unnamed_function
|
|
121
|
-
|
|
122
|
-
# pull this into a final variable to make mypyc be quiet about the
|
|
123
|
-
# the default argument warning
|
|
124
|
-
PY_MINOR_VERSION: Final = sys.version_info[1]
|
|
125
|
-
|
|
126
|
-
import ast as ast3
|
|
127
|
-
|
|
128
|
-
# TODO: Index, ExtSlice are deprecated in 3.9.
|
|
129
|
-
from ast import AST, Attribute, Call, FunctionType, Index, Name, Starred, UAdd, UnaryOp, USub
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def ast3_parse(
|
|
133
|
-
source: str | bytes, filename: str, mode: str, feature_version: int = PY_MINOR_VERSION
|
|
134
|
-
) -> AST:
|
|
135
|
-
return ast3.parse(
|
|
136
|
-
source,
|
|
137
|
-
filename,
|
|
138
|
-
mode,
|
|
139
|
-
type_comments=True, # This works the magic
|
|
140
|
-
feature_version=feature_version,
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
NamedExpr = ast3.NamedExpr
|
|
145
|
-
Constant = ast3.Constant
|
|
146
|
-
|
|
147
|
-
if sys.version_info >= (3, 12):
|
|
148
|
-
ast_TypeAlias = ast3.TypeAlias
|
|
149
|
-
else:
|
|
150
|
-
ast_TypeAlias = Any
|
|
151
|
-
|
|
152
|
-
if sys.version_info >= (3, 10):
|
|
153
|
-
Match = ast3.Match
|
|
154
|
-
MatchValue = ast3.MatchValue
|
|
155
|
-
MatchSingleton = ast3.MatchSingleton
|
|
156
|
-
MatchSequence = ast3.MatchSequence
|
|
157
|
-
MatchStar = ast3.MatchStar
|
|
158
|
-
MatchMapping = ast3.MatchMapping
|
|
159
|
-
MatchClass = ast3.MatchClass
|
|
160
|
-
MatchAs = ast3.MatchAs
|
|
161
|
-
MatchOr = ast3.MatchOr
|
|
162
|
-
AstNode = Union[ast3.expr, ast3.stmt, ast3.pattern, ast3.ExceptHandler]
|
|
163
|
-
else:
|
|
164
|
-
Match = Any
|
|
165
|
-
MatchValue = Any
|
|
166
|
-
MatchSingleton = Any
|
|
167
|
-
MatchSequence = Any
|
|
168
|
-
MatchStar = Any
|
|
169
|
-
MatchMapping = Any
|
|
170
|
-
MatchClass = Any
|
|
171
|
-
MatchAs = Any
|
|
172
|
-
MatchOr = Any
|
|
173
|
-
AstNode = Union[ast3.expr, ast3.stmt, ast3.ExceptHandler]
|
|
174
|
-
if sys.version_info >= (3, 11):
|
|
175
|
-
TryStar = ast3.TryStar
|
|
176
|
-
else:
|
|
177
|
-
TryStar = Any
|
|
178
|
-
|
|
179
|
-
N = TypeVar("N", bound=Node)
|
|
180
|
-
|
|
181
|
-
# There is no way to create reasonable fallbacks at this stage,
|
|
182
|
-
# they must be patched later.
|
|
183
|
-
MISSING_FALLBACK: Final = FakeInfo("fallback can't be filled out until semanal")
|
|
184
|
-
_dummy_fallback: Final = Instance(MISSING_FALLBACK, [], -1)
|
|
185
|
-
|
|
186
|
-
TYPE_IGNORE_PATTERN: Final = re.compile(r"[^#]*#\s*type:\s*ignore\s*(.*)")
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def parse(
|
|
190
|
-
source: str | bytes,
|
|
191
|
-
fnam: str,
|
|
192
|
-
module: str | None,
|
|
193
|
-
errors: Errors,
|
|
194
|
-
options: Options | None = None,
|
|
195
|
-
) -> MypyFile:
|
|
196
|
-
"""Parse a source file, without doing any semantic analysis.
|
|
197
|
-
|
|
198
|
-
Return the parse tree. If errors is not provided, raise ParseError
|
|
199
|
-
on failure. Otherwise, use the errors object to report parse errors.
|
|
200
|
-
"""
|
|
201
|
-
ignore_errors = (options is not None and options.ignore_errors) or (
|
|
202
|
-
fnam in errors.ignored_files
|
|
203
|
-
)
|
|
204
|
-
# If errors are ignored, we can drop many function bodies to speed up type checking.
|
|
205
|
-
strip_function_bodies = ignore_errors and (options is None or not options.preserve_asts)
|
|
206
|
-
|
|
207
|
-
if options is None:
|
|
208
|
-
options = Options()
|
|
209
|
-
errors.set_file(fnam, module, options=options)
|
|
210
|
-
is_stub_file = fnam.endswith(".pyi")
|
|
211
|
-
if is_stub_file:
|
|
212
|
-
feature_version = defaults.PYTHON3_VERSION[1]
|
|
213
|
-
if options.python_version[0] == 3 and options.python_version[1] > feature_version:
|
|
214
|
-
feature_version = options.python_version[1]
|
|
215
|
-
else:
|
|
216
|
-
assert options.python_version[0] >= 3
|
|
217
|
-
feature_version = options.python_version[1]
|
|
218
|
-
try:
|
|
219
|
-
# Disable deprecation warnings about \u
|
|
220
|
-
with warnings.catch_warnings():
|
|
221
|
-
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
222
|
-
ast = ast3_parse(source, fnam, "exec", feature_version=feature_version)
|
|
223
|
-
|
|
224
|
-
tree = ASTConverter(
|
|
225
|
-
options=options,
|
|
226
|
-
is_stub=is_stub_file,
|
|
227
|
-
errors=errors,
|
|
228
|
-
strip_function_bodies=strip_function_bodies,
|
|
229
|
-
path=fnam,
|
|
230
|
-
).visit(ast)
|
|
231
|
-
except SyntaxError as e:
|
|
232
|
-
# alias to please mypyc
|
|
233
|
-
is_py38_or_earlier = sys.version_info < (3, 9)
|
|
234
|
-
if is_py38_or_earlier and e.filename == "<fstring>":
|
|
235
|
-
# In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the
|
|
236
|
-
# start of the f-string. This would be misleading, as mypy will report the error as the
|
|
237
|
-
# lineno within the file.
|
|
238
|
-
e.lineno = None
|
|
239
|
-
message = e.msg
|
|
240
|
-
if feature_version > sys.version_info.minor and message.startswith("invalid syntax"):
|
|
241
|
-
python_version_str = f"{options.python_version[0]}.{options.python_version[1]}"
|
|
242
|
-
message += f"; you likely need to run mypy using Python {python_version_str} or newer"
|
|
243
|
-
errors.report(
|
|
244
|
-
e.lineno if e.lineno is not None else -1,
|
|
245
|
-
e.offset,
|
|
246
|
-
message,
|
|
247
|
-
blocker=True,
|
|
248
|
-
code=codes.SYNTAX,
|
|
249
|
-
)
|
|
250
|
-
tree = MypyFile([], [], False, {})
|
|
251
|
-
|
|
252
|
-
assert isinstance(tree, MypyFile)
|
|
253
|
-
return tree
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
def parse_type_ignore_tag(tag: str | None) -> list[str] | None:
|
|
257
|
-
"""Parse optional "[code, ...]" tag after "# type: ignore".
|
|
258
|
-
|
|
259
|
-
Return:
|
|
260
|
-
* [] if no tag was found (ignore all errors)
|
|
261
|
-
* list of ignored error codes if a tag was found
|
|
262
|
-
* None if the tag was invalid.
|
|
263
|
-
"""
|
|
264
|
-
if not tag or tag.strip() == "" or tag.strip().startswith("#"):
|
|
265
|
-
# No tag -- ignore all errors.
|
|
266
|
-
return []
|
|
267
|
-
m = re.match(r"\s*\[([^]#]*)\]\s*(#.*)?$", tag)
|
|
268
|
-
if m is None:
|
|
269
|
-
# Invalid "# type: ignore" comment.
|
|
270
|
-
return None
|
|
271
|
-
return [code.strip() for code in m.group(1).split(",")]
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
def parse_type_comment(
|
|
275
|
-
type_comment: str, line: int, column: int, errors: Errors | None
|
|
276
|
-
) -> tuple[list[str] | None, ProperType | None]:
|
|
277
|
-
"""Parse type portion of a type comment (+ optional type ignore).
|
|
278
|
-
|
|
279
|
-
Return (ignore info, parsed type).
|
|
280
|
-
"""
|
|
281
|
-
try:
|
|
282
|
-
typ = ast3_parse(type_comment, "<type_comment>", "eval")
|
|
283
|
-
except SyntaxError:
|
|
284
|
-
if errors is not None:
|
|
285
|
-
stripped_type = type_comment.split("#", 2)[0].strip()
|
|
286
|
-
err_msg = message_registry.TYPE_COMMENT_SYNTAX_ERROR_VALUE.format(stripped_type)
|
|
287
|
-
errors.report(line, column, err_msg.value, blocker=True, code=err_msg.code)
|
|
288
|
-
return None, None
|
|
289
|
-
else:
|
|
290
|
-
raise
|
|
291
|
-
else:
|
|
292
|
-
extra_ignore = TYPE_IGNORE_PATTERN.match(type_comment)
|
|
293
|
-
if extra_ignore:
|
|
294
|
-
tag: str | None = extra_ignore.group(1)
|
|
295
|
-
ignored: list[str] | None = parse_type_ignore_tag(tag)
|
|
296
|
-
if ignored is None:
|
|
297
|
-
if errors is not None:
|
|
298
|
-
errors.report(
|
|
299
|
-
line, column, message_registry.INVALID_TYPE_IGNORE.value, code=codes.SYNTAX
|
|
300
|
-
)
|
|
301
|
-
else:
|
|
302
|
-
raise SyntaxError
|
|
303
|
-
else:
|
|
304
|
-
ignored = None
|
|
305
|
-
assert isinstance(typ, ast3.Expression)
|
|
306
|
-
converted = TypeConverter(
|
|
307
|
-
errors, line=line, override_column=column, is_evaluated=False
|
|
308
|
-
).visit(typ.body)
|
|
309
|
-
return ignored, converted
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
def parse_type_string(
|
|
313
|
-
expr_string: str, expr_fallback_name: str, line: int, column: int
|
|
314
|
-
) -> ProperType:
|
|
315
|
-
"""Parses a type that was originally present inside of an explicit string.
|
|
316
|
-
|
|
317
|
-
For example, suppose we have the type `Foo["blah"]`. We should parse the
|
|
318
|
-
string expression "blah" using this function.
|
|
319
|
-
"""
|
|
320
|
-
try:
|
|
321
|
-
_, node = parse_type_comment(f"({expr_string})", line=line, column=column, errors=None)
|
|
322
|
-
if isinstance(node, UnboundType) and node.original_str_expr is None:
|
|
323
|
-
node.original_str_expr = expr_string
|
|
324
|
-
node.original_str_fallback = expr_fallback_name
|
|
325
|
-
return node
|
|
326
|
-
elif isinstance(node, UnionType):
|
|
327
|
-
return node
|
|
328
|
-
else:
|
|
329
|
-
return RawExpressionType(expr_string, expr_fallback_name, line, column)
|
|
330
|
-
except (SyntaxError, ValueError):
|
|
331
|
-
# Note: the parser will raise a `ValueError` instead of a SyntaxError if
|
|
332
|
-
# the string happens to contain things like \x00.
|
|
333
|
-
return RawExpressionType(expr_string, expr_fallback_name, line, column)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
def is_no_type_check_decorator(expr: ast3.expr) -> bool:
|
|
337
|
-
if isinstance(expr, Name):
|
|
338
|
-
return expr.id == "no_type_check"
|
|
339
|
-
elif isinstance(expr, Attribute):
|
|
340
|
-
if isinstance(expr.value, Name):
|
|
341
|
-
return expr.value.id == "typing" and expr.attr == "no_type_check"
|
|
342
|
-
return False
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
class ASTConverter:
|
|
346
|
-
def __init__(
|
|
347
|
-
self,
|
|
348
|
-
options: Options,
|
|
349
|
-
is_stub: bool,
|
|
350
|
-
errors: Errors,
|
|
351
|
-
*,
|
|
352
|
-
strip_function_bodies: bool,
|
|
353
|
-
path: str,
|
|
354
|
-
) -> None:
|
|
355
|
-
# 'C' for class, 'D' for function signature, 'F' for function, 'L' for lambda
|
|
356
|
-
self.class_and_function_stack: list[Literal["C", "D", "F", "L"]] = []
|
|
357
|
-
self.imports: list[ImportBase] = []
|
|
358
|
-
|
|
359
|
-
self.options = options
|
|
360
|
-
self.is_stub = is_stub
|
|
361
|
-
self.errors = errors
|
|
362
|
-
self.strip_function_bodies = strip_function_bodies
|
|
363
|
-
self.path = path
|
|
364
|
-
|
|
365
|
-
self.type_ignores: dict[int, list[str]] = {}
|
|
366
|
-
|
|
367
|
-
# Cache of visit_X methods keyed by type of visited object
|
|
368
|
-
self.visitor_cache: dict[type, Callable[[AST | None], Any]] = {}
|
|
369
|
-
|
|
370
|
-
def note(self, msg: str, line: int, column: int) -> None:
|
|
371
|
-
self.errors.report(line, column, msg, severity="note", code=codes.SYNTAX)
|
|
372
|
-
|
|
373
|
-
def fail(self, msg: ErrorMessage, line: int, column: int, blocker: bool = True) -> None:
|
|
374
|
-
if blocker or not self.options.ignore_errors:
|
|
375
|
-
# Make sure self.errors reflects any type ignores that we have parsed
|
|
376
|
-
self.errors.set_file_ignored_lines(
|
|
377
|
-
self.path, self.type_ignores, self.options.ignore_errors
|
|
378
|
-
)
|
|
379
|
-
self.errors.report(line, column, msg.value, blocker=blocker, code=msg.code)
|
|
380
|
-
|
|
381
|
-
def fail_merge_overload(self, node: IfStmt) -> None:
|
|
382
|
-
self.fail(
|
|
383
|
-
message_registry.FAILED_TO_MERGE_OVERLOADS,
|
|
384
|
-
line=node.line,
|
|
385
|
-
column=node.column,
|
|
386
|
-
blocker=False,
|
|
387
|
-
)
|
|
388
|
-
|
|
389
|
-
def visit(self, node: AST | None) -> Any:
|
|
390
|
-
if node is None:
|
|
391
|
-
return None
|
|
392
|
-
typeobj = type(node)
|
|
393
|
-
visitor = self.visitor_cache.get(typeobj)
|
|
394
|
-
if visitor is None:
|
|
395
|
-
method = "visit_" + node.__class__.__name__
|
|
396
|
-
visitor = getattr(self, method)
|
|
397
|
-
self.visitor_cache[typeobj] = visitor
|
|
398
|
-
return visitor(node)
|
|
399
|
-
|
|
400
|
-
def set_line(self, node: N, n: AstNode) -> N:
|
|
401
|
-
node.line = n.lineno
|
|
402
|
-
node.column = n.col_offset
|
|
403
|
-
node.end_line = getattr(n, "end_lineno", None)
|
|
404
|
-
node.end_column = getattr(n, "end_col_offset", None)
|
|
405
|
-
|
|
406
|
-
return node
|
|
407
|
-
|
|
408
|
-
def translate_opt_expr_list(self, l: Sequence[AST | None]) -> list[Expression | None]:
|
|
409
|
-
res: list[Expression | None] = []
|
|
410
|
-
for e in l:
|
|
411
|
-
exp = self.visit(e)
|
|
412
|
-
res.append(exp)
|
|
413
|
-
return res
|
|
414
|
-
|
|
415
|
-
def translate_expr_list(self, l: Sequence[AST]) -> list[Expression]:
|
|
416
|
-
return cast(List[Expression], self.translate_opt_expr_list(l))
|
|
417
|
-
|
|
418
|
-
def get_lineno(self, node: ast3.expr | ast3.stmt) -> int:
|
|
419
|
-
if (
|
|
420
|
-
isinstance(node, (ast3.AsyncFunctionDef, ast3.ClassDef, ast3.FunctionDef))
|
|
421
|
-
and node.decorator_list
|
|
422
|
-
):
|
|
423
|
-
return node.decorator_list[0].lineno
|
|
424
|
-
return node.lineno
|
|
425
|
-
|
|
426
|
-
def translate_stmt_list(
|
|
427
|
-
self,
|
|
428
|
-
stmts: Sequence[ast3.stmt],
|
|
429
|
-
*,
|
|
430
|
-
ismodule: bool = False,
|
|
431
|
-
can_strip: bool = False,
|
|
432
|
-
is_coroutine: bool = False,
|
|
433
|
-
) -> list[Statement]:
|
|
434
|
-
# A "# type: ignore" comment before the first statement of a module
|
|
435
|
-
# ignores the whole module:
|
|
436
|
-
if (
|
|
437
|
-
ismodule
|
|
438
|
-
and stmts
|
|
439
|
-
and self.type_ignores
|
|
440
|
-
and min(self.type_ignores) < self.get_lineno(stmts[0])
|
|
441
|
-
):
|
|
442
|
-
ignores = self.type_ignores[min(self.type_ignores)]
|
|
443
|
-
if ignores:
|
|
444
|
-
joined_ignores = ", ".join(ignores)
|
|
445
|
-
self.fail(
|
|
446
|
-
message_registry.TYPE_IGNORE_WITH_ERRCODE_ON_MODULE.format(joined_ignores),
|
|
447
|
-
line=min(self.type_ignores),
|
|
448
|
-
column=0,
|
|
449
|
-
blocker=False,
|
|
450
|
-
)
|
|
451
|
-
self.errors.used_ignored_lines[self.errors.file][min(self.type_ignores)].append(
|
|
452
|
-
codes.FILE.code
|
|
453
|
-
)
|
|
454
|
-
block = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))
|
|
455
|
-
self.set_block_lines(block, stmts)
|
|
456
|
-
mark_block_unreachable(block)
|
|
457
|
-
return [block]
|
|
458
|
-
|
|
459
|
-
stack = self.class_and_function_stack
|
|
460
|
-
# Fast case for stripping function bodies
|
|
461
|
-
if (
|
|
462
|
-
can_strip
|
|
463
|
-
and self.strip_function_bodies
|
|
464
|
-
and len(stack) == 1
|
|
465
|
-
and stack[0] == "F"
|
|
466
|
-
and not is_coroutine
|
|
467
|
-
):
|
|
468
|
-
return []
|
|
469
|
-
|
|
470
|
-
res: list[Statement] = []
|
|
471
|
-
for stmt in stmts:
|
|
472
|
-
node = self.visit(stmt)
|
|
473
|
-
res.append(node)
|
|
474
|
-
|
|
475
|
-
# Slow case for stripping function bodies
|
|
476
|
-
if can_strip and self.strip_function_bodies:
|
|
477
|
-
if stack[-2:] == ["C", "F"]:
|
|
478
|
-
if is_possible_trivial_body(res):
|
|
479
|
-
can_strip = False
|
|
480
|
-
else:
|
|
481
|
-
# We only strip method bodies if they don't assign to an attribute, as
|
|
482
|
-
# this may define an attribute which has an externally visible effect.
|
|
483
|
-
visitor = FindAttributeAssign()
|
|
484
|
-
for s in res:
|
|
485
|
-
s.accept(visitor)
|
|
486
|
-
if visitor.found:
|
|
487
|
-
can_strip = False
|
|
488
|
-
break
|
|
489
|
-
|
|
490
|
-
if can_strip and stack[-1] == "F" and is_coroutine:
|
|
491
|
-
# Yields inside an async function affect the return type and should not
|
|
492
|
-
# be stripped.
|
|
493
|
-
yield_visitor = FindYield()
|
|
494
|
-
for s in res:
|
|
495
|
-
s.accept(yield_visitor)
|
|
496
|
-
if yield_visitor.found:
|
|
497
|
-
can_strip = False
|
|
498
|
-
break
|
|
499
|
-
|
|
500
|
-
if can_strip:
|
|
501
|
-
return []
|
|
502
|
-
return res
|
|
503
|
-
|
|
504
|
-
def translate_type_comment(
|
|
505
|
-
self, n: ast3.stmt | ast3.arg, type_comment: str | None
|
|
506
|
-
) -> ProperType | None:
|
|
507
|
-
if type_comment is None:
|
|
508
|
-
return None
|
|
509
|
-
else:
|
|
510
|
-
lineno = n.lineno
|
|
511
|
-
extra_ignore, typ = parse_type_comment(type_comment, lineno, n.col_offset, self.errors)
|
|
512
|
-
if extra_ignore is not None:
|
|
513
|
-
self.type_ignores[lineno] = extra_ignore
|
|
514
|
-
return typ
|
|
515
|
-
|
|
516
|
-
op_map: Final[dict[type[AST], str]] = {
|
|
517
|
-
ast3.Add: "+",
|
|
518
|
-
ast3.Sub: "-",
|
|
519
|
-
ast3.Mult: "*",
|
|
520
|
-
ast3.MatMult: "@",
|
|
521
|
-
ast3.Div: "/",
|
|
522
|
-
ast3.Mod: "%",
|
|
523
|
-
ast3.Pow: "**",
|
|
524
|
-
ast3.LShift: "<<",
|
|
525
|
-
ast3.RShift: ">>",
|
|
526
|
-
ast3.BitOr: "|",
|
|
527
|
-
ast3.BitXor: "^",
|
|
528
|
-
ast3.BitAnd: "&",
|
|
529
|
-
ast3.FloorDiv: "//",
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
def from_operator(self, op: ast3.operator) -> str:
|
|
533
|
-
op_name = ASTConverter.op_map.get(type(op))
|
|
534
|
-
if op_name is None:
|
|
535
|
-
raise RuntimeError("Unknown operator " + str(type(op)))
|
|
536
|
-
else:
|
|
537
|
-
return op_name
|
|
538
|
-
|
|
539
|
-
comp_op_map: Final[dict[type[AST], str]] = {
|
|
540
|
-
ast3.Gt: ">",
|
|
541
|
-
ast3.Lt: "<",
|
|
542
|
-
ast3.Eq: "==",
|
|
543
|
-
ast3.GtE: ">=",
|
|
544
|
-
ast3.LtE: "<=",
|
|
545
|
-
ast3.NotEq: "!=",
|
|
546
|
-
ast3.Is: "is",
|
|
547
|
-
ast3.IsNot: "is not",
|
|
548
|
-
ast3.In: "in",
|
|
549
|
-
ast3.NotIn: "not in",
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
def from_comp_operator(self, op: ast3.cmpop) -> str:
|
|
553
|
-
op_name = ASTConverter.comp_op_map.get(type(op))
|
|
554
|
-
if op_name is None:
|
|
555
|
-
raise RuntimeError("Unknown comparison operator " + str(type(op)))
|
|
556
|
-
else:
|
|
557
|
-
return op_name
|
|
558
|
-
|
|
559
|
-
def set_block_lines(self, b: Block, stmts: Sequence[ast3.stmt]) -> None:
|
|
560
|
-
first, last = stmts[0], stmts[-1]
|
|
561
|
-
b.line = first.lineno
|
|
562
|
-
b.column = first.col_offset
|
|
563
|
-
b.end_line = getattr(last, "end_lineno", None)
|
|
564
|
-
b.end_column = getattr(last, "end_col_offset", None)
|
|
565
|
-
if not b.body:
|
|
566
|
-
return
|
|
567
|
-
new_first = b.body[0]
|
|
568
|
-
if isinstance(new_first, (Decorator, OverloadedFuncDef)):
|
|
569
|
-
# Decorated function lines are different between Python versions.
|
|
570
|
-
# copy the normalization we do for them to block first lines.
|
|
571
|
-
b.line = new_first.line
|
|
572
|
-
b.column = new_first.column
|
|
573
|
-
|
|
574
|
-
def as_block(self, stmts: list[ast3.stmt]) -> Block | None:
|
|
575
|
-
b = None
|
|
576
|
-
if stmts:
|
|
577
|
-
b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))
|
|
578
|
-
self.set_block_lines(b, stmts)
|
|
579
|
-
return b
|
|
580
|
-
|
|
581
|
-
def as_required_block(
|
|
582
|
-
self, stmts: list[ast3.stmt], *, can_strip: bool = False, is_coroutine: bool = False
|
|
583
|
-
) -> Block:
|
|
584
|
-
assert stmts # must be non-empty
|
|
585
|
-
b = Block(
|
|
586
|
-
self.fix_function_overloads(
|
|
587
|
-
self.translate_stmt_list(stmts, can_strip=can_strip, is_coroutine=is_coroutine)
|
|
588
|
-
)
|
|
589
|
-
)
|
|
590
|
-
self.set_block_lines(b, stmts)
|
|
591
|
-
return b
|
|
592
|
-
|
|
593
|
-
def fix_function_overloads(self, stmts: list[Statement]) -> list[Statement]:
|
|
594
|
-
ret: list[Statement] = []
|
|
595
|
-
current_overload: list[OverloadPart] = []
|
|
596
|
-
current_overload_name: str | None = None
|
|
597
|
-
seen_unconditional_func_def = False
|
|
598
|
-
last_if_stmt: IfStmt | None = None
|
|
599
|
-
last_if_overload: Decorator | FuncDef | OverloadedFuncDef | None = None
|
|
600
|
-
last_if_stmt_overload_name: str | None = None
|
|
601
|
-
last_if_unknown_truth_value: IfStmt | None = None
|
|
602
|
-
skipped_if_stmts: list[IfStmt] = []
|
|
603
|
-
for stmt in stmts:
|
|
604
|
-
if_overload_name: str | None = None
|
|
605
|
-
if_block_with_overload: Block | None = None
|
|
606
|
-
if_unknown_truth_value: IfStmt | None = None
|
|
607
|
-
if isinstance(stmt, IfStmt) and seen_unconditional_func_def is False:
|
|
608
|
-
# Check IfStmt block to determine if function overloads can be merged
|
|
609
|
-
if_overload_name = self._check_ifstmt_for_overloads(stmt, current_overload_name)
|
|
610
|
-
if if_overload_name is not None:
|
|
611
|
-
(if_block_with_overload, if_unknown_truth_value) = (
|
|
612
|
-
self._get_executable_if_block_with_overloads(stmt)
|
|
613
|
-
)
|
|
614
|
-
|
|
615
|
-
if (
|
|
616
|
-
current_overload_name is not None
|
|
617
|
-
and isinstance(stmt, (Decorator, FuncDef))
|
|
618
|
-
and stmt.name == current_overload_name
|
|
619
|
-
):
|
|
620
|
-
if last_if_stmt is not None:
|
|
621
|
-
skipped_if_stmts.append(last_if_stmt)
|
|
622
|
-
if last_if_overload is not None:
|
|
623
|
-
# Last stmt was an IfStmt with same overload name
|
|
624
|
-
# Add overloads to current_overload
|
|
625
|
-
if isinstance(last_if_overload, OverloadedFuncDef):
|
|
626
|
-
current_overload.extend(last_if_overload.items)
|
|
627
|
-
else:
|
|
628
|
-
current_overload.append(last_if_overload)
|
|
629
|
-
last_if_stmt, last_if_overload = None, None
|
|
630
|
-
if last_if_unknown_truth_value:
|
|
631
|
-
self.fail_merge_overload(last_if_unknown_truth_value)
|
|
632
|
-
last_if_unknown_truth_value = None
|
|
633
|
-
current_overload.append(stmt)
|
|
634
|
-
if isinstance(stmt, FuncDef):
|
|
635
|
-
seen_unconditional_func_def = True
|
|
636
|
-
elif (
|
|
637
|
-
current_overload_name is not None
|
|
638
|
-
and isinstance(stmt, IfStmt)
|
|
639
|
-
and if_overload_name == current_overload_name
|
|
640
|
-
):
|
|
641
|
-
# IfStmt only contains stmts relevant to current_overload.
|
|
642
|
-
# Check if stmts are reachable and add them to current_overload,
|
|
643
|
-
# otherwise skip IfStmt to allow subsequent overload
|
|
644
|
-
# or function definitions.
|
|
645
|
-
skipped_if_stmts.append(stmt)
|
|
646
|
-
if if_block_with_overload is None:
|
|
647
|
-
if if_unknown_truth_value is not None:
|
|
648
|
-
self.fail_merge_overload(if_unknown_truth_value)
|
|
649
|
-
continue
|
|
650
|
-
if last_if_overload is not None:
|
|
651
|
-
# Last stmt was an IfStmt with same overload name
|
|
652
|
-
# Add overloads to current_overload
|
|
653
|
-
if isinstance(last_if_overload, OverloadedFuncDef):
|
|
654
|
-
current_overload.extend(last_if_overload.items)
|
|
655
|
-
else:
|
|
656
|
-
current_overload.append(last_if_overload)
|
|
657
|
-
last_if_stmt, last_if_overload = None, None
|
|
658
|
-
if isinstance(if_block_with_overload.body[-1], OverloadedFuncDef):
|
|
659
|
-
skipped_if_stmts.extend(cast(List[IfStmt], if_block_with_overload.body[:-1]))
|
|
660
|
-
current_overload.extend(if_block_with_overload.body[-1].items)
|
|
661
|
-
else:
|
|
662
|
-
current_overload.append(
|
|
663
|
-
cast(Union[Decorator, FuncDef], if_block_with_overload.body[0])
|
|
664
|
-
)
|
|
665
|
-
else:
|
|
666
|
-
if last_if_stmt is not None:
|
|
667
|
-
ret.append(last_if_stmt)
|
|
668
|
-
last_if_stmt_overload_name = current_overload_name
|
|
669
|
-
last_if_stmt, last_if_overload = None, None
|
|
670
|
-
last_if_unknown_truth_value = None
|
|
671
|
-
|
|
672
|
-
if current_overload and current_overload_name == last_if_stmt_overload_name:
|
|
673
|
-
# Remove last stmt (IfStmt) from ret if the overload names matched
|
|
674
|
-
# Only happens if no executable block had been found in IfStmt
|
|
675
|
-
popped = ret.pop()
|
|
676
|
-
assert isinstance(popped, IfStmt)
|
|
677
|
-
skipped_if_stmts.append(popped)
|
|
678
|
-
if current_overload and skipped_if_stmts:
|
|
679
|
-
# Add bare IfStmt (without overloads) to ret
|
|
680
|
-
# Required for mypy to be able to still check conditions
|
|
681
|
-
for if_stmt in skipped_if_stmts:
|
|
682
|
-
self._strip_contents_from_if_stmt(if_stmt)
|
|
683
|
-
ret.append(if_stmt)
|
|
684
|
-
skipped_if_stmts = []
|
|
685
|
-
if len(current_overload) == 1:
|
|
686
|
-
ret.append(current_overload[0])
|
|
687
|
-
elif len(current_overload) > 1:
|
|
688
|
-
ret.append(OverloadedFuncDef(current_overload))
|
|
689
|
-
|
|
690
|
-
# If we have multiple decorated functions named "_" next to each, we want to treat
|
|
691
|
-
# them as a series of regular FuncDefs instead of one OverloadedFuncDef because
|
|
692
|
-
# most of mypy/mypyc assumes that all the functions in an OverloadedFuncDef are
|
|
693
|
-
# related, but multiple underscore functions next to each other aren't necessarily
|
|
694
|
-
# related
|
|
695
|
-
seen_unconditional_func_def = False
|
|
696
|
-
if isinstance(stmt, Decorator) and not unnamed_function(stmt.name):
|
|
697
|
-
current_overload = [stmt]
|
|
698
|
-
current_overload_name = stmt.name
|
|
699
|
-
elif isinstance(stmt, IfStmt) and if_overload_name is not None:
|
|
700
|
-
current_overload = []
|
|
701
|
-
current_overload_name = if_overload_name
|
|
702
|
-
last_if_stmt = stmt
|
|
703
|
-
last_if_stmt_overload_name = None
|
|
704
|
-
if if_block_with_overload is not None:
|
|
705
|
-
skipped_if_stmts.extend(
|
|
706
|
-
cast(List[IfStmt], if_block_with_overload.body[:-1])
|
|
707
|
-
)
|
|
708
|
-
last_if_overload = cast(
|
|
709
|
-
Union[Decorator, FuncDef, OverloadedFuncDef],
|
|
710
|
-
if_block_with_overload.body[-1],
|
|
711
|
-
)
|
|
712
|
-
last_if_unknown_truth_value = if_unknown_truth_value
|
|
713
|
-
else:
|
|
714
|
-
current_overload = []
|
|
715
|
-
current_overload_name = None
|
|
716
|
-
ret.append(stmt)
|
|
717
|
-
|
|
718
|
-
if current_overload and skipped_if_stmts:
|
|
719
|
-
# Add bare IfStmt (without overloads) to ret
|
|
720
|
-
# Required for mypy to be able to still check conditions
|
|
721
|
-
for if_stmt in skipped_if_stmts:
|
|
722
|
-
self._strip_contents_from_if_stmt(if_stmt)
|
|
723
|
-
ret.append(if_stmt)
|
|
724
|
-
if len(current_overload) == 1:
|
|
725
|
-
ret.append(current_overload[0])
|
|
726
|
-
elif len(current_overload) > 1:
|
|
727
|
-
ret.append(OverloadedFuncDef(current_overload))
|
|
728
|
-
elif last_if_overload is not None:
|
|
729
|
-
ret.append(last_if_overload)
|
|
730
|
-
elif last_if_stmt is not None:
|
|
731
|
-
ret.append(last_if_stmt)
|
|
732
|
-
return ret
|
|
733
|
-
|
|
734
|
-
def _check_ifstmt_for_overloads(
|
|
735
|
-
self, stmt: IfStmt, current_overload_name: str | None = None
|
|
736
|
-
) -> str | None:
|
|
737
|
-
"""Check if IfStmt contains only overloads with the same name.
|
|
738
|
-
Return overload_name if found, None otherwise.
|
|
739
|
-
"""
|
|
740
|
-
# Check that block only contains a single Decorator, FuncDef, or OverloadedFuncDef.
|
|
741
|
-
# Multiple overloads have already been merged as OverloadedFuncDef.
|
|
742
|
-
if not (
|
|
743
|
-
len(stmt.body[0].body) == 1
|
|
744
|
-
and (
|
|
745
|
-
isinstance(stmt.body[0].body[0], (Decorator, OverloadedFuncDef))
|
|
746
|
-
or current_overload_name is not None
|
|
747
|
-
and isinstance(stmt.body[0].body[0], FuncDef)
|
|
748
|
-
)
|
|
749
|
-
or len(stmt.body[0].body) > 1
|
|
750
|
-
and isinstance(stmt.body[0].body[-1], OverloadedFuncDef)
|
|
751
|
-
and all(self._is_stripped_if_stmt(if_stmt) for if_stmt in stmt.body[0].body[:-1])
|
|
752
|
-
):
|
|
753
|
-
return None
|
|
754
|
-
|
|
755
|
-
overload_name = cast(
|
|
756
|
-
Union[Decorator, FuncDef, OverloadedFuncDef], stmt.body[0].body[-1]
|
|
757
|
-
).name
|
|
758
|
-
if stmt.else_body is None:
|
|
759
|
-
return overload_name
|
|
760
|
-
|
|
761
|
-
if len(stmt.else_body.body) == 1:
|
|
762
|
-
# For elif: else_body contains an IfStmt itself -> do a recursive check.
|
|
763
|
-
if (
|
|
764
|
-
isinstance(stmt.else_body.body[0], (Decorator, FuncDef, OverloadedFuncDef))
|
|
765
|
-
and stmt.else_body.body[0].name == overload_name
|
|
766
|
-
):
|
|
767
|
-
return overload_name
|
|
768
|
-
if (
|
|
769
|
-
isinstance(stmt.else_body.body[0], IfStmt)
|
|
770
|
-
and self._check_ifstmt_for_overloads(stmt.else_body.body[0], current_overload_name)
|
|
771
|
-
== overload_name
|
|
772
|
-
):
|
|
773
|
-
return overload_name
|
|
774
|
-
|
|
775
|
-
return None
|
|
776
|
-
|
|
777
|
-
def _get_executable_if_block_with_overloads(
|
|
778
|
-
self, stmt: IfStmt
|
|
779
|
-
) -> tuple[Block | None, IfStmt | None]:
|
|
780
|
-
"""Return block from IfStmt that will get executed.
|
|
781
|
-
|
|
782
|
-
Return
|
|
783
|
-
0 -> A block if sure that alternative blocks are unreachable.
|
|
784
|
-
1 -> An IfStmt if the reachability of it can't be inferred,
|
|
785
|
-
i.e. the truth value is unknown.
|
|
786
|
-
"""
|
|
787
|
-
infer_reachability_of_if_statement(stmt, self.options)
|
|
788
|
-
if stmt.else_body is None and stmt.body[0].is_unreachable is True:
|
|
789
|
-
# always False condition with no else
|
|
790
|
-
return None, None
|
|
791
|
-
if (
|
|
792
|
-
stmt.else_body is None
|
|
793
|
-
or stmt.body[0].is_unreachable is False
|
|
794
|
-
and stmt.else_body.is_unreachable is False
|
|
795
|
-
):
|
|
796
|
-
# The truth value is unknown, thus not conclusive
|
|
797
|
-
return None, stmt
|
|
798
|
-
if stmt.else_body.is_unreachable is True:
|
|
799
|
-
# else_body will be set unreachable if condition is always True
|
|
800
|
-
return stmt.body[0], None
|
|
801
|
-
if stmt.body[0].is_unreachable is True:
|
|
802
|
-
# body will be set unreachable if condition is always False
|
|
803
|
-
# else_body can contain an IfStmt itself (for elif) -> do a recursive check
|
|
804
|
-
if isinstance(stmt.else_body.body[0], IfStmt):
|
|
805
|
-
return self._get_executable_if_block_with_overloads(stmt.else_body.body[0])
|
|
806
|
-
return stmt.else_body, None
|
|
807
|
-
return None, stmt
|
|
808
|
-
|
|
809
|
-
def _strip_contents_from_if_stmt(self, stmt: IfStmt) -> None:
|
|
810
|
-
"""Remove contents from IfStmt.
|
|
811
|
-
|
|
812
|
-
Needed to still be able to check the conditions after the contents
|
|
813
|
-
have been merged with the surrounding function overloads.
|
|
814
|
-
"""
|
|
815
|
-
if len(stmt.body) == 1:
|
|
816
|
-
stmt.body[0].body = []
|
|
817
|
-
if stmt.else_body and len(stmt.else_body.body) == 1:
|
|
818
|
-
if isinstance(stmt.else_body.body[0], IfStmt):
|
|
819
|
-
self._strip_contents_from_if_stmt(stmt.else_body.body[0])
|
|
820
|
-
else:
|
|
821
|
-
stmt.else_body.body = []
|
|
822
|
-
|
|
823
|
-
def _is_stripped_if_stmt(self, stmt: Statement) -> bool:
|
|
824
|
-
"""Check stmt to make sure it is a stripped IfStmt.
|
|
825
|
-
|
|
826
|
-
See also: _strip_contents_from_if_stmt
|
|
827
|
-
"""
|
|
828
|
-
if not isinstance(stmt, IfStmt):
|
|
829
|
-
return False
|
|
830
|
-
|
|
831
|
-
if not (len(stmt.body) == 1 and len(stmt.body[0].body) == 0):
|
|
832
|
-
# Body not empty
|
|
833
|
-
return False
|
|
834
|
-
|
|
835
|
-
if not stmt.else_body or len(stmt.else_body.body) == 0:
|
|
836
|
-
# No or empty else_body
|
|
837
|
-
return True
|
|
838
|
-
|
|
839
|
-
# For elif, IfStmt are stored recursively in else_body
|
|
840
|
-
return self._is_stripped_if_stmt(stmt.else_body.body[0])
|
|
841
|
-
|
|
842
|
-
def translate_module_id(self, id: str) -> str:
|
|
843
|
-
"""Return the actual, internal module id for a source text id."""
|
|
844
|
-
if id == self.options.custom_typing_module:
|
|
845
|
-
return "typing"
|
|
846
|
-
return id
|
|
847
|
-
|
|
848
|
-
def visit_Module(self, mod: ast3.Module) -> MypyFile:
|
|
849
|
-
self.type_ignores = {}
|
|
850
|
-
for ti in mod.type_ignores:
|
|
851
|
-
parsed = parse_type_ignore_tag(ti.tag)
|
|
852
|
-
if parsed is not None:
|
|
853
|
-
self.type_ignores[ti.lineno] = parsed
|
|
854
|
-
else:
|
|
855
|
-
self.fail(message_registry.INVALID_TYPE_IGNORE, ti.lineno, -1, blocker=False)
|
|
856
|
-
|
|
857
|
-
body = self.fix_function_overloads(self.translate_stmt_list(mod.body, ismodule=True))
|
|
858
|
-
|
|
859
|
-
ret = MypyFile(body, self.imports, False, ignored_lines=self.type_ignores)
|
|
860
|
-
ret.is_stub = self.is_stub
|
|
861
|
-
ret.path = self.path
|
|
862
|
-
return ret
|
|
863
|
-
|
|
864
|
-
# --- stmt ---
|
|
865
|
-
# FunctionDef(identifier name, arguments args,
|
|
866
|
-
# stmt* body, expr* decorator_list, expr? returns, string? type_comment)
|
|
867
|
-
# arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
|
|
868
|
-
# arg? kwarg, expr* defaults)
|
|
869
|
-
def visit_FunctionDef(self, n: ast3.FunctionDef) -> FuncDef | Decorator:
|
|
870
|
-
return self.do_func_def(n)
|
|
871
|
-
|
|
872
|
-
# AsyncFunctionDef(identifier name, arguments args,
|
|
873
|
-
# stmt* body, expr* decorator_list, expr? returns, string? type_comment)
|
|
874
|
-
def visit_AsyncFunctionDef(self, n: ast3.AsyncFunctionDef) -> FuncDef | Decorator:
|
|
875
|
-
return self.do_func_def(n, is_coroutine=True)
|
|
876
|
-
|
|
877
|
-
def do_func_def(
|
|
878
|
-
self, n: ast3.FunctionDef | ast3.AsyncFunctionDef, is_coroutine: bool = False
|
|
879
|
-
) -> FuncDef | Decorator:
|
|
880
|
-
"""Helper shared between visit_FunctionDef and visit_AsyncFunctionDef."""
|
|
881
|
-
self.class_and_function_stack.append("D")
|
|
882
|
-
no_type_check = bool(
|
|
883
|
-
n.decorator_list and any(is_no_type_check_decorator(d) for d in n.decorator_list)
|
|
884
|
-
)
|
|
885
|
-
|
|
886
|
-
lineno = n.lineno
|
|
887
|
-
args = self.transform_args(n.args, lineno, no_type_check=no_type_check)
|
|
888
|
-
if special_function_elide_names(n.name):
|
|
889
|
-
for arg in args:
|
|
890
|
-
arg.pos_only = True
|
|
891
|
-
|
|
892
|
-
arg_kinds = [arg.kind for arg in args]
|
|
893
|
-
arg_names = [None if arg.pos_only else arg.variable.name for arg in args]
|
|
894
|
-
|
|
895
|
-
arg_types: list[Type | None] = []
|
|
896
|
-
if no_type_check:
|
|
897
|
-
arg_types = [None] * len(args)
|
|
898
|
-
return_type = None
|
|
899
|
-
elif n.type_comment is not None:
|
|
900
|
-
try:
|
|
901
|
-
func_type_ast = ast3_parse(n.type_comment, "<func_type>", "func_type")
|
|
902
|
-
assert isinstance(func_type_ast, FunctionType)
|
|
903
|
-
# for ellipsis arg
|
|
904
|
-
if (
|
|
905
|
-
len(func_type_ast.argtypes) == 1
|
|
906
|
-
and isinstance(func_type_ast.argtypes[0], Constant)
|
|
907
|
-
and func_type_ast.argtypes[0].value is Ellipsis
|
|
908
|
-
):
|
|
909
|
-
if n.returns:
|
|
910
|
-
# PEP 484 disallows both type annotations and type comments
|
|
911
|
-
self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, lineno, n.col_offset)
|
|
912
|
-
arg_types = [
|
|
913
|
-
(
|
|
914
|
-
a.type_annotation
|
|
915
|
-
if a.type_annotation is not None
|
|
916
|
-
else AnyType(TypeOfAny.unannotated)
|
|
917
|
-
)
|
|
918
|
-
for a in args
|
|
919
|
-
]
|
|
920
|
-
else:
|
|
921
|
-
# PEP 484 disallows both type annotations and type comments
|
|
922
|
-
if n.returns or any(a.type_annotation is not None for a in args):
|
|
923
|
-
self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, lineno, n.col_offset)
|
|
924
|
-
translated_args: list[Type] = TypeConverter(
|
|
925
|
-
self.errors, line=lineno, override_column=n.col_offset
|
|
926
|
-
).translate_expr_list(func_type_ast.argtypes)
|
|
927
|
-
# Use a cast to work around `list` invariance
|
|
928
|
-
arg_types = cast(List[Optional[Type]], translated_args)
|
|
929
|
-
return_type = TypeConverter(self.errors, line=lineno).visit(func_type_ast.returns)
|
|
930
|
-
|
|
931
|
-
# add implicit self type
|
|
932
|
-
in_method_scope = self.class_and_function_stack[-2:] == ["C", "D"]
|
|
933
|
-
if in_method_scope and len(arg_types) < len(args):
|
|
934
|
-
arg_types.insert(0, AnyType(TypeOfAny.special_form))
|
|
935
|
-
except SyntaxError:
|
|
936
|
-
stripped_type = n.type_comment.split("#", 2)[0].strip()
|
|
937
|
-
err_msg = message_registry.TYPE_COMMENT_SYNTAX_ERROR_VALUE.format(stripped_type)
|
|
938
|
-
self.fail(err_msg, lineno, n.col_offset)
|
|
939
|
-
if n.type_comment and n.type_comment[0] not in ["(", "#"]:
|
|
940
|
-
self.note(
|
|
941
|
-
"Suggestion: wrap argument types in parentheses", lineno, n.col_offset
|
|
942
|
-
)
|
|
943
|
-
arg_types = [AnyType(TypeOfAny.from_error)] * len(args)
|
|
944
|
-
return_type = AnyType(TypeOfAny.from_error)
|
|
945
|
-
else:
|
|
946
|
-
if sys.version_info >= (3, 12) and n.type_params:
|
|
947
|
-
self.fail(
|
|
948
|
-
ErrorMessage("PEP 695 generics are not yet supported", code=codes.VALID_TYPE),
|
|
949
|
-
n.type_params[0].lineno,
|
|
950
|
-
n.type_params[0].col_offset,
|
|
951
|
-
blocker=False,
|
|
952
|
-
)
|
|
953
|
-
|
|
954
|
-
arg_types = [a.type_annotation for a in args]
|
|
955
|
-
return_type = TypeConverter(
|
|
956
|
-
self.errors, line=n.returns.lineno if n.returns else lineno
|
|
957
|
-
).visit(n.returns)
|
|
958
|
-
|
|
959
|
-
for arg, arg_type in zip(args, arg_types):
|
|
960
|
-
self.set_type_optional(arg_type, arg.initializer)
|
|
961
|
-
|
|
962
|
-
func_type = None
|
|
963
|
-
if any(arg_types) or return_type:
|
|
964
|
-
if len(arg_types) != 1 and any(isinstance(t, EllipsisType) for t in arg_types):
|
|
965
|
-
self.fail(message_registry.ELLIPSIS_WITH_OTHER_TYPEARGS, lineno, n.col_offset)
|
|
966
|
-
elif len(arg_types) > len(arg_kinds):
|
|
967
|
-
self.fail(
|
|
968
|
-
message_registry.TYPE_SIGNATURE_TOO_MANY_ARGS,
|
|
969
|
-
lineno,
|
|
970
|
-
n.col_offset,
|
|
971
|
-
blocker=False,
|
|
972
|
-
)
|
|
973
|
-
elif len(arg_types) < len(arg_kinds):
|
|
974
|
-
self.fail(
|
|
975
|
-
message_registry.TYPE_SIGNATURE_TOO_FEW_ARGS,
|
|
976
|
-
lineno,
|
|
977
|
-
n.col_offset,
|
|
978
|
-
blocker=False,
|
|
979
|
-
)
|
|
980
|
-
else:
|
|
981
|
-
func_type = CallableType(
|
|
982
|
-
[a if a is not None else AnyType(TypeOfAny.unannotated) for a in arg_types],
|
|
983
|
-
arg_kinds,
|
|
984
|
-
arg_names,
|
|
985
|
-
return_type if return_type is not None else AnyType(TypeOfAny.unannotated),
|
|
986
|
-
_dummy_fallback,
|
|
987
|
-
)
|
|
988
|
-
|
|
989
|
-
# End position is always the same.
|
|
990
|
-
end_line = getattr(n, "end_lineno", None)
|
|
991
|
-
end_column = getattr(n, "end_col_offset", None)
|
|
992
|
-
|
|
993
|
-
self.class_and_function_stack.pop()
|
|
994
|
-
self.class_and_function_stack.append("F")
|
|
995
|
-
body = self.as_required_block(n.body, can_strip=True, is_coroutine=is_coroutine)
|
|
996
|
-
func_def = FuncDef(n.name, args, body, func_type)
|
|
997
|
-
if isinstance(func_def.type, CallableType):
|
|
998
|
-
# semanal.py does some in-place modifications we want to avoid
|
|
999
|
-
func_def.unanalyzed_type = func_def.type.copy_modified()
|
|
1000
|
-
if is_coroutine:
|
|
1001
|
-
func_def.is_coroutine = True
|
|
1002
|
-
if func_type is not None:
|
|
1003
|
-
func_type.definition = func_def
|
|
1004
|
-
func_type.line = lineno
|
|
1005
|
-
|
|
1006
|
-
if n.decorator_list:
|
|
1007
|
-
# Set deco_line to the old pre-3.8 lineno, in order to keep
|
|
1008
|
-
# existing "# type: ignore" comments working:
|
|
1009
|
-
deco_line = n.decorator_list[0].lineno
|
|
1010
|
-
|
|
1011
|
-
var = Var(func_def.name)
|
|
1012
|
-
var.is_ready = False
|
|
1013
|
-
var.set_line(lineno)
|
|
1014
|
-
|
|
1015
|
-
func_def.is_decorated = True
|
|
1016
|
-
func_def.deco_line = deco_line
|
|
1017
|
-
func_def.set_line(lineno, n.col_offset, end_line, end_column)
|
|
1018
|
-
|
|
1019
|
-
deco = Decorator(func_def, self.translate_expr_list(n.decorator_list), var)
|
|
1020
|
-
first = n.decorator_list[0]
|
|
1021
|
-
deco.set_line(first.lineno, first.col_offset, end_line, end_column)
|
|
1022
|
-
retval: FuncDef | Decorator = deco
|
|
1023
|
-
else:
|
|
1024
|
-
# FuncDef overrides set_line -- can't use self.set_line
|
|
1025
|
-
func_def.set_line(lineno, n.col_offset, end_line, end_column)
|
|
1026
|
-
retval = func_def
|
|
1027
|
-
if self.options.include_docstrings:
|
|
1028
|
-
func_def.docstring = ast3.get_docstring(n, clean=False)
|
|
1029
|
-
self.class_and_function_stack.pop()
|
|
1030
|
-
return retval
|
|
1031
|
-
|
|
1032
|
-
def set_type_optional(self, type: Type | None, initializer: Expression | None) -> None:
|
|
1033
|
-
if not self.options.implicit_optional:
|
|
1034
|
-
return
|
|
1035
|
-
# Indicate that type should be wrapped in an Optional if arg is initialized to None.
|
|
1036
|
-
optional = isinstance(initializer, NameExpr) and initializer.name == "None"
|
|
1037
|
-
if isinstance(type, UnboundType):
|
|
1038
|
-
type.optional = optional
|
|
1039
|
-
|
|
1040
|
-
def transform_args(
|
|
1041
|
-
self, args: ast3.arguments, line: int, no_type_check: bool = False
|
|
1042
|
-
) -> list[Argument]:
|
|
1043
|
-
new_args = []
|
|
1044
|
-
names: list[ast3.arg] = []
|
|
1045
|
-
posonlyargs = getattr(args, "posonlyargs", cast(List[ast3.arg], []))
|
|
1046
|
-
args_args = posonlyargs + args.args
|
|
1047
|
-
args_defaults = args.defaults
|
|
1048
|
-
num_no_defaults = len(args_args) - len(args_defaults)
|
|
1049
|
-
# positional arguments without defaults
|
|
1050
|
-
for i, a in enumerate(args_args[:num_no_defaults]):
|
|
1051
|
-
pos_only = i < len(posonlyargs)
|
|
1052
|
-
new_args.append(self.make_argument(a, None, ARG_POS, no_type_check, pos_only))
|
|
1053
|
-
names.append(a)
|
|
1054
|
-
|
|
1055
|
-
# positional arguments with defaults
|
|
1056
|
-
for i, (a, d) in enumerate(zip(args_args[num_no_defaults:], args_defaults)):
|
|
1057
|
-
pos_only = num_no_defaults + i < len(posonlyargs)
|
|
1058
|
-
new_args.append(self.make_argument(a, d, ARG_OPT, no_type_check, pos_only))
|
|
1059
|
-
names.append(a)
|
|
1060
|
-
|
|
1061
|
-
# *arg
|
|
1062
|
-
if args.vararg is not None:
|
|
1063
|
-
new_args.append(self.make_argument(args.vararg, None, ARG_STAR, no_type_check))
|
|
1064
|
-
names.append(args.vararg)
|
|
1065
|
-
|
|
1066
|
-
# keyword-only arguments with defaults
|
|
1067
|
-
for a, kd in zip(args.kwonlyargs, args.kw_defaults):
|
|
1068
|
-
new_args.append(
|
|
1069
|
-
self.make_argument(
|
|
1070
|
-
a, kd, ARG_NAMED if kd is None else ARG_NAMED_OPT, no_type_check
|
|
1071
|
-
)
|
|
1072
|
-
)
|
|
1073
|
-
names.append(a)
|
|
1074
|
-
|
|
1075
|
-
# **kwarg
|
|
1076
|
-
if args.kwarg is not None:
|
|
1077
|
-
new_args.append(self.make_argument(args.kwarg, None, ARG_STAR2, no_type_check))
|
|
1078
|
-
names.append(args.kwarg)
|
|
1079
|
-
|
|
1080
|
-
check_arg_names([arg.variable.name for arg in new_args], names, self.fail_arg)
|
|
1081
|
-
|
|
1082
|
-
return new_args
|
|
1083
|
-
|
|
1084
|
-
def make_argument(
|
|
1085
|
-
self,
|
|
1086
|
-
arg: ast3.arg,
|
|
1087
|
-
default: ast3.expr | None,
|
|
1088
|
-
kind: ArgKind,
|
|
1089
|
-
no_type_check: bool,
|
|
1090
|
-
pos_only: bool = False,
|
|
1091
|
-
) -> Argument:
|
|
1092
|
-
if no_type_check:
|
|
1093
|
-
arg_type = None
|
|
1094
|
-
else:
|
|
1095
|
-
annotation = arg.annotation
|
|
1096
|
-
type_comment = arg.type_comment
|
|
1097
|
-
if annotation is not None and type_comment is not None:
|
|
1098
|
-
self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, arg.lineno, arg.col_offset)
|
|
1099
|
-
arg_type = None
|
|
1100
|
-
if annotation is not None:
|
|
1101
|
-
arg_type = TypeConverter(self.errors, line=arg.lineno).visit(annotation)
|
|
1102
|
-
else:
|
|
1103
|
-
arg_type = self.translate_type_comment(arg, type_comment)
|
|
1104
|
-
if argument_elide_name(arg.arg):
|
|
1105
|
-
pos_only = True
|
|
1106
|
-
|
|
1107
|
-
argument = Argument(Var(arg.arg), arg_type, self.visit(default), kind, pos_only)
|
|
1108
|
-
argument.set_line(
|
|
1109
|
-
arg.lineno,
|
|
1110
|
-
arg.col_offset,
|
|
1111
|
-
getattr(arg, "end_lineno", None),
|
|
1112
|
-
getattr(arg, "end_col_offset", None),
|
|
1113
|
-
)
|
|
1114
|
-
return argument
|
|
1115
|
-
|
|
1116
|
-
def fail_arg(self, msg: str, arg: ast3.arg) -> None:
|
|
1117
|
-
self.fail(ErrorMessage(msg), arg.lineno, arg.col_offset)
|
|
1118
|
-
|
|
1119
|
-
# ClassDef(identifier name,
|
|
1120
|
-
# expr* bases,
|
|
1121
|
-
# keyword* keywords,
|
|
1122
|
-
# stmt* body,
|
|
1123
|
-
# expr* decorator_list)
|
|
1124
|
-
def visit_ClassDef(self, n: ast3.ClassDef) -> ClassDef:
|
|
1125
|
-
self.class_and_function_stack.append("C")
|
|
1126
|
-
keywords = [(kw.arg, self.visit(kw.value)) for kw in n.keywords if kw.arg]
|
|
1127
|
-
|
|
1128
|
-
if sys.version_info >= (3, 12) and n.type_params:
|
|
1129
|
-
self.fail(
|
|
1130
|
-
ErrorMessage("PEP 695 generics are not yet supported", code=codes.VALID_TYPE),
|
|
1131
|
-
n.type_params[0].lineno,
|
|
1132
|
-
n.type_params[0].col_offset,
|
|
1133
|
-
blocker=False,
|
|
1134
|
-
)
|
|
1135
|
-
|
|
1136
|
-
cdef = ClassDef(
|
|
1137
|
-
n.name,
|
|
1138
|
-
self.as_required_block(n.body),
|
|
1139
|
-
None,
|
|
1140
|
-
self.translate_expr_list(n.bases),
|
|
1141
|
-
metaclass=dict(keywords).get("metaclass"),
|
|
1142
|
-
keywords=keywords,
|
|
1143
|
-
)
|
|
1144
|
-
cdef.decorators = self.translate_expr_list(n.decorator_list)
|
|
1145
|
-
# Set lines to match the old mypy 0.700 lines, in order to keep
|
|
1146
|
-
# existing "# type: ignore" comments working:
|
|
1147
|
-
cdef.line = n.lineno
|
|
1148
|
-
cdef.deco_line = n.decorator_list[0].lineno if n.decorator_list else None
|
|
1149
|
-
|
|
1150
|
-
if self.options.include_docstrings:
|
|
1151
|
-
cdef.docstring = ast3.get_docstring(n, clean=False)
|
|
1152
|
-
cdef.column = n.col_offset
|
|
1153
|
-
cdef.end_line = getattr(n, "end_lineno", None)
|
|
1154
|
-
cdef.end_column = getattr(n, "end_col_offset", None)
|
|
1155
|
-
self.class_and_function_stack.pop()
|
|
1156
|
-
return cdef
|
|
1157
|
-
|
|
1158
|
-
# Return(expr? value)
|
|
1159
|
-
def visit_Return(self, n: ast3.Return) -> ReturnStmt:
|
|
1160
|
-
node = ReturnStmt(self.visit(n.value))
|
|
1161
|
-
return self.set_line(node, n)
|
|
1162
|
-
|
|
1163
|
-
# Delete(expr* targets)
|
|
1164
|
-
def visit_Delete(self, n: ast3.Delete) -> DelStmt:
|
|
1165
|
-
if len(n.targets) > 1:
|
|
1166
|
-
tup = TupleExpr(self.translate_expr_list(n.targets))
|
|
1167
|
-
tup.set_line(n.lineno)
|
|
1168
|
-
node = DelStmt(tup)
|
|
1169
|
-
else:
|
|
1170
|
-
node = DelStmt(self.visit(n.targets[0]))
|
|
1171
|
-
return self.set_line(node, n)
|
|
1172
|
-
|
|
1173
|
-
# Assign(expr* targets, expr? value, string? type_comment, expr? annotation)
|
|
1174
|
-
def visit_Assign(self, n: ast3.Assign) -> AssignmentStmt:
|
|
1175
|
-
lvalues = self.translate_expr_list(n.targets)
|
|
1176
|
-
rvalue = self.visit(n.value)
|
|
1177
|
-
typ = self.translate_type_comment(n, n.type_comment)
|
|
1178
|
-
s = AssignmentStmt(lvalues, rvalue, type=typ, new_syntax=False)
|
|
1179
|
-
return self.set_line(s, n)
|
|
1180
|
-
|
|
1181
|
-
# AnnAssign(expr target, expr annotation, expr? value, int simple)
|
|
1182
|
-
def visit_AnnAssign(self, n: ast3.AnnAssign) -> AssignmentStmt:
|
|
1183
|
-
line = n.lineno
|
|
1184
|
-
if n.value is None: # always allow 'x: int'
|
|
1185
|
-
rvalue: Expression = TempNode(AnyType(TypeOfAny.special_form), no_rhs=True)
|
|
1186
|
-
rvalue.line = line
|
|
1187
|
-
rvalue.column = n.col_offset
|
|
1188
|
-
else:
|
|
1189
|
-
rvalue = self.visit(n.value)
|
|
1190
|
-
typ = TypeConverter(self.errors, line=line).visit(n.annotation)
|
|
1191
|
-
assert typ is not None
|
|
1192
|
-
typ.column = n.annotation.col_offset
|
|
1193
|
-
s = AssignmentStmt([self.visit(n.target)], rvalue, type=typ, new_syntax=True)
|
|
1194
|
-
return self.set_line(s, n)
|
|
1195
|
-
|
|
1196
|
-
# AugAssign(expr target, operator op, expr value)
|
|
1197
|
-
def visit_AugAssign(self, n: ast3.AugAssign) -> OperatorAssignmentStmt:
|
|
1198
|
-
s = OperatorAssignmentStmt(
|
|
1199
|
-
self.from_operator(n.op), self.visit(n.target), self.visit(n.value)
|
|
1200
|
-
)
|
|
1201
|
-
return self.set_line(s, n)
|
|
1202
|
-
|
|
1203
|
-
# For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
|
|
1204
|
-
def visit_For(self, n: ast3.For) -> ForStmt:
|
|
1205
|
-
target_type = self.translate_type_comment(n, n.type_comment)
|
|
1206
|
-
node = ForStmt(
|
|
1207
|
-
self.visit(n.target),
|
|
1208
|
-
self.visit(n.iter),
|
|
1209
|
-
self.as_required_block(n.body),
|
|
1210
|
-
self.as_block(n.orelse),
|
|
1211
|
-
target_type,
|
|
1212
|
-
)
|
|
1213
|
-
return self.set_line(node, n)
|
|
1214
|
-
|
|
1215
|
-
# AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
|
|
1216
|
-
def visit_AsyncFor(self, n: ast3.AsyncFor) -> ForStmt:
|
|
1217
|
-
target_type = self.translate_type_comment(n, n.type_comment)
|
|
1218
|
-
node = ForStmt(
|
|
1219
|
-
self.visit(n.target),
|
|
1220
|
-
self.visit(n.iter),
|
|
1221
|
-
self.as_required_block(n.body),
|
|
1222
|
-
self.as_block(n.orelse),
|
|
1223
|
-
target_type,
|
|
1224
|
-
)
|
|
1225
|
-
node.is_async = True
|
|
1226
|
-
return self.set_line(node, n)
|
|
1227
|
-
|
|
1228
|
-
# While(expr test, stmt* body, stmt* orelse)
|
|
1229
|
-
def visit_While(self, n: ast3.While) -> WhileStmt:
|
|
1230
|
-
node = WhileStmt(
|
|
1231
|
-
self.visit(n.test), self.as_required_block(n.body), self.as_block(n.orelse)
|
|
1232
|
-
)
|
|
1233
|
-
return self.set_line(node, n)
|
|
1234
|
-
|
|
1235
|
-
# If(expr test, stmt* body, stmt* orelse)
|
|
1236
|
-
def visit_If(self, n: ast3.If) -> IfStmt:
|
|
1237
|
-
node = IfStmt(
|
|
1238
|
-
[self.visit(n.test)], [self.as_required_block(n.body)], self.as_block(n.orelse)
|
|
1239
|
-
)
|
|
1240
|
-
return self.set_line(node, n)
|
|
1241
|
-
|
|
1242
|
-
# With(withitem* items, stmt* body, string? type_comment)
|
|
1243
|
-
def visit_With(self, n: ast3.With) -> WithStmt:
|
|
1244
|
-
target_type = self.translate_type_comment(n, n.type_comment)
|
|
1245
|
-
node = WithStmt(
|
|
1246
|
-
[self.visit(i.context_expr) for i in n.items],
|
|
1247
|
-
[self.visit(i.optional_vars) for i in n.items],
|
|
1248
|
-
self.as_required_block(n.body),
|
|
1249
|
-
target_type,
|
|
1250
|
-
)
|
|
1251
|
-
return self.set_line(node, n)
|
|
1252
|
-
|
|
1253
|
-
# AsyncWith(withitem* items, stmt* body, string? type_comment)
|
|
1254
|
-
def visit_AsyncWith(self, n: ast3.AsyncWith) -> WithStmt:
|
|
1255
|
-
target_type = self.translate_type_comment(n, n.type_comment)
|
|
1256
|
-
s = WithStmt(
|
|
1257
|
-
[self.visit(i.context_expr) for i in n.items],
|
|
1258
|
-
[self.visit(i.optional_vars) for i in n.items],
|
|
1259
|
-
self.as_required_block(n.body),
|
|
1260
|
-
target_type,
|
|
1261
|
-
)
|
|
1262
|
-
s.is_async = True
|
|
1263
|
-
return self.set_line(s, n)
|
|
1264
|
-
|
|
1265
|
-
# Raise(expr? exc, expr? cause)
|
|
1266
|
-
def visit_Raise(self, n: ast3.Raise) -> RaiseStmt:
|
|
1267
|
-
node = RaiseStmt(self.visit(n.exc), self.visit(n.cause))
|
|
1268
|
-
return self.set_line(node, n)
|
|
1269
|
-
|
|
1270
|
-
# Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
|
|
1271
|
-
def visit_Try(self, n: ast3.Try) -> TryStmt:
|
|
1272
|
-
vs = [
|
|
1273
|
-
self.set_line(NameExpr(h.name), h) if h.name is not None else None for h in n.handlers
|
|
1274
|
-
]
|
|
1275
|
-
types = [self.visit(h.type) for h in n.handlers]
|
|
1276
|
-
handlers = [self.as_required_block(h.body) for h in n.handlers]
|
|
1277
|
-
|
|
1278
|
-
node = TryStmt(
|
|
1279
|
-
self.as_required_block(n.body),
|
|
1280
|
-
vs,
|
|
1281
|
-
types,
|
|
1282
|
-
handlers,
|
|
1283
|
-
self.as_block(n.orelse),
|
|
1284
|
-
self.as_block(n.finalbody),
|
|
1285
|
-
)
|
|
1286
|
-
return self.set_line(node, n)
|
|
1287
|
-
|
|
1288
|
-
def visit_TryStar(self, n: TryStar) -> TryStmt:
|
|
1289
|
-
vs = [
|
|
1290
|
-
self.set_line(NameExpr(h.name), h) if h.name is not None else None for h in n.handlers
|
|
1291
|
-
]
|
|
1292
|
-
types = [self.visit(h.type) for h in n.handlers]
|
|
1293
|
-
handlers = [self.as_required_block(h.body) for h in n.handlers]
|
|
1294
|
-
|
|
1295
|
-
node = TryStmt(
|
|
1296
|
-
self.as_required_block(n.body),
|
|
1297
|
-
vs,
|
|
1298
|
-
types,
|
|
1299
|
-
handlers,
|
|
1300
|
-
self.as_block(n.orelse),
|
|
1301
|
-
self.as_block(n.finalbody),
|
|
1302
|
-
)
|
|
1303
|
-
node.is_star = True
|
|
1304
|
-
return self.set_line(node, n)
|
|
1305
|
-
|
|
1306
|
-
# Assert(expr test, expr? msg)
|
|
1307
|
-
def visit_Assert(self, n: ast3.Assert) -> AssertStmt:
|
|
1308
|
-
node = AssertStmt(self.visit(n.test), self.visit(n.msg))
|
|
1309
|
-
return self.set_line(node, n)
|
|
1310
|
-
|
|
1311
|
-
# Import(alias* names)
|
|
1312
|
-
def visit_Import(self, n: ast3.Import) -> Import:
|
|
1313
|
-
names: list[tuple[str, str | None]] = []
|
|
1314
|
-
for alias in n.names:
|
|
1315
|
-
name = self.translate_module_id(alias.name)
|
|
1316
|
-
asname = alias.asname
|
|
1317
|
-
if asname is None and name != alias.name:
|
|
1318
|
-
# if the module name has been translated (and it's not already
|
|
1319
|
-
# an explicit import-as), make it an implicit import-as the
|
|
1320
|
-
# original name
|
|
1321
|
-
asname = alias.name
|
|
1322
|
-
names.append((name, asname))
|
|
1323
|
-
i = Import(names)
|
|
1324
|
-
self.imports.append(i)
|
|
1325
|
-
return self.set_line(i, n)
|
|
1326
|
-
|
|
1327
|
-
# ImportFrom(identifier? module, alias* names, int? level)
|
|
1328
|
-
def visit_ImportFrom(self, n: ast3.ImportFrom) -> ImportBase:
|
|
1329
|
-
assert n.level is not None
|
|
1330
|
-
if len(n.names) == 1 and n.names[0].name == "*":
|
|
1331
|
-
mod = n.module if n.module is not None else ""
|
|
1332
|
-
i: ImportBase = ImportAll(mod, n.level)
|
|
1333
|
-
else:
|
|
1334
|
-
i = ImportFrom(
|
|
1335
|
-
self.translate_module_id(n.module) if n.module is not None else "",
|
|
1336
|
-
n.level,
|
|
1337
|
-
[(a.name, a.asname) for a in n.names],
|
|
1338
|
-
)
|
|
1339
|
-
self.imports.append(i)
|
|
1340
|
-
return self.set_line(i, n)
|
|
1341
|
-
|
|
1342
|
-
# Global(identifier* names)
|
|
1343
|
-
def visit_Global(self, n: ast3.Global) -> GlobalDecl:
|
|
1344
|
-
g = GlobalDecl(n.names)
|
|
1345
|
-
return self.set_line(g, n)
|
|
1346
|
-
|
|
1347
|
-
# Nonlocal(identifier* names)
|
|
1348
|
-
def visit_Nonlocal(self, n: ast3.Nonlocal) -> NonlocalDecl:
|
|
1349
|
-
d = NonlocalDecl(n.names)
|
|
1350
|
-
return self.set_line(d, n)
|
|
1351
|
-
|
|
1352
|
-
# Expr(expr value)
|
|
1353
|
-
def visit_Expr(self, n: ast3.Expr) -> ExpressionStmt:
|
|
1354
|
-
value = self.visit(n.value)
|
|
1355
|
-
node = ExpressionStmt(value)
|
|
1356
|
-
return self.set_line(node, n)
|
|
1357
|
-
|
|
1358
|
-
# Pass
|
|
1359
|
-
def visit_Pass(self, n: ast3.Pass) -> PassStmt:
|
|
1360
|
-
s = PassStmt()
|
|
1361
|
-
return self.set_line(s, n)
|
|
1362
|
-
|
|
1363
|
-
# Break
|
|
1364
|
-
def visit_Break(self, n: ast3.Break) -> BreakStmt:
|
|
1365
|
-
s = BreakStmt()
|
|
1366
|
-
return self.set_line(s, n)
|
|
1367
|
-
|
|
1368
|
-
# Continue
|
|
1369
|
-
def visit_Continue(self, n: ast3.Continue) -> ContinueStmt:
|
|
1370
|
-
s = ContinueStmt()
|
|
1371
|
-
return self.set_line(s, n)
|
|
1372
|
-
|
|
1373
|
-
# --- expr ---
|
|
1374
|
-
|
|
1375
|
-
def visit_NamedExpr(self, n: NamedExpr) -> AssignmentExpr:
|
|
1376
|
-
s = AssignmentExpr(self.visit(n.target), self.visit(n.value))
|
|
1377
|
-
return self.set_line(s, n)
|
|
1378
|
-
|
|
1379
|
-
# BoolOp(boolop op, expr* values)
|
|
1380
|
-
def visit_BoolOp(self, n: ast3.BoolOp) -> OpExpr:
|
|
1381
|
-
# mypy translates (1 and 2 and 3) as (1 and (2 and 3))
|
|
1382
|
-
assert len(n.values) >= 2
|
|
1383
|
-
op_node = n.op
|
|
1384
|
-
if isinstance(op_node, ast3.And):
|
|
1385
|
-
op = "and"
|
|
1386
|
-
elif isinstance(op_node, ast3.Or):
|
|
1387
|
-
op = "or"
|
|
1388
|
-
else:
|
|
1389
|
-
raise RuntimeError("unknown BoolOp " + str(type(n)))
|
|
1390
|
-
|
|
1391
|
-
# potentially inefficient!
|
|
1392
|
-
return self.group(op, self.translate_expr_list(n.values), n)
|
|
1393
|
-
|
|
1394
|
-
def group(self, op: str, vals: list[Expression], n: ast3.expr) -> OpExpr:
|
|
1395
|
-
if len(vals) == 2:
|
|
1396
|
-
e = OpExpr(op, vals[0], vals[1])
|
|
1397
|
-
else:
|
|
1398
|
-
e = OpExpr(op, vals[0], self.group(op, vals[1:], n))
|
|
1399
|
-
return self.set_line(e, n)
|
|
1400
|
-
|
|
1401
|
-
# BinOp(expr left, operator op, expr right)
|
|
1402
|
-
def visit_BinOp(self, n: ast3.BinOp) -> OpExpr:
|
|
1403
|
-
op = self.from_operator(n.op)
|
|
1404
|
-
|
|
1405
|
-
if op is None:
|
|
1406
|
-
raise RuntimeError("cannot translate BinOp " + str(type(n.op)))
|
|
1407
|
-
|
|
1408
|
-
e = OpExpr(op, self.visit(n.left), self.visit(n.right))
|
|
1409
|
-
return self.set_line(e, n)
|
|
1410
|
-
|
|
1411
|
-
# UnaryOp(unaryop op, expr operand)
|
|
1412
|
-
def visit_UnaryOp(self, n: ast3.UnaryOp) -> UnaryExpr:
|
|
1413
|
-
op = None
|
|
1414
|
-
if isinstance(n.op, ast3.Invert):
|
|
1415
|
-
op = "~"
|
|
1416
|
-
elif isinstance(n.op, ast3.Not):
|
|
1417
|
-
op = "not"
|
|
1418
|
-
elif isinstance(n.op, ast3.UAdd):
|
|
1419
|
-
op = "+"
|
|
1420
|
-
elif isinstance(n.op, ast3.USub):
|
|
1421
|
-
op = "-"
|
|
1422
|
-
|
|
1423
|
-
if op is None:
|
|
1424
|
-
raise RuntimeError("cannot translate UnaryOp " + str(type(n.op)))
|
|
1425
|
-
|
|
1426
|
-
e = UnaryExpr(op, self.visit(n.operand))
|
|
1427
|
-
return self.set_line(e, n)
|
|
1428
|
-
|
|
1429
|
-
# Lambda(arguments args, expr body)
|
|
1430
|
-
def visit_Lambda(self, n: ast3.Lambda) -> LambdaExpr:
|
|
1431
|
-
body = ast3.Return(n.body)
|
|
1432
|
-
body.lineno = n.body.lineno
|
|
1433
|
-
body.col_offset = n.body.col_offset
|
|
1434
|
-
|
|
1435
|
-
self.class_and_function_stack.append("L")
|
|
1436
|
-
e = LambdaExpr(self.transform_args(n.args, n.lineno), self.as_required_block([body]))
|
|
1437
|
-
self.class_and_function_stack.pop()
|
|
1438
|
-
e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line
|
|
1439
|
-
return e
|
|
1440
|
-
|
|
1441
|
-
# IfExp(expr test, expr body, expr orelse)
|
|
1442
|
-
def visit_IfExp(self, n: ast3.IfExp) -> ConditionalExpr:
|
|
1443
|
-
e = ConditionalExpr(self.visit(n.test), self.visit(n.body), self.visit(n.orelse))
|
|
1444
|
-
return self.set_line(e, n)
|
|
1445
|
-
|
|
1446
|
-
# Dict(expr* keys, expr* values)
|
|
1447
|
-
def visit_Dict(self, n: ast3.Dict) -> DictExpr:
|
|
1448
|
-
e = DictExpr(
|
|
1449
|
-
list(zip(self.translate_opt_expr_list(n.keys), self.translate_expr_list(n.values)))
|
|
1450
|
-
)
|
|
1451
|
-
return self.set_line(e, n)
|
|
1452
|
-
|
|
1453
|
-
# Set(expr* elts)
|
|
1454
|
-
def visit_Set(self, n: ast3.Set) -> SetExpr:
|
|
1455
|
-
e = SetExpr(self.translate_expr_list(n.elts))
|
|
1456
|
-
return self.set_line(e, n)
|
|
1457
|
-
|
|
1458
|
-
# ListComp(expr elt, comprehension* generators)
|
|
1459
|
-
def visit_ListComp(self, n: ast3.ListComp) -> ListComprehension:
|
|
1460
|
-
e = ListComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n)))
|
|
1461
|
-
return self.set_line(e, n)
|
|
1462
|
-
|
|
1463
|
-
# SetComp(expr elt, comprehension* generators)
|
|
1464
|
-
def visit_SetComp(self, n: ast3.SetComp) -> SetComprehension:
|
|
1465
|
-
e = SetComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n)))
|
|
1466
|
-
return self.set_line(e, n)
|
|
1467
|
-
|
|
1468
|
-
# DictComp(expr key, expr value, comprehension* generators)
|
|
1469
|
-
def visit_DictComp(self, n: ast3.DictComp) -> DictionaryComprehension:
|
|
1470
|
-
targets = [self.visit(c.target) for c in n.generators]
|
|
1471
|
-
iters = [self.visit(c.iter) for c in n.generators]
|
|
1472
|
-
ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]
|
|
1473
|
-
is_async = [bool(c.is_async) for c in n.generators]
|
|
1474
|
-
e = DictionaryComprehension(
|
|
1475
|
-
self.visit(n.key), self.visit(n.value), targets, iters, ifs_list, is_async
|
|
1476
|
-
)
|
|
1477
|
-
return self.set_line(e, n)
|
|
1478
|
-
|
|
1479
|
-
# GeneratorExp(expr elt, comprehension* generators)
|
|
1480
|
-
def visit_GeneratorExp(self, n: ast3.GeneratorExp) -> GeneratorExpr:
|
|
1481
|
-
targets = [self.visit(c.target) for c in n.generators]
|
|
1482
|
-
iters = [self.visit(c.iter) for c in n.generators]
|
|
1483
|
-
ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]
|
|
1484
|
-
is_async = [bool(c.is_async) for c in n.generators]
|
|
1485
|
-
e = GeneratorExpr(self.visit(n.elt), targets, iters, ifs_list, is_async)
|
|
1486
|
-
return self.set_line(e, n)
|
|
1487
|
-
|
|
1488
|
-
# Await(expr value)
|
|
1489
|
-
def visit_Await(self, n: ast3.Await) -> AwaitExpr:
|
|
1490
|
-
v = self.visit(n.value)
|
|
1491
|
-
e = AwaitExpr(v)
|
|
1492
|
-
return self.set_line(e, n)
|
|
1493
|
-
|
|
1494
|
-
# Yield(expr? value)
|
|
1495
|
-
def visit_Yield(self, n: ast3.Yield) -> YieldExpr:
|
|
1496
|
-
e = YieldExpr(self.visit(n.value))
|
|
1497
|
-
return self.set_line(e, n)
|
|
1498
|
-
|
|
1499
|
-
# YieldFrom(expr value)
|
|
1500
|
-
def visit_YieldFrom(self, n: ast3.YieldFrom) -> YieldFromExpr:
|
|
1501
|
-
e = YieldFromExpr(self.visit(n.value))
|
|
1502
|
-
return self.set_line(e, n)
|
|
1503
|
-
|
|
1504
|
-
# Compare(expr left, cmpop* ops, expr* comparators)
|
|
1505
|
-
def visit_Compare(self, n: ast3.Compare) -> ComparisonExpr:
|
|
1506
|
-
operators = [self.from_comp_operator(o) for o in n.ops]
|
|
1507
|
-
operands = self.translate_expr_list([n.left] + n.comparators)
|
|
1508
|
-
e = ComparisonExpr(operators, operands)
|
|
1509
|
-
return self.set_line(e, n)
|
|
1510
|
-
|
|
1511
|
-
# Call(expr func, expr* args, keyword* keywords)
|
|
1512
|
-
# keyword = (identifier? arg, expr value)
|
|
1513
|
-
def visit_Call(self, n: Call) -> CallExpr:
|
|
1514
|
-
args = n.args
|
|
1515
|
-
keywords = n.keywords
|
|
1516
|
-
keyword_names = [k.arg for k in keywords]
|
|
1517
|
-
arg_types = self.translate_expr_list(
|
|
1518
|
-
[a.value if isinstance(a, Starred) else a for a in args] + [k.value for k in keywords]
|
|
1519
|
-
)
|
|
1520
|
-
arg_kinds = [ARG_STAR if type(a) is Starred else ARG_POS for a in args] + [
|
|
1521
|
-
ARG_STAR2 if arg is None else ARG_NAMED for arg in keyword_names
|
|
1522
|
-
]
|
|
1523
|
-
e = CallExpr(
|
|
1524
|
-
self.visit(n.func),
|
|
1525
|
-
arg_types,
|
|
1526
|
-
arg_kinds,
|
|
1527
|
-
cast("List[Optional[str]]", [None] * len(args)) + keyword_names,
|
|
1528
|
-
)
|
|
1529
|
-
return self.set_line(e, n)
|
|
1530
|
-
|
|
1531
|
-
# Constant(object value) -- a constant, in Python 3.8.
|
|
1532
|
-
def visit_Constant(self, n: Constant) -> Any:
|
|
1533
|
-
val = n.value
|
|
1534
|
-
e: Any = None
|
|
1535
|
-
if val is None:
|
|
1536
|
-
e = NameExpr("None")
|
|
1537
|
-
elif isinstance(val, str):
|
|
1538
|
-
e = StrExpr(val)
|
|
1539
|
-
elif isinstance(val, bytes):
|
|
1540
|
-
e = BytesExpr(bytes_to_human_readable_repr(val))
|
|
1541
|
-
elif isinstance(val, bool): # Must check before int!
|
|
1542
|
-
e = NameExpr(str(val))
|
|
1543
|
-
elif isinstance(val, int):
|
|
1544
|
-
e = IntExpr(val)
|
|
1545
|
-
elif isinstance(val, float):
|
|
1546
|
-
e = FloatExpr(val)
|
|
1547
|
-
elif isinstance(val, complex):
|
|
1548
|
-
e = ComplexExpr(val)
|
|
1549
|
-
elif val is Ellipsis:
|
|
1550
|
-
e = EllipsisExpr()
|
|
1551
|
-
else:
|
|
1552
|
-
raise RuntimeError("Constant not implemented for " + str(type(val)))
|
|
1553
|
-
return self.set_line(e, n)
|
|
1554
|
-
|
|
1555
|
-
# JoinedStr(expr* values)
|
|
1556
|
-
def visit_JoinedStr(self, n: ast3.JoinedStr) -> Expression:
|
|
1557
|
-
# Each of n.values is a str or FormattedValue; we just concatenate
|
|
1558
|
-
# them all using ''.join.
|
|
1559
|
-
empty_string = StrExpr("")
|
|
1560
|
-
empty_string.set_line(n.lineno, n.col_offset)
|
|
1561
|
-
strs_to_join = ListExpr(self.translate_expr_list(n.values))
|
|
1562
|
-
strs_to_join.set_line(empty_string)
|
|
1563
|
-
# Don't make unnecessary join call if there is only one str to join
|
|
1564
|
-
if len(strs_to_join.items) == 1:
|
|
1565
|
-
return self.set_line(strs_to_join.items[0], n)
|
|
1566
|
-
elif len(strs_to_join.items) > 1:
|
|
1567
|
-
last = strs_to_join.items[-1]
|
|
1568
|
-
if isinstance(last, StrExpr) and last.value == "":
|
|
1569
|
-
# 3.12 can add an empty literal at the end. Delete it for consistency
|
|
1570
|
-
# between Python versions.
|
|
1571
|
-
del strs_to_join.items[-1:]
|
|
1572
|
-
join_method = MemberExpr(empty_string, "join")
|
|
1573
|
-
join_method.set_line(empty_string)
|
|
1574
|
-
result_expression = CallExpr(join_method, [strs_to_join], [ARG_POS], [None])
|
|
1575
|
-
return self.set_line(result_expression, n)
|
|
1576
|
-
|
|
1577
|
-
# FormattedValue(expr value)
|
|
1578
|
-
def visit_FormattedValue(self, n: ast3.FormattedValue) -> Expression:
|
|
1579
|
-
# A FormattedValue is a component of a JoinedStr, or it can exist
|
|
1580
|
-
# on its own. We translate them to individual '{}'.format(value)
|
|
1581
|
-
# calls. Format specifier and conversion information is passed along
|
|
1582
|
-
# to allow mypyc to support f-strings with format specifiers and conversions.
|
|
1583
|
-
val_exp = self.visit(n.value)
|
|
1584
|
-
val_exp.set_line(n.lineno, n.col_offset)
|
|
1585
|
-
conv_str = "" if n.conversion < 0 else "!" + chr(n.conversion)
|
|
1586
|
-
format_string = StrExpr("{" + conv_str + ":{}}")
|
|
1587
|
-
format_spec_exp = self.visit(n.format_spec) if n.format_spec is not None else StrExpr("")
|
|
1588
|
-
format_string.set_line(n.lineno, n.col_offset)
|
|
1589
|
-
format_method = MemberExpr(format_string, "format")
|
|
1590
|
-
format_method.set_line(format_string)
|
|
1591
|
-
result_expression = CallExpr(
|
|
1592
|
-
format_method, [val_exp, format_spec_exp], [ARG_POS, ARG_POS], [None, None]
|
|
1593
|
-
)
|
|
1594
|
-
return self.set_line(result_expression, n)
|
|
1595
|
-
|
|
1596
|
-
# Attribute(expr value, identifier attr, expr_context ctx)
|
|
1597
|
-
def visit_Attribute(self, n: Attribute) -> MemberExpr | SuperExpr:
|
|
1598
|
-
value = n.value
|
|
1599
|
-
member_expr = MemberExpr(self.visit(value), n.attr)
|
|
1600
|
-
obj = member_expr.expr
|
|
1601
|
-
if (
|
|
1602
|
-
isinstance(obj, CallExpr)
|
|
1603
|
-
and isinstance(obj.callee, NameExpr)
|
|
1604
|
-
and obj.callee.name == "super"
|
|
1605
|
-
):
|
|
1606
|
-
e: MemberExpr | SuperExpr = SuperExpr(member_expr.name, obj)
|
|
1607
|
-
else:
|
|
1608
|
-
e = member_expr
|
|
1609
|
-
return self.set_line(e, n)
|
|
1610
|
-
|
|
1611
|
-
# Subscript(expr value, slice slice, expr_context ctx)
|
|
1612
|
-
def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:
|
|
1613
|
-
e = IndexExpr(self.visit(n.value), self.visit(n.slice))
|
|
1614
|
-
self.set_line(e, n)
|
|
1615
|
-
# alias to please mypyc
|
|
1616
|
-
is_py38_or_earlier = sys.version_info < (3, 9)
|
|
1617
|
-
if isinstance(n.slice, ast3.Slice) or (
|
|
1618
|
-
is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice)
|
|
1619
|
-
):
|
|
1620
|
-
# Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility
|
|
1621
|
-
# visit_Slice doesn't set_line, even in Python 3.9 on.
|
|
1622
|
-
# ExtSlice also has no line/column info. In Python 3.9 on, line/column is set for
|
|
1623
|
-
# e.index when visiting n.slice.
|
|
1624
|
-
e.index.line = e.line
|
|
1625
|
-
e.index.column = e.column
|
|
1626
|
-
return e
|
|
1627
|
-
|
|
1628
|
-
# Starred(expr value, expr_context ctx)
|
|
1629
|
-
def visit_Starred(self, n: Starred) -> StarExpr:
|
|
1630
|
-
e = StarExpr(self.visit(n.value))
|
|
1631
|
-
return self.set_line(e, n)
|
|
1632
|
-
|
|
1633
|
-
# Name(identifier id, expr_context ctx)
|
|
1634
|
-
def visit_Name(self, n: Name) -> NameExpr:
|
|
1635
|
-
e = NameExpr(n.id)
|
|
1636
|
-
return self.set_line(e, n)
|
|
1637
|
-
|
|
1638
|
-
# List(expr* elts, expr_context ctx)
|
|
1639
|
-
def visit_List(self, n: ast3.List) -> ListExpr | TupleExpr:
|
|
1640
|
-
expr_list: list[Expression] = [self.visit(e) for e in n.elts]
|
|
1641
|
-
if isinstance(n.ctx, ast3.Store):
|
|
1642
|
-
# [x, y] = z and (x, y) = z means exactly the same thing
|
|
1643
|
-
e: ListExpr | TupleExpr = TupleExpr(expr_list)
|
|
1644
|
-
else:
|
|
1645
|
-
e = ListExpr(expr_list)
|
|
1646
|
-
return self.set_line(e, n)
|
|
1647
|
-
|
|
1648
|
-
# Tuple(expr* elts, expr_context ctx)
|
|
1649
|
-
def visit_Tuple(self, n: ast3.Tuple) -> TupleExpr:
|
|
1650
|
-
e = TupleExpr(self.translate_expr_list(n.elts))
|
|
1651
|
-
return self.set_line(e, n)
|
|
1652
|
-
|
|
1653
|
-
# --- slice ---
|
|
1654
|
-
|
|
1655
|
-
# Slice(expr? lower, expr? upper, expr? step)
|
|
1656
|
-
def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
|
|
1657
|
-
return SliceExpr(self.visit(n.lower), self.visit(n.upper), self.visit(n.step))
|
|
1658
|
-
|
|
1659
|
-
# ExtSlice(slice* dims)
|
|
1660
|
-
def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
|
|
1661
|
-
# cast for mypyc's benefit on Python 3.9
|
|
1662
|
-
return TupleExpr(self.translate_expr_list(cast(Any, n).dims))
|
|
1663
|
-
|
|
1664
|
-
# Index(expr value)
|
|
1665
|
-
def visit_Index(self, n: Index) -> Node:
|
|
1666
|
-
# cast for mypyc's benefit on Python 3.9
|
|
1667
|
-
value = self.visit(cast(Any, n).value)
|
|
1668
|
-
assert isinstance(value, Node)
|
|
1669
|
-
return value
|
|
1670
|
-
|
|
1671
|
-
# Match(expr subject, match_case* cases) # python 3.10 and later
|
|
1672
|
-
def visit_Match(self, n: Match) -> MatchStmt:
|
|
1673
|
-
node = MatchStmt(
|
|
1674
|
-
self.visit(n.subject),
|
|
1675
|
-
[self.visit(c.pattern) for c in n.cases],
|
|
1676
|
-
[self.visit(c.guard) for c in n.cases],
|
|
1677
|
-
[self.as_required_block(c.body) for c in n.cases],
|
|
1678
|
-
)
|
|
1679
|
-
return self.set_line(node, n)
|
|
1680
|
-
|
|
1681
|
-
def visit_MatchValue(self, n: MatchValue) -> ValuePattern:
|
|
1682
|
-
node = ValuePattern(self.visit(n.value))
|
|
1683
|
-
return self.set_line(node, n)
|
|
1684
|
-
|
|
1685
|
-
def visit_MatchSingleton(self, n: MatchSingleton) -> SingletonPattern:
|
|
1686
|
-
node = SingletonPattern(n.value)
|
|
1687
|
-
return self.set_line(node, n)
|
|
1688
|
-
|
|
1689
|
-
def visit_MatchSequence(self, n: MatchSequence) -> SequencePattern:
|
|
1690
|
-
patterns = [self.visit(p) for p in n.patterns]
|
|
1691
|
-
stars = [p for p in patterns if isinstance(p, StarredPattern)]
|
|
1692
|
-
assert len(stars) < 2
|
|
1693
|
-
|
|
1694
|
-
node = SequencePattern(patterns)
|
|
1695
|
-
return self.set_line(node, n)
|
|
1696
|
-
|
|
1697
|
-
def visit_MatchStar(self, n: MatchStar) -> StarredPattern:
|
|
1698
|
-
if n.name is None:
|
|
1699
|
-
node = StarredPattern(None)
|
|
1700
|
-
else:
|
|
1701
|
-
name = self.set_line(NameExpr(n.name), n)
|
|
1702
|
-
node = StarredPattern(name)
|
|
1703
|
-
|
|
1704
|
-
return self.set_line(node, n)
|
|
1705
|
-
|
|
1706
|
-
def visit_MatchMapping(self, n: MatchMapping) -> MappingPattern:
|
|
1707
|
-
keys = [self.visit(k) for k in n.keys]
|
|
1708
|
-
values = [self.visit(v) for v in n.patterns]
|
|
1709
|
-
|
|
1710
|
-
if n.rest is None:
|
|
1711
|
-
rest = None
|
|
1712
|
-
else:
|
|
1713
|
-
rest = NameExpr(n.rest)
|
|
1714
|
-
|
|
1715
|
-
node = MappingPattern(keys, values, rest)
|
|
1716
|
-
return self.set_line(node, n)
|
|
1717
|
-
|
|
1718
|
-
def visit_MatchClass(self, n: MatchClass) -> ClassPattern:
|
|
1719
|
-
class_ref = self.visit(n.cls)
|
|
1720
|
-
assert isinstance(class_ref, RefExpr)
|
|
1721
|
-
positionals = [self.visit(p) for p in n.patterns]
|
|
1722
|
-
keyword_keys = n.kwd_attrs
|
|
1723
|
-
keyword_values = [self.visit(p) for p in n.kwd_patterns]
|
|
1724
|
-
|
|
1725
|
-
node = ClassPattern(class_ref, positionals, keyword_keys, keyword_values)
|
|
1726
|
-
return self.set_line(node, n)
|
|
1727
|
-
|
|
1728
|
-
# MatchAs(expr pattern, identifier name)
|
|
1729
|
-
def visit_MatchAs(self, n: MatchAs) -> AsPattern:
|
|
1730
|
-
if n.name is None:
|
|
1731
|
-
name = None
|
|
1732
|
-
else:
|
|
1733
|
-
name = NameExpr(n.name)
|
|
1734
|
-
name = self.set_line(name, n)
|
|
1735
|
-
node = AsPattern(self.visit(n.pattern), name)
|
|
1736
|
-
return self.set_line(node, n)
|
|
1737
|
-
|
|
1738
|
-
# MatchOr(expr* pattern)
|
|
1739
|
-
def visit_MatchOr(self, n: MatchOr) -> OrPattern:
|
|
1740
|
-
node = OrPattern([self.visit(pattern) for pattern in n.patterns])
|
|
1741
|
-
return self.set_line(node, n)
|
|
1742
|
-
|
|
1743
|
-
def visit_TypeAlias(self, n: ast_TypeAlias) -> AssignmentStmt:
|
|
1744
|
-
self.fail(
|
|
1745
|
-
ErrorMessage("PEP 695 type aliases are not yet supported", code=codes.VALID_TYPE),
|
|
1746
|
-
n.lineno,
|
|
1747
|
-
n.col_offset,
|
|
1748
|
-
blocker=False,
|
|
1749
|
-
)
|
|
1750
|
-
node = AssignmentStmt([NameExpr(n.name.id)], self.visit(n.value))
|
|
1751
|
-
return self.set_line(node, n)
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
class TypeConverter:
|
|
1755
|
-
def __init__(
|
|
1756
|
-
self,
|
|
1757
|
-
errors: Errors | None,
|
|
1758
|
-
line: int = -1,
|
|
1759
|
-
override_column: int = -1,
|
|
1760
|
-
is_evaluated: bool = True,
|
|
1761
|
-
) -> None:
|
|
1762
|
-
self.errors = errors
|
|
1763
|
-
self.line = line
|
|
1764
|
-
self.override_column = override_column
|
|
1765
|
-
self.node_stack: list[AST] = []
|
|
1766
|
-
self.is_evaluated = is_evaluated
|
|
1767
|
-
|
|
1768
|
-
def convert_column(self, column: int) -> int:
|
|
1769
|
-
"""Apply column override if defined; otherwise return column.
|
|
1770
|
-
|
|
1771
|
-
Column numbers are sometimes incorrect in the AST and the column
|
|
1772
|
-
override can be used to work around that.
|
|
1773
|
-
"""
|
|
1774
|
-
if self.override_column < 0:
|
|
1775
|
-
return column
|
|
1776
|
-
else:
|
|
1777
|
-
return self.override_column
|
|
1778
|
-
|
|
1779
|
-
def invalid_type(self, node: AST, note: str | None = None) -> RawExpressionType:
|
|
1780
|
-
"""Constructs a type representing some expression that normally forms an invalid type.
|
|
1781
|
-
For example, if we see a type hint that says "3 + 4", we would transform that
|
|
1782
|
-
expression into a RawExpressionType.
|
|
1783
|
-
|
|
1784
|
-
The semantic analysis layer will report an "Invalid type" error when it
|
|
1785
|
-
encounters this type, along with the given note if one is provided.
|
|
1786
|
-
|
|
1787
|
-
See RawExpressionType's docstring for more details on how it's used.
|
|
1788
|
-
"""
|
|
1789
|
-
return RawExpressionType(
|
|
1790
|
-
None, "typing.Any", line=self.line, column=getattr(node, "col_offset", -1), note=note
|
|
1791
|
-
)
|
|
1792
|
-
|
|
1793
|
-
@overload
|
|
1794
|
-
def visit(self, node: ast3.expr) -> ProperType: ...
|
|
1795
|
-
|
|
1796
|
-
@overload
|
|
1797
|
-
def visit(self, node: AST | None) -> ProperType | None: ...
|
|
1798
|
-
|
|
1799
|
-
def visit(self, node: AST | None) -> ProperType | None:
|
|
1800
|
-
"""Modified visit -- keep track of the stack of nodes"""
|
|
1801
|
-
if node is None:
|
|
1802
|
-
return None
|
|
1803
|
-
self.node_stack.append(node)
|
|
1804
|
-
try:
|
|
1805
|
-
method = "visit_" + node.__class__.__name__
|
|
1806
|
-
visitor = getattr(self, method, None)
|
|
1807
|
-
if visitor is not None:
|
|
1808
|
-
typ = visitor(node)
|
|
1809
|
-
assert isinstance(typ, ProperType)
|
|
1810
|
-
return typ
|
|
1811
|
-
else:
|
|
1812
|
-
return self.invalid_type(node)
|
|
1813
|
-
finally:
|
|
1814
|
-
self.node_stack.pop()
|
|
1815
|
-
|
|
1816
|
-
def parent(self) -> AST | None:
|
|
1817
|
-
"""Return the AST node above the one we are processing"""
|
|
1818
|
-
if len(self.node_stack) < 2:
|
|
1819
|
-
return None
|
|
1820
|
-
return self.node_stack[-2]
|
|
1821
|
-
|
|
1822
|
-
def fail(self, msg: ErrorMessage, line: int, column: int) -> None:
|
|
1823
|
-
if self.errors:
|
|
1824
|
-
self.errors.report(line, column, msg.value, blocker=True, code=msg.code)
|
|
1825
|
-
|
|
1826
|
-
def note(self, msg: str, line: int, column: int) -> None:
|
|
1827
|
-
if self.errors:
|
|
1828
|
-
self.errors.report(line, column, msg, severity="note", code=codes.SYNTAX)
|
|
1829
|
-
|
|
1830
|
-
def translate_expr_list(self, l: Sequence[ast3.expr]) -> list[Type]:
|
|
1831
|
-
return [self.visit(e) for e in l]
|
|
1832
|
-
|
|
1833
|
-
def visit_Call(self, e: Call) -> Type:
|
|
1834
|
-
# Parse the arg constructor
|
|
1835
|
-
f = e.func
|
|
1836
|
-
constructor = stringify_name(f)
|
|
1837
|
-
|
|
1838
|
-
if not isinstance(self.parent(), ast3.List):
|
|
1839
|
-
note = None
|
|
1840
|
-
if constructor:
|
|
1841
|
-
note = "Suggestion: use {0}[...] instead of {0}(...)".format(constructor)
|
|
1842
|
-
return self.invalid_type(e, note=note)
|
|
1843
|
-
if not constructor:
|
|
1844
|
-
self.fail(message_registry.ARG_CONSTRUCTOR_NAME_EXPECTED, e.lineno, e.col_offset)
|
|
1845
|
-
|
|
1846
|
-
name: str | None = None
|
|
1847
|
-
default_type = AnyType(TypeOfAny.special_form)
|
|
1848
|
-
typ: Type = default_type
|
|
1849
|
-
for i, arg in enumerate(e.args):
|
|
1850
|
-
if i == 0:
|
|
1851
|
-
converted = self.visit(arg)
|
|
1852
|
-
assert converted is not None
|
|
1853
|
-
typ = converted
|
|
1854
|
-
elif i == 1:
|
|
1855
|
-
name = self._extract_argument_name(arg)
|
|
1856
|
-
else:
|
|
1857
|
-
self.fail(message_registry.ARG_CONSTRUCTOR_TOO_MANY_ARGS, f.lineno, f.col_offset)
|
|
1858
|
-
for k in e.keywords:
|
|
1859
|
-
value = k.value
|
|
1860
|
-
if k.arg == "name":
|
|
1861
|
-
if name is not None:
|
|
1862
|
-
self.fail(
|
|
1863
|
-
message_registry.MULTIPLE_VALUES_FOR_NAME_KWARG.format(constructor),
|
|
1864
|
-
f.lineno,
|
|
1865
|
-
f.col_offset,
|
|
1866
|
-
)
|
|
1867
|
-
name = self._extract_argument_name(value)
|
|
1868
|
-
elif k.arg == "type":
|
|
1869
|
-
if typ is not default_type:
|
|
1870
|
-
self.fail(
|
|
1871
|
-
message_registry.MULTIPLE_VALUES_FOR_TYPE_KWARG.format(constructor),
|
|
1872
|
-
f.lineno,
|
|
1873
|
-
f.col_offset,
|
|
1874
|
-
)
|
|
1875
|
-
converted = self.visit(value)
|
|
1876
|
-
assert converted is not None
|
|
1877
|
-
typ = converted
|
|
1878
|
-
else:
|
|
1879
|
-
self.fail(
|
|
1880
|
-
message_registry.ARG_CONSTRUCTOR_UNEXPECTED_ARG.format(k.arg),
|
|
1881
|
-
value.lineno,
|
|
1882
|
-
value.col_offset,
|
|
1883
|
-
)
|
|
1884
|
-
return CallableArgument(typ, name, constructor, e.lineno, e.col_offset)
|
|
1885
|
-
|
|
1886
|
-
def translate_argument_list(self, l: Sequence[ast3.expr]) -> TypeList:
|
|
1887
|
-
return TypeList([self.visit(e) for e in l], line=self.line)
|
|
1888
|
-
|
|
1889
|
-
def _extract_argument_name(self, n: ast3.expr) -> str | None:
|
|
1890
|
-
if isinstance(n, Constant) and isinstance(n.value, str):
|
|
1891
|
-
return n.value.strip()
|
|
1892
|
-
elif isinstance(n, Constant) and n.value is None:
|
|
1893
|
-
return None
|
|
1894
|
-
self.fail(
|
|
1895
|
-
message_registry.ARG_NAME_EXPECTED_STRING_LITERAL.format(type(n).__name__),
|
|
1896
|
-
self.line,
|
|
1897
|
-
0,
|
|
1898
|
-
)
|
|
1899
|
-
return None
|
|
1900
|
-
|
|
1901
|
-
def visit_Name(self, n: Name) -> Type:
|
|
1902
|
-
return UnboundType(n.id, line=self.line, column=self.convert_column(n.col_offset))
|
|
1903
|
-
|
|
1904
|
-
def visit_BinOp(self, n: ast3.BinOp) -> Type:
|
|
1905
|
-
if not isinstance(n.op, ast3.BitOr):
|
|
1906
|
-
return self.invalid_type(n)
|
|
1907
|
-
|
|
1908
|
-
left = self.visit(n.left)
|
|
1909
|
-
right = self.visit(n.right)
|
|
1910
|
-
return UnionType(
|
|
1911
|
-
[left, right],
|
|
1912
|
-
line=self.line,
|
|
1913
|
-
column=self.convert_column(n.col_offset),
|
|
1914
|
-
is_evaluated=self.is_evaluated,
|
|
1915
|
-
uses_pep604_syntax=True,
|
|
1916
|
-
)
|
|
1917
|
-
|
|
1918
|
-
def visit_Constant(self, n: Constant) -> Type:
|
|
1919
|
-
val = n.value
|
|
1920
|
-
if val is None:
|
|
1921
|
-
# None is a type.
|
|
1922
|
-
return UnboundType("None", line=self.line)
|
|
1923
|
-
if isinstance(val, str):
|
|
1924
|
-
# Parse forward reference.
|
|
1925
|
-
return parse_type_string(val, "builtins.str", self.line, n.col_offset)
|
|
1926
|
-
if val is Ellipsis:
|
|
1927
|
-
# '...' is valid in some types.
|
|
1928
|
-
return EllipsisType(line=self.line)
|
|
1929
|
-
if isinstance(val, bool):
|
|
1930
|
-
# Special case for True/False.
|
|
1931
|
-
return RawExpressionType(val, "builtins.bool", line=self.line)
|
|
1932
|
-
if isinstance(val, (int, float, complex)):
|
|
1933
|
-
return self.numeric_type(val, n)
|
|
1934
|
-
if isinstance(val, bytes):
|
|
1935
|
-
contents = bytes_to_human_readable_repr(val)
|
|
1936
|
-
return RawExpressionType(contents, "builtins.bytes", self.line, column=n.col_offset)
|
|
1937
|
-
# Everything else is invalid.
|
|
1938
|
-
return self.invalid_type(n)
|
|
1939
|
-
|
|
1940
|
-
# UnaryOp(op, operand)
|
|
1941
|
-
def visit_UnaryOp(self, n: UnaryOp) -> Type:
|
|
1942
|
-
# We support specifically Literal[-4], Literal[+4], and nothing else.
|
|
1943
|
-
# For example, Literal[~6] or Literal[not False] is not supported.
|
|
1944
|
-
typ = self.visit(n.operand)
|
|
1945
|
-
if (
|
|
1946
|
-
isinstance(typ, RawExpressionType)
|
|
1947
|
-
# Use type() because we do not want to allow bools.
|
|
1948
|
-
and type(typ.literal_value) is int # noqa: E721
|
|
1949
|
-
):
|
|
1950
|
-
if isinstance(n.op, USub):
|
|
1951
|
-
typ.literal_value *= -1
|
|
1952
|
-
return typ
|
|
1953
|
-
if isinstance(n.op, UAdd):
|
|
1954
|
-
return typ
|
|
1955
|
-
return self.invalid_type(n)
|
|
1956
|
-
|
|
1957
|
-
def numeric_type(self, value: object, n: AST) -> Type:
|
|
1958
|
-
# The node's field has the type complex, but complex isn't *really*
|
|
1959
|
-
# a parent of int and float, and this causes isinstance below
|
|
1960
|
-
# to think that the complex branch is always picked. Avoid
|
|
1961
|
-
# this by throwing away the type.
|
|
1962
|
-
if isinstance(value, int):
|
|
1963
|
-
numeric_value: int | None = value
|
|
1964
|
-
type_name = "builtins.int"
|
|
1965
|
-
else:
|
|
1966
|
-
# Other kinds of numbers (floats, complex) are not valid parameters for
|
|
1967
|
-
# RawExpressionType so we just pass in 'None' for now. We'll report the
|
|
1968
|
-
# appropriate error at a later stage.
|
|
1969
|
-
numeric_value = None
|
|
1970
|
-
type_name = f"builtins.{type(value).__name__}"
|
|
1971
|
-
return RawExpressionType(
|
|
1972
|
-
numeric_value, type_name, line=self.line, column=getattr(n, "col_offset", -1)
|
|
1973
|
-
)
|
|
1974
|
-
|
|
1975
|
-
def visit_Index(self, n: ast3.Index) -> Type:
|
|
1976
|
-
# cast for mypyc's benefit on Python 3.9
|
|
1977
|
-
value = self.visit(cast(Any, n).value)
|
|
1978
|
-
assert isinstance(value, Type)
|
|
1979
|
-
return value
|
|
1980
|
-
|
|
1981
|
-
def visit_Slice(self, n: ast3.Slice) -> Type:
|
|
1982
|
-
return self.invalid_type(n, note="did you mean to use ',' instead of ':' ?")
|
|
1983
|
-
|
|
1984
|
-
# Subscript(expr value, slice slice, expr_context ctx) # Python 3.8 and before
|
|
1985
|
-
# Subscript(expr value, expr slice, expr_context ctx) # Python 3.9 and later
|
|
1986
|
-
def visit_Subscript(self, n: ast3.Subscript) -> Type:
|
|
1987
|
-
if sys.version_info >= (3, 9): # Really 3.9a5 or later
|
|
1988
|
-
sliceval: Any = n.slice
|
|
1989
|
-
# Python 3.8 or earlier use a different AST structure for subscripts
|
|
1990
|
-
elif isinstance(n.slice, ast3.Index):
|
|
1991
|
-
sliceval: Any = n.slice.value
|
|
1992
|
-
elif isinstance(n.slice, ast3.Slice):
|
|
1993
|
-
sliceval = copy.deepcopy(n.slice) # so we don't mutate passed AST
|
|
1994
|
-
if getattr(sliceval, "col_offset", None) is None:
|
|
1995
|
-
# Fix column information so that we get Python 3.9+ message order
|
|
1996
|
-
sliceval.col_offset = sliceval.lower.col_offset
|
|
1997
|
-
else:
|
|
1998
|
-
assert isinstance(n.slice, ast3.ExtSlice)
|
|
1999
|
-
dims = copy.deepcopy(n.slice.dims)
|
|
2000
|
-
for s in dims:
|
|
2001
|
-
if getattr(s, "col_offset", None) is None:
|
|
2002
|
-
if isinstance(s, ast3.Index):
|
|
2003
|
-
s.col_offset = s.value.col_offset
|
|
2004
|
-
elif isinstance(s, ast3.Slice):
|
|
2005
|
-
assert s.lower is not None
|
|
2006
|
-
s.col_offset = s.lower.col_offset
|
|
2007
|
-
sliceval = ast3.Tuple(dims, n.ctx)
|
|
2008
|
-
|
|
2009
|
-
empty_tuple_index = False
|
|
2010
|
-
if isinstance(sliceval, ast3.Tuple):
|
|
2011
|
-
params = self.translate_expr_list(sliceval.elts)
|
|
2012
|
-
if len(sliceval.elts) == 0:
|
|
2013
|
-
empty_tuple_index = True
|
|
2014
|
-
else:
|
|
2015
|
-
params = [self.visit(sliceval)]
|
|
2016
|
-
|
|
2017
|
-
value = self.visit(n.value)
|
|
2018
|
-
if isinstance(value, UnboundType) and not value.args:
|
|
2019
|
-
return UnboundType(
|
|
2020
|
-
value.name,
|
|
2021
|
-
params,
|
|
2022
|
-
line=self.line,
|
|
2023
|
-
column=value.column,
|
|
2024
|
-
empty_tuple_index=empty_tuple_index,
|
|
2025
|
-
)
|
|
2026
|
-
else:
|
|
2027
|
-
return self.invalid_type(n)
|
|
2028
|
-
|
|
2029
|
-
def visit_Tuple(self, n: ast3.Tuple) -> Type:
|
|
2030
|
-
return TupleType(
|
|
2031
|
-
self.translate_expr_list(n.elts),
|
|
2032
|
-
_dummy_fallback,
|
|
2033
|
-
implicit=True,
|
|
2034
|
-
line=self.line,
|
|
2035
|
-
column=self.convert_column(n.col_offset),
|
|
2036
|
-
)
|
|
2037
|
-
|
|
2038
|
-
# Attribute(expr value, identifier attr, expr_context ctx)
|
|
2039
|
-
def visit_Attribute(self, n: Attribute) -> Type:
|
|
2040
|
-
before_dot = self.visit(n.value)
|
|
2041
|
-
|
|
2042
|
-
if isinstance(before_dot, UnboundType) and not before_dot.args:
|
|
2043
|
-
return UnboundType(f"{before_dot.name}.{n.attr}", line=self.line)
|
|
2044
|
-
else:
|
|
2045
|
-
return self.invalid_type(n)
|
|
2046
|
-
|
|
2047
|
-
# Used for Callable[[X *Ys, Z], R] etc.
|
|
2048
|
-
def visit_Starred(self, n: ast3.Starred) -> Type:
|
|
2049
|
-
return UnpackType(self.visit(n.value), from_star_syntax=True)
|
|
2050
|
-
|
|
2051
|
-
# List(expr* elts, expr_context ctx)
|
|
2052
|
-
def visit_List(self, n: ast3.List) -> Type:
|
|
2053
|
-
assert isinstance(n.ctx, ast3.Load)
|
|
2054
|
-
result = self.translate_argument_list(n.elts)
|
|
2055
|
-
return result
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
def stringify_name(n: AST) -> str | None:
|
|
2059
|
-
if isinstance(n, Name):
|
|
2060
|
-
return n.id
|
|
2061
|
-
elif isinstance(n, Attribute):
|
|
2062
|
-
sv = stringify_name(n.value)
|
|
2063
|
-
if sv is not None:
|
|
2064
|
-
return f"{sv}.{n.attr}"
|
|
2065
|
-
return None # Can't do it.
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
class FindAttributeAssign(TraverserVisitor):
|
|
2069
|
-
"""Check if an AST contains attribute assignments (e.g. self.x = 0)."""
|
|
2070
|
-
|
|
2071
|
-
def __init__(self) -> None:
|
|
2072
|
-
self.lvalue = False
|
|
2073
|
-
self.found = False
|
|
2074
|
-
|
|
2075
|
-
def visit_assignment_stmt(self, s: AssignmentStmt) -> None:
|
|
2076
|
-
self.lvalue = True
|
|
2077
|
-
for lv in s.lvalues:
|
|
2078
|
-
lv.accept(self)
|
|
2079
|
-
self.lvalue = False
|
|
2080
|
-
|
|
2081
|
-
def visit_with_stmt(self, s: WithStmt) -> None:
|
|
2082
|
-
self.lvalue = True
|
|
2083
|
-
for lv in s.target:
|
|
2084
|
-
if lv is not None:
|
|
2085
|
-
lv.accept(self)
|
|
2086
|
-
self.lvalue = False
|
|
2087
|
-
s.body.accept(self)
|
|
2088
|
-
|
|
2089
|
-
def visit_for_stmt(self, s: ForStmt) -> None:
|
|
2090
|
-
self.lvalue = True
|
|
2091
|
-
s.index.accept(self)
|
|
2092
|
-
self.lvalue = False
|
|
2093
|
-
s.body.accept(self)
|
|
2094
|
-
if s.else_body:
|
|
2095
|
-
s.else_body.accept(self)
|
|
2096
|
-
|
|
2097
|
-
def visit_expression_stmt(self, s: ExpressionStmt) -> None:
|
|
2098
|
-
# No need to look inside these
|
|
2099
|
-
pass
|
|
2100
|
-
|
|
2101
|
-
def visit_call_expr(self, e: CallExpr) -> None:
|
|
2102
|
-
# No need to look inside these
|
|
2103
|
-
pass
|
|
2104
|
-
|
|
2105
|
-
def visit_index_expr(self, e: IndexExpr) -> None:
|
|
2106
|
-
# No need to look inside these
|
|
2107
|
-
pass
|
|
2108
|
-
|
|
2109
|
-
def visit_member_expr(self, e: MemberExpr) -> None:
|
|
2110
|
-
if self.lvalue:
|
|
2111
|
-
self.found = True
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
class FindYield(TraverserVisitor):
|
|
2115
|
-
"""Check if an AST contains yields or yield froms."""
|
|
2116
|
-
|
|
2117
|
-
def __init__(self) -> None:
|
|
2118
|
-
self.found = False
|
|
2119
|
-
|
|
2120
|
-
def visit_yield_expr(self, e: YieldExpr) -> None:
|
|
2121
|
-
self.found = True
|
|
2122
|
-
|
|
2123
|
-
def visit_yield_from_expr(self, e: YieldFromExpr) -> None:
|
|
2124
|
-
self.found = True
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
def is_possible_trivial_body(s: list[Statement]) -> bool:
|
|
2128
|
-
"""Could the statements form a "trivial" function body, such as 'pass'?
|
|
2129
|
-
|
|
2130
|
-
This mimics mypy.semanal.is_trivial_body, but this runs before
|
|
2131
|
-
semantic analysis so some checks must be conservative.
|
|
2132
|
-
"""
|
|
2133
|
-
l = len(s)
|
|
2134
|
-
if l == 0:
|
|
2135
|
-
return False
|
|
2136
|
-
i = 0
|
|
2137
|
-
if isinstance(s[0], ExpressionStmt) and isinstance(s[0].expr, StrExpr):
|
|
2138
|
-
# Skip docstring
|
|
2139
|
-
i += 1
|
|
2140
|
-
if i == l:
|
|
2141
|
-
return True
|
|
2142
|
-
if l > i + 1:
|
|
2143
|
-
return False
|
|
2144
|
-
stmt = s[i]
|
|
2145
|
-
return isinstance(stmt, (PassStmt, RaiseStmt)) or (
|
|
2146
|
-
isinstance(stmt, ExpressionStmt) and isinstance(stmt.expr, EllipsisExpr)
|
|
2147
|
-
)
|