jaclang 0.7.34__py3-none-any.whl → 0.8.1__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 +316 -217
- 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 +65 -106
- jaclang/compiler/larkparse/jac_parser.py +3444 -0
- jaclang/compiler/parser.py +1137 -1517
- 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 +159 -114
- jaclang/compiler/passes/main/def_use_pass.py +66 -274
- jaclang/compiler/passes/main/import_pass.py +178 -363
- jaclang/compiler/passes/main/inheritance_pass.py +109 -107
- jaclang/compiler/passes/main/pyast_gen_pass.py +1242 -1735
- jaclang/compiler/passes/main/pyast_load_pass.py +579 -819
- jaclang/compiler/passes/main/pybc_gen_pass.py +38 -35
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +50 -163
- jaclang/compiler/passes/main/sym_tab_build_pass.py +114 -1203
- 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 +19 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/main.jac +7 -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 +101 -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 +1287 -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 +200 -0
- jaclang/compiler/tests/fixtures/codegentext.jac +31 -0
- jaclang/compiler/tests/fixtures/fam.jac +12 -12
- jaclang/compiler/tests/fixtures/hello_world.jac +1 -1
- jaclang/compiler/tests/fixtures/pkg_import_lib/__init__.jac +1 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/sub/__init__.jac +1 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/sub/helper.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/tools.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/__init__.py +11 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/sub/__init__.py +7 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/sub/helper.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/tools.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_main.jac +10 -0
- jaclang/compiler/tests/fixtures/pkg_import_main_py.jac +11 -0
- jaclang/compiler/tests/fixtures/staticcheck.jac +2 -2
- jaclang/compiler/tests/test_importer.py +41 -16
- jaclang/compiler/tests/test_parser.py +39 -17
- jaclang/compiler/{absyntree.py → unitree.py} +1521 -1261
- jaclang/langserve/engine.jac +498 -0
- jaclang/langserve/sem_manager.jac +309 -0
- jaclang/langserve/server.jac +186 -0
- 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 +261 -0
- jaclang/langserve/tests/server_test/utils.py +118 -0
- jaclang/langserve/tests/session.jac +294 -0
- jaclang/langserve/tests/test_sem_tokens.py +4 -4
- jaclang/langserve/tests/test_server.py +53 -30
- jaclang/langserve/utils.jac +459 -0
- jaclang/runtimelib/{architype.py → archetype.py} +86 -62
- jaclang/runtimelib/builtin.py +95 -0
- jaclang/runtimelib/constructs.py +11 -13
- jaclang/runtimelib/importer.py +83 -53
- jaclang/runtimelib/machine.py +1592 -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/{plugin → runtimelib}/tests/fixtures/traversing_save.jac +7 -5
- jaclang/runtimelib/tests/test_features.py +72 -0
- jaclang/{plugin → runtimelib}/tests/test_jaseci.py +6 -5
- jaclang/runtimelib/utils.py +34 -66
- 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/backward_edge_visit.jac +31 -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_printgraph.jac +85 -0
- jaclang/tests/fixtures/builtin_printgraph_json.jac +21 -0
- jaclang/tests/fixtures/builtin_printgraph_mermaid.jac +16 -0
- jaclang/tests/fixtures/byllmissue.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs2.jac +21 -14
- 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_ability.jac +49 -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 +6 -6
- 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/here_usage_error.jac +21 -0
- jaclang/tests/fixtures/here_visitor_usage.jac +21 -0
- 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 +54 -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/visit_traversal.jac +47 -0
- 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 +127 -227
- jaclang/tests/test_language.py +542 -474
- 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 +24 -31
- jaclang/utils/lang_tools.py +84 -75
- jaclang/utils/module_resolver.py +69 -0
- jaclang/utils/test.py +8 -5
- jaclang/utils/tests/test_lang_tools.py +40 -14
- jaclang/utils/treeprinter.py +178 -42
- 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.1.dist-info}/METADATA +2 -1
- jaclang-0.8.1.dist-info/RECORD +568 -0
- {jaclang-0.7.34.dist-info → jaclang-0.8.1.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/engine.py +0 -541
- jaclang/langserve/sem_manager.py +0 -379
- jaclang/langserve/server.py +0 -176
- jaclang/langserve/tests/session.py +0 -255
- 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/builtin_dotgen.jac +0 -42
- 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/langserve/{__init__.py → __init__.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/{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.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,92 +1,84 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Python AST to Jac AST Conversion Pass for the Jac compiler.
|
|
2
|
+
|
|
3
|
+
This pass transforms Python AST nodes into equivalent Jac AST nodes by:
|
|
4
|
+
|
|
5
|
+
1. Converting Python modules, classes, functions, and expressions to their Jac equivalents
|
|
6
|
+
2. Preserving source location information and symbol relationships
|
|
7
|
+
3. Handling Python-specific constructs and adapting them to Jac's object model
|
|
8
|
+
4. Supporting both standard Python modules and type stub (.pyi) files
|
|
9
|
+
5. Creating appropriate symbol tables and scopes for the converted nodes
|
|
10
|
+
|
|
11
|
+
This pass is crucial for Python interoperability, allowing Python code to be imported
|
|
12
|
+
and used within Jac programs while maintaining type information and semantic relationships.
|
|
13
|
+
"""
|
|
2
14
|
|
|
3
15
|
from __future__ import annotations
|
|
4
16
|
|
|
5
17
|
import ast as py_ast
|
|
6
18
|
import os
|
|
7
|
-
from typing import Optional, Sequence, TypeAlias, TypeVar
|
|
19
|
+
from typing import Optional, Sequence, TYPE_CHECKING, TypeAlias, TypeVar
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import jaclang.compiler.absyntree as ast
|
|
21
|
+
import jaclang.compiler.unitree as uni
|
|
12
22
|
from jaclang.compiler.constant import Tokens as Tok
|
|
13
|
-
from jaclang.compiler.passes.
|
|
23
|
+
from jaclang.compiler.passes.uni_pass import Transform
|
|
14
24
|
from jaclang.utils.helpers import pascal_to_snake
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
if TYPE_CHECKING:
|
|
27
|
+
from jaclang.compiler.program import JacProgram
|
|
28
|
+
|
|
29
|
+
T = TypeVar("T", bound=uni.UniNode)
|
|
17
30
|
|
|
18
31
|
|
|
19
|
-
class PyastBuildPass(
|
|
32
|
+
class PyastBuildPass(Transform[uni.PythonModuleAst, uni.Module]):
|
|
20
33
|
"""Jac Parser."""
|
|
21
34
|
|
|
22
|
-
def __init__(self,
|
|
35
|
+
def __init__(self, ir_in: uni.PythonModuleAst, prog: JacProgram) -> None:
|
|
23
36
|
"""Initialize parser."""
|
|
24
|
-
self.mod_path =
|
|
25
|
-
self.orig_src =
|
|
26
|
-
|
|
37
|
+
self.mod_path = ir_in.loc.mod_path
|
|
38
|
+
self.orig_src = ir_in.loc.orig_src
|
|
39
|
+
Transform.__init__(self, ir_in=ir_in, prog=prog)
|
|
27
40
|
|
|
28
41
|
def nu(self, node: T) -> T:
|
|
29
42
|
"""Update node."""
|
|
30
43
|
self.cur_node = node
|
|
31
44
|
return node
|
|
32
45
|
|
|
33
|
-
def
|
|
34
|
-
"""Print python node."""
|
|
35
|
-
# print(
|
|
36
|
-
# f"{node.__class__.__name__} - {[(k, type(v)) for k, v in vars(node).items()]}"
|
|
37
|
-
# )
|
|
38
|
-
|
|
39
|
-
def convert(self, node: py_ast.AST) -> ast.AstNode:
|
|
46
|
+
def convert(self, node: py_ast.AST) -> uni.UniNode:
|
|
40
47
|
"""Get python node type."""
|
|
41
|
-
# print(
|
|
42
|
-
# f"working on {type(node).__name__} line {node.lineno if hasattr(node, 'lineno') else 0}"
|
|
43
|
-
# )
|
|
44
48
|
if hasattr(self, f"proc_{pascal_to_snake(type(node).__name__)}"):
|
|
45
49
|
ret = getattr(self, f"proc_{pascal_to_snake(type(node).__name__)}")(node)
|
|
46
50
|
else:
|
|
47
51
|
raise self.ice(f"Unknown node type {type(node).__name__}")
|
|
48
|
-
# print(f"finshed {type(node).__name__} ---------------------")
|
|
49
|
-
# print("normalizing", ret.__class__.__name__)
|
|
50
|
-
# ic("normalizing", ret.__class__.__name__)
|
|
51
|
-
# print(ret.unparse())
|
|
52
|
-
# ret.unparse()
|
|
53
52
|
return ret
|
|
54
53
|
|
|
55
|
-
def transform(self,
|
|
54
|
+
def transform(self, ir_in: uni.PythonModuleAst) -> uni.Module:
|
|
56
55
|
"""Transform input IR."""
|
|
57
|
-
self.
|
|
58
|
-
return self.
|
|
56
|
+
self.ir_out: uni.Module = self.proc_module(ir_in.ast)
|
|
57
|
+
return self.ir_out
|
|
59
58
|
|
|
60
59
|
def extract_with_entry(
|
|
61
|
-
self, body: list[
|
|
62
|
-
) -> list[T |
|
|
60
|
+
self, body: list[uni.UniNode], exclude_types: TypeAlias = T
|
|
61
|
+
) -> list[T | uni.ModuleCode]:
|
|
63
62
|
"""Extract with entry from a body."""
|
|
64
63
|
|
|
65
|
-
def gen_mod_code(with_entry_body: list[
|
|
66
|
-
|
|
67
|
-
items=with_entry_body,
|
|
68
|
-
delim=Tok.WS,
|
|
69
|
-
kid=with_entry_body,
|
|
70
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
71
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
72
|
-
)
|
|
73
|
-
return ast.ModuleCode(
|
|
64
|
+
def gen_mod_code(with_entry_body: list[uni.CodeBlockStmt]) -> uni.ModuleCode:
|
|
65
|
+
return uni.ModuleCode(
|
|
74
66
|
name=None,
|
|
75
|
-
body=
|
|
76
|
-
kid=
|
|
67
|
+
body=with_entry_body,
|
|
68
|
+
kid=with_entry_body,
|
|
77
69
|
doc=None,
|
|
78
70
|
)
|
|
79
71
|
|
|
80
|
-
extracted: list[T |
|
|
81
|
-
with_entry_body: list[
|
|
72
|
+
extracted: list[T | uni.ModuleCode] = []
|
|
73
|
+
with_entry_body: list[uni.CodeBlockStmt] = []
|
|
82
74
|
for i in body:
|
|
83
75
|
if isinstance(i, exclude_types):
|
|
84
76
|
if len(with_entry_body):
|
|
85
77
|
extracted.append(gen_mod_code(with_entry_body))
|
|
86
78
|
with_entry_body = []
|
|
87
79
|
extracted.append(i)
|
|
88
|
-
elif isinstance(i,
|
|
89
|
-
if isinstance(i,
|
|
80
|
+
elif isinstance(i, uni.CodeBlockStmt):
|
|
81
|
+
if isinstance(i, uni.ExprStmt) and isinstance(i.expr, uni.String):
|
|
90
82
|
self.convert_to_doc(i.expr)
|
|
91
83
|
with_entry_body.append(i)
|
|
92
84
|
else:
|
|
@@ -96,7 +88,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
96
88
|
extracted.append(gen_mod_code(with_entry_body))
|
|
97
89
|
return extracted
|
|
98
90
|
|
|
99
|
-
def proc_module(self, node: py_ast.Module) ->
|
|
91
|
+
def proc_module(self, node: py_ast.Module) -> uni.Module:
|
|
100
92
|
"""Process python node.
|
|
101
93
|
|
|
102
94
|
class Module(mod):
|
|
@@ -104,37 +96,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
104
96
|
body: list[stmt]
|
|
105
97
|
type_ignores: list[TypeIgnore]
|
|
106
98
|
"""
|
|
107
|
-
elements: list[
|
|
99
|
+
elements: list[uni.UniNode] = [self.convert(i) for i in node.body]
|
|
108
100
|
elements[0] = (
|
|
109
101
|
elements[0].expr
|
|
110
|
-
if isinstance(elements[0],
|
|
111
|
-
and isinstance(elements[0].expr,
|
|
102
|
+
if isinstance(elements[0], uni.ExprStmt)
|
|
103
|
+
and isinstance(elements[0].expr, uni.String)
|
|
112
104
|
else elements[0]
|
|
113
105
|
)
|
|
114
|
-
doc_str_list = [elements[0]] if isinstance(elements[0],
|
|
106
|
+
doc_str_list = [elements[0]] if isinstance(elements[0], uni.String) else []
|
|
115
107
|
valid = (
|
|
116
108
|
(doc_str_list)
|
|
117
|
-
+ self.extract_with_entry(elements[1:], (
|
|
109
|
+
+ self.extract_with_entry(elements[1:], (uni.ElementStmt, uni.EmptyToken))
|
|
118
110
|
if doc_str_list
|
|
119
|
-
else self.extract_with_entry(elements[:], (
|
|
111
|
+
else self.extract_with_entry(elements[:], (uni.ElementStmt, uni.EmptyToken))
|
|
120
112
|
)
|
|
121
|
-
doc_str = elements[0] if isinstance(elements[0],
|
|
113
|
+
doc_str = elements[0] if isinstance(elements[0], uni.String) else None
|
|
122
114
|
self.convert_to_doc(doc_str) if doc_str else None
|
|
123
|
-
ret =
|
|
115
|
+
ret = uni.Module(
|
|
124
116
|
name=self.mod_path.split(os.path.sep)[-1].split(".")[0],
|
|
125
|
-
source=
|
|
117
|
+
source=uni.Source("", mod_path=self.mod_path),
|
|
126
118
|
doc=doc_str,
|
|
127
|
-
body=valid[1:] if valid and isinstance(valid[0],
|
|
119
|
+
body=valid[1:] if valid and isinstance(valid[0], uni.String) else valid,
|
|
128
120
|
terminals=[],
|
|
129
|
-
is_imported=False,
|
|
130
121
|
kid=valid,
|
|
131
122
|
)
|
|
132
|
-
ret.
|
|
123
|
+
ret.is_raised_from_py = True
|
|
133
124
|
return self.nu(ret)
|
|
134
125
|
|
|
135
126
|
def proc_function_def(
|
|
136
127
|
self, node: py_ast.FunctionDef | py_ast.AsyncFunctionDef
|
|
137
|
-
) ->
|
|
128
|
+
) -> uni.Ability:
|
|
138
129
|
"""Process python node.
|
|
139
130
|
|
|
140
131
|
class FunctionDef(stmt):
|
|
@@ -151,7 +142,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
151
142
|
reserved_keywords = [v for _, v in TOKEN_MAP.items()]
|
|
152
143
|
|
|
153
144
|
value = node.name if node.name not in reserved_keywords else f"<>{node.name}"
|
|
154
|
-
name =
|
|
145
|
+
name = uni.Name(
|
|
155
146
|
orig_src=self.orig_src,
|
|
156
147
|
name=Tok.NAME,
|
|
157
148
|
value=value,
|
|
@@ -163,61 +154,43 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
163
154
|
pos_end=0,
|
|
164
155
|
)
|
|
165
156
|
body = [self.convert(i) for i in node.body]
|
|
166
|
-
valid = [i for i in body if isinstance(i, (
|
|
157
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
167
158
|
if len(valid) != len(body):
|
|
168
159
|
raise self.ice("Length mismatch in function body")
|
|
169
160
|
|
|
170
161
|
if (
|
|
171
162
|
len(valid)
|
|
172
|
-
and isinstance(valid[0],
|
|
173
|
-
and isinstance(valid[0].expr,
|
|
163
|
+
and isinstance(valid[0], uni.ExprStmt)
|
|
164
|
+
and isinstance(valid[0].expr, uni.String)
|
|
174
165
|
):
|
|
175
166
|
self.convert_to_doc(valid[0].expr)
|
|
176
|
-
doc = valid[0]
|
|
177
|
-
valid_body =
|
|
178
|
-
items=[doc] + valid[1:],
|
|
179
|
-
delim=Tok.WS,
|
|
180
|
-
kid=valid[1:] + [doc],
|
|
181
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
182
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
183
|
-
)
|
|
167
|
+
doc = valid[0].expr
|
|
168
|
+
valid_body = valid[1:]
|
|
184
169
|
else:
|
|
185
170
|
doc = None
|
|
186
|
-
valid_body =
|
|
187
|
-
items=valid,
|
|
188
|
-
delim=Tok.WS,
|
|
189
|
-
kid=valid,
|
|
190
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
191
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
192
|
-
)
|
|
171
|
+
valid_body = valid
|
|
193
172
|
decorators = [self.convert(i) for i in node.decorator_list]
|
|
194
|
-
valid_dec = [i for i in decorators if isinstance(i,
|
|
173
|
+
valid_dec = [i for i in decorators if isinstance(i, uni.Expr)]
|
|
195
174
|
if len(valid_dec) != len(decorators):
|
|
196
175
|
raise self.ice("Length mismatch in decorators on function")
|
|
197
|
-
valid_decorators =
|
|
198
|
-
ast.SubNodeList[ast.Expr](
|
|
199
|
-
items=valid_dec, delim=Tok.DECOR_OP, kid=decorators
|
|
200
|
-
)
|
|
201
|
-
if len(valid_dec)
|
|
202
|
-
else None
|
|
203
|
-
)
|
|
176
|
+
valid_decorators = valid_dec if valid_dec else None
|
|
204
177
|
res = self.convert(node.args)
|
|
205
|
-
sig: Optional[
|
|
206
|
-
res if isinstance(res,
|
|
178
|
+
sig: Optional[uni.FuncSignature] = (
|
|
179
|
+
res if isinstance(res, uni.FuncSignature) else None
|
|
207
180
|
)
|
|
208
181
|
ret_sig = self.convert(node.returns) if node.returns else None
|
|
209
|
-
if isinstance(ret_sig,
|
|
182
|
+
if isinstance(ret_sig, uni.Expr):
|
|
210
183
|
if not sig:
|
|
211
|
-
sig =
|
|
184
|
+
sig = uni.FuncSignature(params=[], return_type=ret_sig, kid=[ret_sig])
|
|
212
185
|
else:
|
|
213
186
|
sig.return_type = ret_sig
|
|
214
187
|
sig.add_kids_right([sig.return_type])
|
|
215
188
|
kid = ([doc] if doc else []) + (
|
|
216
|
-
[name, sig, valid_body] if sig else [name, valid_body]
|
|
189
|
+
[name, sig, *valid_body] if sig else [name, *valid_body]
|
|
217
190
|
)
|
|
218
191
|
if not sig:
|
|
219
192
|
raise self.ice("Function signature not found")
|
|
220
|
-
ret =
|
|
193
|
+
ret = uni.Ability(
|
|
221
194
|
name_ref=name,
|
|
222
195
|
is_async=False,
|
|
223
196
|
is_static=False,
|
|
@@ -227,12 +200,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
227
200
|
signature=sig,
|
|
228
201
|
body=valid_body,
|
|
229
202
|
decorators=valid_decorators,
|
|
230
|
-
doc=
|
|
203
|
+
doc=doc,
|
|
231
204
|
kid=kid,
|
|
232
205
|
)
|
|
233
206
|
return ret
|
|
234
207
|
|
|
235
|
-
def proc_async_function_def(self, node: py_ast.AsyncFunctionDef) ->
|
|
208
|
+
def proc_async_function_def(self, node: py_ast.AsyncFunctionDef) -> uni.Ability:
|
|
236
209
|
"""Process python node.
|
|
237
210
|
|
|
238
211
|
class AsyncFunctionDef(stmt):
|
|
@@ -250,7 +223,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
250
223
|
ability.is_async = True
|
|
251
224
|
return ability
|
|
252
225
|
|
|
253
|
-
def proc_class_def(self, node: py_ast.ClassDef) ->
|
|
226
|
+
def proc_class_def(self, node: py_ast.ClassDef) -> uni.Archetype | uni.Enum:
|
|
254
227
|
"""Process python node.
|
|
255
228
|
|
|
256
229
|
class ClassDef(stmt):
|
|
@@ -264,7 +237,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
264
237
|
if sys.version_info >= (3, 12):
|
|
265
238
|
type_params: list[type_param]
|
|
266
239
|
"""
|
|
267
|
-
name =
|
|
240
|
+
name = uni.Name(
|
|
268
241
|
orig_src=self.orig_src,
|
|
269
242
|
name=Tok.NAME,
|
|
270
243
|
value=node.name,
|
|
@@ -275,7 +248,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
275
248
|
pos_start=0,
|
|
276
249
|
pos_end=0,
|
|
277
250
|
)
|
|
278
|
-
arch_type =
|
|
251
|
+
arch_type = uni.Token(
|
|
279
252
|
orig_src=self.orig_src,
|
|
280
253
|
name=Tok.KW_CLASS,
|
|
281
254
|
value="class",
|
|
@@ -289,11 +262,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
289
262
|
body = [self.convert(i) for i in node.body]
|
|
290
263
|
for body_stmt in body:
|
|
291
264
|
if (
|
|
292
|
-
isinstance(body_stmt,
|
|
293
|
-
and isinstance(body_stmt.name_ref,
|
|
265
|
+
isinstance(body_stmt, uni.Ability)
|
|
266
|
+
and isinstance(body_stmt.name_ref, uni.Name)
|
|
294
267
|
and body_stmt.name_ref.value == "__init__"
|
|
295
268
|
):
|
|
296
|
-
tok =
|
|
269
|
+
tok = uni.Name(
|
|
297
270
|
orig_src=self.orig_src,
|
|
298
271
|
name=Tok.KW_INIT,
|
|
299
272
|
value="init",
|
|
@@ -304,148 +277,64 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
304
277
|
pos_start=0,
|
|
305
278
|
pos_end=0,
|
|
306
279
|
)
|
|
307
|
-
body_stmt.name_ref =
|
|
280
|
+
body_stmt.name_ref = uni.SpecialVarRef(var=tok)
|
|
308
281
|
if (
|
|
309
|
-
isinstance(body_stmt,
|
|
282
|
+
isinstance(body_stmt, uni.Ability)
|
|
310
283
|
and body_stmt.signature
|
|
311
|
-
and isinstance(body_stmt.signature,
|
|
284
|
+
and isinstance(body_stmt.signature, uni.FuncSignature)
|
|
312
285
|
and body_stmt.signature.params
|
|
313
286
|
):
|
|
314
|
-
body_stmt.signature.params
|
|
315
|
-
param
|
|
316
|
-
|
|
317
|
-
if param.name.value != "self"
|
|
318
|
-
]
|
|
287
|
+
for param in body_stmt.signature.params:
|
|
288
|
+
if param.name.value == "self":
|
|
289
|
+
param.type_tag = uni.SubTag[uni.Expr](name, kid=[name])
|
|
319
290
|
doc = (
|
|
320
291
|
body[0].expr
|
|
321
|
-
if isinstance(body[0],
|
|
322
|
-
and isinstance(body[0].expr,
|
|
292
|
+
if isinstance(body[0], uni.ExprStmt)
|
|
293
|
+
and isinstance(body[0].expr, uni.String)
|
|
323
294
|
else None
|
|
324
295
|
)
|
|
325
296
|
self.convert_to_doc(doc) if doc else None
|
|
326
297
|
body = body[1:] if doc else body
|
|
327
|
-
valid: list[
|
|
328
|
-
self.extract_with_entry(body,
|
|
329
|
-
if body and not (isinstance(body[0],
|
|
298
|
+
valid: list[uni.ArchBlockStmt] = (
|
|
299
|
+
self.extract_with_entry(body, uni.ArchBlockStmt)
|
|
300
|
+
if body and not (isinstance(body[0], uni.Semi) and len(body) == 1)
|
|
330
301
|
else []
|
|
331
302
|
)
|
|
332
|
-
empty_block: Sequence[
|
|
303
|
+
empty_block: Sequence[uni.UniNode] = [
|
|
333
304
|
self.operator(Tok.LBRACE, "{"),
|
|
334
305
|
self.operator(Tok.RBRACE, "}"),
|
|
335
306
|
]
|
|
336
|
-
valid_body =
|
|
337
|
-
items=valid,
|
|
338
|
-
delim=Tok.WS,
|
|
339
|
-
kid=(valid if valid else empty_block),
|
|
340
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
341
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
342
|
-
)
|
|
307
|
+
valid_body = valid if valid else empty_block
|
|
343
308
|
converted_base_classes = [self.convert(base) for base in node.bases]
|
|
344
|
-
base_classes: list[
|
|
345
|
-
base for base in converted_base_classes if isinstance(base,
|
|
309
|
+
base_classes: list[uni.Expr] = [
|
|
310
|
+
base for base in converted_base_classes if isinstance(base, uni.Expr)
|
|
346
311
|
]
|
|
347
|
-
valid_bases = (
|
|
348
|
-
ast.SubNodeList[ast.Expr](
|
|
349
|
-
items=base_classes, delim=Tok.COMMA, kid=base_classes
|
|
350
|
-
)
|
|
351
|
-
if base_classes
|
|
352
|
-
else None
|
|
353
|
-
)
|
|
354
312
|
converted_decorators_list = [self.convert(i) for i in node.decorator_list]
|
|
355
|
-
decorators = [i for i in converted_decorators_list if isinstance(i,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
)
|
|
360
|
-
if decorators
|
|
361
|
-
else None
|
|
362
|
-
)
|
|
363
|
-
if (
|
|
364
|
-
base_classes
|
|
365
|
-
and isinstance(base_classes[0], ast.Name)
|
|
366
|
-
and base_classes[0].value == "Enum"
|
|
367
|
-
):
|
|
368
|
-
if len(base_classes) > 1:
|
|
369
|
-
raise ValueError(
|
|
370
|
-
"Python's Enum class cannot be used with multiple inheritance."
|
|
371
|
-
)
|
|
372
|
-
arch_type.name = Tok.KW_ENUM
|
|
373
|
-
arch_type.value = "enum"
|
|
374
|
-
valid_enum_body: list[ast.EnumBlockStmt] = []
|
|
375
|
-
for class_body_stmt in node.body:
|
|
376
|
-
converted_stmt = self.convert(class_body_stmt)
|
|
377
|
-
if isinstance(converted_stmt, ast.EnumBlockStmt):
|
|
378
|
-
if isinstance(converted_stmt, ast.Assignment):
|
|
379
|
-
converted_stmt.is_enum_stmt = True
|
|
380
|
-
valid_enum_body.append(converted_stmt)
|
|
381
|
-
else:
|
|
382
|
-
if isinstance(converted_stmt, ast.ExprStmt) and isinstance(
|
|
383
|
-
converted_stmt.expr, ast.String
|
|
384
|
-
):
|
|
385
|
-
continue
|
|
386
|
-
pintok = ast.Token(
|
|
387
|
-
orig_src=self.orig_src,
|
|
388
|
-
name=Tok.PYNLINE,
|
|
389
|
-
value=py_ast.unparse(class_body_stmt),
|
|
390
|
-
line=node.lineno,
|
|
391
|
-
end_line=node.end_lineno if node.end_lineno else node.lineno,
|
|
392
|
-
col_start=node.col_offset,
|
|
393
|
-
col_end=node.col_offset + len(py_ast.unparse(class_body_stmt)),
|
|
394
|
-
pos_start=0,
|
|
395
|
-
pos_end=0,
|
|
396
|
-
)
|
|
397
|
-
valid_enum_body.append(ast.PyInlineCode(code=pintok, kid=[pintok]))
|
|
398
|
-
|
|
399
|
-
valid_enum_body2: list[ast.EnumBlockStmt] = [
|
|
400
|
-
i for i in valid_enum_body if isinstance(i, ast.EnumBlockStmt)
|
|
401
|
-
]
|
|
402
|
-
enum_body = (
|
|
403
|
-
ast.SubNodeList[ast.EnumBlockStmt](
|
|
404
|
-
items=valid_enum_body2, delim=Tok.COMMA, kid=valid_enum_body2
|
|
405
|
-
)
|
|
406
|
-
if valid_enum_body2
|
|
407
|
-
else None
|
|
408
|
-
)
|
|
409
|
-
if doc:
|
|
410
|
-
doc.line_no = name.line_no
|
|
411
|
-
return ast.Enum(
|
|
412
|
-
name=name,
|
|
413
|
-
access=None,
|
|
414
|
-
base_classes=None,
|
|
415
|
-
body=enum_body,
|
|
416
|
-
kid=(
|
|
417
|
-
[doc, name, enum_body]
|
|
418
|
-
if doc and enum_body
|
|
419
|
-
else (
|
|
420
|
-
[doc, name]
|
|
421
|
-
if doc
|
|
422
|
-
else [name, enum_body] if enum_body else [name]
|
|
423
|
-
)
|
|
424
|
-
),
|
|
425
|
-
doc=doc,
|
|
426
|
-
decorators=valid_decorators,
|
|
427
|
-
)
|
|
313
|
+
decorators = [i for i in converted_decorators_list if isinstance(i, uni.Expr)]
|
|
314
|
+
if len(decorators) != len(converted_decorators_list):
|
|
315
|
+
raise self.ice("Length mismatch in decorators on class")
|
|
316
|
+
valid_decorators = decorators if decorators else None
|
|
428
317
|
kid = (
|
|
429
|
-
[name,
|
|
430
|
-
if doc and
|
|
318
|
+
[name, *base_classes, *valid_body, doc]
|
|
319
|
+
if doc and base_classes
|
|
431
320
|
else (
|
|
432
|
-
[name,
|
|
433
|
-
if
|
|
434
|
-
else [name, valid_body, doc] if doc else [name, valid_body]
|
|
321
|
+
[name, *base_classes, *valid_body]
|
|
322
|
+
if base_classes
|
|
323
|
+
else [name, *valid_body, doc] if doc else [name, *valid_body]
|
|
435
324
|
)
|
|
436
325
|
)
|
|
437
|
-
return
|
|
326
|
+
return uni.Archetype(
|
|
438
327
|
arch_type=arch_type,
|
|
439
328
|
name=name,
|
|
440
329
|
access=None,
|
|
441
|
-
base_classes=
|
|
442
|
-
body=
|
|
330
|
+
base_classes=base_classes,
|
|
331
|
+
body=valid,
|
|
443
332
|
kid=kid,
|
|
444
333
|
doc=doc,
|
|
445
334
|
decorators=valid_decorators,
|
|
446
335
|
)
|
|
447
336
|
|
|
448
|
-
def proc_return(self, node: py_ast.Return) ->
|
|
337
|
+
def proc_return(self, node: py_ast.Return) -> uni.ReturnStmt | None:
|
|
449
338
|
"""Process python node.
|
|
450
339
|
|
|
451
340
|
class Return(stmt):
|
|
@@ -454,15 +343,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
454
343
|
"""
|
|
455
344
|
value = self.convert(node.value) if node.value else None
|
|
456
345
|
if not value:
|
|
457
|
-
return
|
|
346
|
+
return uni.ReturnStmt(
|
|
458
347
|
expr=None, kid=[self.operator(Tok.KW_RETURN, "return")]
|
|
459
348
|
)
|
|
460
|
-
elif value and isinstance(value,
|
|
461
|
-
return
|
|
349
|
+
elif value and isinstance(value, uni.Expr):
|
|
350
|
+
return uni.ReturnStmt(expr=value, kid=[value])
|
|
462
351
|
else:
|
|
463
352
|
raise self.ice("Invalid return value")
|
|
464
353
|
|
|
465
|
-
def proc_delete(self, node: py_ast.Delete) ->
|
|
354
|
+
def proc_delete(self, node: py_ast.Delete) -> uni.DeleteStmt:
|
|
466
355
|
"""Process python node.
|
|
467
356
|
|
|
468
357
|
class Delete(stmt):
|
|
@@ -470,23 +359,20 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
470
359
|
targets: list[expr]
|
|
471
360
|
"""
|
|
472
361
|
exprs = [self.convert(target) for target in node.targets]
|
|
473
|
-
valid_exprs = [expr for expr in exprs if isinstance(expr,
|
|
362
|
+
valid_exprs = [expr for expr in exprs if isinstance(expr, uni.Expr)]
|
|
474
363
|
if not len(valid_exprs) or len(valid_exprs) != len(exprs):
|
|
475
364
|
raise self.ice("Length mismatch in delete targets")
|
|
476
|
-
target = ast.SubNodeList[ast.Expr | ast.KWPair](
|
|
477
|
-
items=[*valid_exprs], delim=Tok.COMMA, kid=exprs
|
|
478
|
-
)
|
|
479
365
|
target_1 = (
|
|
480
366
|
valid_exprs[0]
|
|
481
367
|
if len(valid_exprs) > 1
|
|
482
|
-
else
|
|
368
|
+
else uni.TupleVal(values=valid_exprs, kid=[*valid_exprs])
|
|
483
369
|
)
|
|
484
|
-
return
|
|
370
|
+
return uni.DeleteStmt(
|
|
485
371
|
target=target_1,
|
|
486
|
-
kid=[
|
|
372
|
+
kid=[*valid_exprs],
|
|
487
373
|
)
|
|
488
374
|
|
|
489
|
-
def proc_assign(self, node: py_ast.Assign) ->
|
|
375
|
+
def proc_assign(self, node: py_ast.Assign) -> uni.Assignment:
|
|
490
376
|
"""Process python node.
|
|
491
377
|
|
|
492
378
|
class Assign(stmt):
|
|
@@ -495,24 +381,20 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
495
381
|
"""
|
|
496
382
|
value = self.convert(node.value)
|
|
497
383
|
targets = [self.convert(target) for target in node.targets]
|
|
498
|
-
valid = [target for target in targets if isinstance(target,
|
|
499
|
-
if len(valid) == len(targets):
|
|
500
|
-
valid_targets = ast.SubNodeList[ast.Expr](
|
|
501
|
-
items=valid, delim=Tok.EQ, kid=valid
|
|
502
|
-
)
|
|
503
|
-
else:
|
|
384
|
+
valid = [target for target in targets if isinstance(target, uni.Expr)]
|
|
385
|
+
if not len(valid) == len(targets):
|
|
504
386
|
raise self.ice("Length mismatch in assignment targets")
|
|
505
|
-
if isinstance(value,
|
|
506
|
-
return
|
|
507
|
-
target=
|
|
387
|
+
if isinstance(value, uni.Expr):
|
|
388
|
+
return uni.Assignment(
|
|
389
|
+
target=valid,
|
|
508
390
|
value=value,
|
|
509
391
|
type_tag=None,
|
|
510
|
-
kid=[
|
|
392
|
+
kid=[*valid, value],
|
|
511
393
|
)
|
|
512
394
|
else:
|
|
513
395
|
raise self.ice()
|
|
514
396
|
|
|
515
|
-
def proc_aug_assign(self, node: py_ast.AugAssign) ->
|
|
397
|
+
def proc_aug_assign(self, node: py_ast.AugAssign) -> uni.Assignment:
|
|
516
398
|
"""Process python node.
|
|
517
399
|
|
|
518
400
|
class AugAssign(stmt):
|
|
@@ -525,19 +407,16 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
525
407
|
|
|
526
408
|
target = self.convert(node.target)
|
|
527
409
|
op = self.convert(node.op)
|
|
528
|
-
if isinstance(op,
|
|
410
|
+
if isinstance(op, uni.Token):
|
|
529
411
|
op.name = self.aug_op_map(TOKEN_MAP, op)
|
|
530
412
|
value = self.convert(node.value)
|
|
531
413
|
if (
|
|
532
|
-
isinstance(value,
|
|
533
|
-
and isinstance(target,
|
|
534
|
-
and isinstance(op,
|
|
414
|
+
isinstance(value, uni.Expr)
|
|
415
|
+
and isinstance(target, uni.Expr)
|
|
416
|
+
and isinstance(op, uni.Token)
|
|
535
417
|
):
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
)
|
|
539
|
-
return ast.Assignment(
|
|
540
|
-
target=targ,
|
|
418
|
+
return uni.Assignment(
|
|
419
|
+
target=[target],
|
|
541
420
|
type_tag=None,
|
|
542
421
|
mutable=True,
|
|
543
422
|
aug_op=op,
|
|
@@ -547,7 +426,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
547
426
|
else:
|
|
548
427
|
raise self.ice()
|
|
549
428
|
|
|
550
|
-
def proc_ann_assign(self, node: py_ast.AnnAssign) ->
|
|
429
|
+
def proc_ann_assign(self, node: py_ast.AnnAssign) -> uni.Assignment:
|
|
551
430
|
"""Process python node.
|
|
552
431
|
|
|
553
432
|
class AnnAssign(stmt):
|
|
@@ -559,22 +438,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
559
438
|
"""
|
|
560
439
|
target = self.convert(node.target)
|
|
561
440
|
annotation = self.convert(node.annotation)
|
|
562
|
-
if isinstance(annotation,
|
|
563
|
-
annotation_subtag =
|
|
441
|
+
if isinstance(annotation, uni.Expr):
|
|
442
|
+
annotation_subtag = uni.SubTag[uni.Expr](tag=annotation, kid=[annotation])
|
|
564
443
|
else:
|
|
565
444
|
raise self.ice()
|
|
566
445
|
value = self.convert(node.value) if node.value else None
|
|
567
446
|
if (
|
|
568
|
-
(isinstance(value, (
|
|
569
|
-
and isinstance(annotation,
|
|
570
|
-
and isinstance(target,
|
|
447
|
+
(isinstance(value, (uni.Expr, uni.YieldExpr)) or not value)
|
|
448
|
+
and isinstance(annotation, uni.Expr)
|
|
449
|
+
and isinstance(target, uni.Expr)
|
|
571
450
|
):
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return ast.Assignment(
|
|
576
|
-
target=target,
|
|
577
|
-
value=value if isinstance(value, (ast.Expr, ast.YieldExpr)) else None,
|
|
451
|
+
return uni.Assignment(
|
|
452
|
+
target=[target],
|
|
453
|
+
value=value if isinstance(value, (uni.Expr, uni.YieldExpr)) else None,
|
|
578
454
|
type_tag=annotation_subtag,
|
|
579
455
|
kid=(
|
|
580
456
|
[target, annotation_subtag, value]
|
|
@@ -585,7 +461,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
585
461
|
else:
|
|
586
462
|
raise self.ice()
|
|
587
463
|
|
|
588
|
-
def proc_for(self, node: py_ast.For) ->
|
|
464
|
+
def proc_for(self, node: py_ast.For) -> uni.InForStmt:
|
|
589
465
|
"""Process python node.
|
|
590
466
|
|
|
591
467
|
class For(stmt):
|
|
@@ -598,53 +474,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
598
474
|
target = self.convert(node.target)
|
|
599
475
|
iter = self.convert(node.iter)
|
|
600
476
|
body = [self.convert(i) for i in node.body]
|
|
601
|
-
val_body = [i for i in body if isinstance(i,
|
|
477
|
+
val_body = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
602
478
|
if len(val_body) != len(body):
|
|
603
479
|
raise self.ice("Length mismatch in for body")
|
|
604
480
|
|
|
605
|
-
valid_body =
|
|
606
|
-
items=val_body,
|
|
607
|
-
delim=Tok.WS,
|
|
608
|
-
kid=val_body,
|
|
609
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
610
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
611
|
-
)
|
|
481
|
+
valid_body = val_body
|
|
612
482
|
orelse = [self.convert(i) for i in node.orelse]
|
|
613
|
-
val_orelse = [i for i in orelse if isinstance(i,
|
|
483
|
+
val_orelse = [i for i in orelse if isinstance(i, uni.CodeBlockStmt)]
|
|
614
484
|
if len(val_orelse) != len(orelse):
|
|
615
485
|
raise self.ice("Length mismatch in for orelse")
|
|
616
486
|
if orelse:
|
|
617
|
-
|
|
618
|
-
items=val_orelse,
|
|
619
|
-
delim=Tok.WS,
|
|
620
|
-
kid=orelse,
|
|
621
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
622
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
623
|
-
)
|
|
487
|
+
fin_orelse = uni.ElseStmt(body=val_orelse, kid=val_orelse)
|
|
624
488
|
else:
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
if valid_orelse
|
|
629
|
-
else None
|
|
630
|
-
)
|
|
631
|
-
if isinstance(target, ast.Expr) and isinstance(iter, ast.Expr):
|
|
632
|
-
return ast.InForStmt(
|
|
489
|
+
fin_orelse = None
|
|
490
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
491
|
+
return uni.InForStmt(
|
|
633
492
|
target=target,
|
|
634
493
|
is_async=False,
|
|
635
494
|
collection=iter,
|
|
636
495
|
body=valid_body,
|
|
637
496
|
else_body=fin_orelse,
|
|
638
497
|
kid=(
|
|
639
|
-
[target, iter, valid_body, fin_orelse]
|
|
498
|
+
[target, iter, *valid_body, fin_orelse]
|
|
640
499
|
if fin_orelse
|
|
641
|
-
else [target, iter, valid_body]
|
|
500
|
+
else [target, iter, *valid_body]
|
|
642
501
|
),
|
|
643
502
|
)
|
|
644
503
|
else:
|
|
645
504
|
raise self.ice()
|
|
646
505
|
|
|
647
|
-
def proc_async_for(self, node: py_ast.AsyncFor) ->
|
|
506
|
+
def proc_async_for(self, node: py_ast.AsyncFor) -> uni.InForStmt:
|
|
648
507
|
"""Process AsyncFor node.
|
|
649
508
|
|
|
650
509
|
class AsyncFor(stmt):
|
|
@@ -657,53 +516,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
657
516
|
target = self.convert(node.target)
|
|
658
517
|
iter = self.convert(node.iter)
|
|
659
518
|
body = [self.convert(i) for i in node.body]
|
|
660
|
-
val_body = [i for i in body if isinstance(i,
|
|
519
|
+
val_body = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
661
520
|
if len(val_body) != len(body):
|
|
662
521
|
raise self.ice("Length mismatch in for body")
|
|
663
522
|
|
|
664
|
-
valid_body =
|
|
665
|
-
items=val_body,
|
|
666
|
-
delim=Tok.WS,
|
|
667
|
-
kid=val_body,
|
|
668
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
669
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
670
|
-
)
|
|
523
|
+
valid_body = val_body
|
|
671
524
|
orelse = [self.convert(i) for i in node.orelse]
|
|
672
|
-
val_orelse = [i for i in orelse if isinstance(i,
|
|
525
|
+
val_orelse = [i for i in orelse if isinstance(i, uni.CodeBlockStmt)]
|
|
673
526
|
if len(val_orelse) != len(orelse):
|
|
674
527
|
raise self.ice("Length mismatch in for orelse")
|
|
675
528
|
if orelse:
|
|
676
|
-
|
|
677
|
-
items=val_orelse,
|
|
678
|
-
delim=Tok.WS,
|
|
679
|
-
kid=orelse,
|
|
680
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
681
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
682
|
-
)
|
|
529
|
+
fin_orelse = uni.ElseStmt(body=val_orelse, kid=val_orelse)
|
|
683
530
|
else:
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
if valid_orelse
|
|
688
|
-
else None
|
|
689
|
-
)
|
|
690
|
-
if isinstance(target, ast.Expr) and isinstance(iter, ast.Expr):
|
|
691
|
-
return ast.InForStmt(
|
|
531
|
+
fin_orelse = None
|
|
532
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
533
|
+
return uni.InForStmt(
|
|
692
534
|
target=target,
|
|
693
535
|
is_async=True,
|
|
694
536
|
collection=iter,
|
|
695
537
|
body=valid_body,
|
|
696
538
|
else_body=fin_orelse,
|
|
697
539
|
kid=(
|
|
698
|
-
[target, iter, valid_body, fin_orelse]
|
|
540
|
+
[target, iter, *valid_body, fin_orelse]
|
|
699
541
|
if fin_orelse
|
|
700
|
-
else [target, iter, valid_body]
|
|
542
|
+
else [target, iter, *valid_body]
|
|
701
543
|
),
|
|
702
544
|
)
|
|
703
545
|
else:
|
|
704
546
|
raise self.ice()
|
|
705
547
|
|
|
706
|
-
def proc_while(self, node: py_ast.While) ->
|
|
548
|
+
def proc_while(self, node: py_ast.While) -> uni.WhileStmt:
|
|
707
549
|
"""Process While node.
|
|
708
550
|
|
|
709
551
|
class While(stmt):
|
|
@@ -714,26 +556,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
714
556
|
"""
|
|
715
557
|
test = self.convert(node.test)
|
|
716
558
|
body = [self.convert(stmt) for stmt in node.body]
|
|
717
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
559
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
718
560
|
if len(valid_body) != len(body):
|
|
719
561
|
raise self.ice("Length mismatch in while body")
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
delim=Tok.WS,
|
|
723
|
-
kid=valid_body,
|
|
724
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
725
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
726
|
-
)
|
|
727
|
-
if isinstance(test, ast.Expr):
|
|
728
|
-
return ast.WhileStmt(
|
|
562
|
+
if isinstance(test, uni.Expr):
|
|
563
|
+
return uni.WhileStmt(
|
|
729
564
|
condition=test,
|
|
730
|
-
body=
|
|
731
|
-
kid=[test,
|
|
565
|
+
body=valid_body,
|
|
566
|
+
kid=[test, *valid_body],
|
|
732
567
|
)
|
|
733
568
|
else:
|
|
734
569
|
raise self.ice()
|
|
735
570
|
|
|
736
|
-
def proc_if(self, node: py_ast.If) ->
|
|
571
|
+
def proc_if(self, node: py_ast.If) -> uni.IfStmt:
|
|
737
572
|
"""Process If node.
|
|
738
573
|
|
|
739
574
|
class If(stmt):
|
|
@@ -744,53 +579,40 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
744
579
|
"""
|
|
745
580
|
test = self.convert(node.test)
|
|
746
581
|
body = [self.convert(stmt) for stmt in node.body]
|
|
747
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
582
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
748
583
|
if len(valid_body) != len(body):
|
|
749
|
-
self.
|
|
750
|
-
body2 =
|
|
751
|
-
items=valid_body,
|
|
752
|
-
delim=Tok.WS,
|
|
753
|
-
kid=body,
|
|
754
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
755
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
756
|
-
)
|
|
584
|
+
self.log_error("Length mismatch in async for body")
|
|
585
|
+
body2 = valid_body
|
|
757
586
|
|
|
758
587
|
orelse = [self.convert(stmt) for stmt in node.orelse]
|
|
759
588
|
valid_orelse = [
|
|
760
|
-
stmt for stmt in orelse if isinstance(stmt, (
|
|
589
|
+
stmt for stmt in orelse if isinstance(stmt, (uni.CodeBlockStmt))
|
|
761
590
|
]
|
|
762
591
|
if valid_orelse:
|
|
763
592
|
first_elm = valid_orelse[0]
|
|
764
|
-
if isinstance(first_elm,
|
|
765
|
-
else_body: Optional[
|
|
593
|
+
if isinstance(first_elm, uni.IfStmt):
|
|
594
|
+
else_body: Optional[uni.ElseIf | uni.ElseStmt] = uni.ElseIf(
|
|
766
595
|
condition=first_elm.condition,
|
|
767
596
|
body=first_elm.body,
|
|
768
597
|
else_body=first_elm.else_body,
|
|
769
598
|
kid=first_elm.kid,
|
|
770
599
|
)
|
|
771
600
|
else:
|
|
772
|
-
|
|
773
|
-
items=valid_orelse,
|
|
774
|
-
delim=Tok.WS,
|
|
775
|
-
kid=orelse,
|
|
776
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
777
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
778
|
-
)
|
|
779
|
-
else_body = ast.ElseStmt(body=orelse2, kid=[orelse2])
|
|
601
|
+
else_body = uni.ElseStmt(body=valid_orelse, kid=valid_orelse)
|
|
780
602
|
else:
|
|
781
603
|
else_body = None
|
|
782
|
-
if isinstance(test,
|
|
783
|
-
ret =
|
|
604
|
+
if isinstance(test, uni.Expr):
|
|
605
|
+
ret = uni.IfStmt(
|
|
784
606
|
condition=test,
|
|
785
607
|
body=body2,
|
|
786
608
|
else_body=else_body,
|
|
787
|
-
kid=([test, body2, else_body] if else_body else [test, body2]),
|
|
609
|
+
kid=([test, *body2, else_body] if else_body else [test, *body2]),
|
|
788
610
|
)
|
|
789
611
|
else:
|
|
790
612
|
raise self.ice()
|
|
791
613
|
return ret
|
|
792
614
|
|
|
793
|
-
def proc_with(self, node: py_ast.With) ->
|
|
615
|
+
def proc_with(self, node: py_ast.With) -> uni.WithStmt:
|
|
794
616
|
"""Process With node.
|
|
795
617
|
|
|
796
618
|
class With(stmt):
|
|
@@ -799,28 +621,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
799
621
|
body: list[stmt]
|
|
800
622
|
"""
|
|
801
623
|
items = [self.convert(item) for item in node.items]
|
|
802
|
-
valid_items = [item for item in items if isinstance(item,
|
|
624
|
+
valid_items = [item for item in items if isinstance(item, uni.ExprAsItem)]
|
|
803
625
|
if len(valid_items) != len(items):
|
|
804
626
|
raise self.ice("Length mismatch in with items")
|
|
805
|
-
items_sub = ast.SubNodeList[ast.ExprAsItem](
|
|
806
|
-
items=valid_items, delim=Tok.COMMA, kid=items
|
|
807
|
-
)
|
|
808
627
|
body = [self.convert(stmt) for stmt in node.body]
|
|
809
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
628
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
810
629
|
if len(valid_body) != len(body):
|
|
811
630
|
raise self.ice("Length mismatch in async for body")
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
818
|
-
)
|
|
819
|
-
return ast.WithStmt(
|
|
820
|
-
is_async=False, exprs=items_sub, body=body_sub, kid=[items_sub, body_sub]
|
|
631
|
+
return uni.WithStmt(
|
|
632
|
+
is_async=False,
|
|
633
|
+
exprs=valid_items,
|
|
634
|
+
body=valid_body,
|
|
635
|
+
kid=[*valid_items, *valid_body],
|
|
821
636
|
)
|
|
822
637
|
|
|
823
|
-
def proc_async_with(self, node: py_ast.AsyncWith) ->
|
|
638
|
+
def proc_async_with(self, node: py_ast.AsyncWith) -> uni.WithStmt:
|
|
824
639
|
"""Process AsyncWith node.
|
|
825
640
|
|
|
826
641
|
class AsyncWith(stmt):
|
|
@@ -829,28 +644,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
829
644
|
body: list[stmt]
|
|
830
645
|
"""
|
|
831
646
|
items = [self.convert(item) for item in node.items]
|
|
832
|
-
valid_items = [item for item in items if isinstance(item,
|
|
647
|
+
valid_items = [item for item in items if isinstance(item, uni.ExprAsItem)]
|
|
833
648
|
if len(valid_items) != len(items):
|
|
834
649
|
raise self.ice("Length mismatch in with items")
|
|
835
|
-
items_sub = ast.SubNodeList[ast.ExprAsItem](
|
|
836
|
-
items=valid_items, delim=Tok.COMMA, kid=items
|
|
837
|
-
)
|
|
838
650
|
body = [self.convert(stmt) for stmt in node.body]
|
|
839
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
651
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
840
652
|
if len(valid_body) != len(body):
|
|
841
653
|
raise self.ice("Length mismatch in async for body")
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
848
|
-
)
|
|
849
|
-
return ast.WithStmt(
|
|
850
|
-
is_async=True, exprs=items_sub, body=body_sub, kid=[items_sub, body_sub]
|
|
654
|
+
return uni.WithStmt(
|
|
655
|
+
is_async=True,
|
|
656
|
+
exprs=valid_items,
|
|
657
|
+
body=valid_body,
|
|
658
|
+
kid=[*valid_items, *valid_body],
|
|
851
659
|
)
|
|
852
660
|
|
|
853
|
-
def proc_raise(self, node: py_ast.Raise) ->
|
|
661
|
+
def proc_raise(self, node: py_ast.Raise) -> uni.RaiseStmt:
|
|
854
662
|
"""Process python node.
|
|
855
663
|
|
|
856
664
|
class Raise(stmt):
|
|
@@ -859,28 +667,28 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
859
667
|
"""
|
|
860
668
|
exc = self.convert(node.exc) if node.exc else None
|
|
861
669
|
cause = self.convert(node.cause) if node.cause else None
|
|
862
|
-
kid: list[
|
|
863
|
-
if isinstance(exc,
|
|
670
|
+
kid: list[uni.Expr | uni.Token] = []
|
|
671
|
+
if isinstance(exc, uni.Expr):
|
|
864
672
|
kid = [exc]
|
|
865
|
-
if isinstance(cause,
|
|
673
|
+
if isinstance(cause, uni.Expr):
|
|
866
674
|
kid.append(cause)
|
|
867
675
|
if not (exc and cause):
|
|
868
676
|
kid.append(self.operator(Tok.KW_RAISE, "raise"))
|
|
869
|
-
if (isinstance(cause,
|
|
870
|
-
isinstance(exc,
|
|
677
|
+
if (isinstance(cause, uni.Expr) or cause is None) and (
|
|
678
|
+
isinstance(exc, uni.Expr) or exc is None
|
|
871
679
|
):
|
|
872
680
|
if exc and not node.cause:
|
|
873
|
-
return
|
|
681
|
+
return uni.RaiseStmt(
|
|
874
682
|
cause=exc,
|
|
875
683
|
from_target=None,
|
|
876
684
|
kid=[self.operator(Tok.KW_RAISE, "raise"), exc],
|
|
877
685
|
)
|
|
878
686
|
else:
|
|
879
|
-
return
|
|
687
|
+
return uni.RaiseStmt(cause=cause, from_target=exc, kid=kid)
|
|
880
688
|
else:
|
|
881
689
|
raise self.ice()
|
|
882
690
|
|
|
883
|
-
def proc_assert(self, node: py_ast.Assert) ->
|
|
691
|
+
def proc_assert(self, node: py_ast.Assert) -> uni.AssertStmt:
|
|
884
692
|
"""Process python node.
|
|
885
693
|
|
|
886
694
|
class Assert(stmt):
|
|
@@ -889,8 +697,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
889
697
|
"""
|
|
890
698
|
test = self.convert(node.test)
|
|
891
699
|
msg = self.convert(node.msg) if node.msg else None
|
|
892
|
-
if isinstance(test,
|
|
893
|
-
return
|
|
700
|
+
if isinstance(test, uni.Expr) and (isinstance(msg, uni.Expr) or msg is None):
|
|
701
|
+
return uni.AssertStmt(
|
|
894
702
|
condition=test,
|
|
895
703
|
error_msg=msg,
|
|
896
704
|
kid=[test, msg] if msg else [test],
|
|
@@ -898,7 +706,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
898
706
|
else:
|
|
899
707
|
raise self.ice()
|
|
900
708
|
|
|
901
|
-
def proc_attribute(self, node: py_ast.Attribute) ->
|
|
709
|
+
def proc_attribute(self, node: py_ast.Attribute) -> uni.AtomTrailer:
|
|
902
710
|
"""Proassignment targetscess python node.
|
|
903
711
|
|
|
904
712
|
class Attribute(expr):
|
|
@@ -910,11 +718,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
910
718
|
"""
|
|
911
719
|
value = self.convert(node.value)
|
|
912
720
|
if (
|
|
913
|
-
isinstance(value,
|
|
914
|
-
and isinstance(value.target,
|
|
721
|
+
isinstance(value, uni.FuncCall)
|
|
722
|
+
and isinstance(value.target, uni.Name)
|
|
915
723
|
and value.target.value == "super"
|
|
916
724
|
):
|
|
917
|
-
tok =
|
|
725
|
+
tok = uni.Name(
|
|
918
726
|
orig_src=self.orig_src,
|
|
919
727
|
name=Tok.KW_SUPER,
|
|
920
728
|
value="super",
|
|
@@ -925,9 +733,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
925
733
|
pos_start=0,
|
|
926
734
|
pos_end=0,
|
|
927
735
|
)
|
|
928
|
-
value =
|
|
736
|
+
value = uni.SpecialVarRef(var=tok)
|
|
929
737
|
# exit()
|
|
930
|
-
attribute =
|
|
738
|
+
attribute = uni.Name(
|
|
931
739
|
orig_src=self.orig_src,
|
|
932
740
|
name=Tok.NAME,
|
|
933
741
|
value=(
|
|
@@ -942,8 +750,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
942
750
|
pos_start=0,
|
|
943
751
|
pos_end=0,
|
|
944
752
|
)
|
|
945
|
-
if isinstance(value,
|
|
946
|
-
return
|
|
753
|
+
if isinstance(value, uni.Expr):
|
|
754
|
+
return uni.AtomTrailer(
|
|
947
755
|
target=value,
|
|
948
756
|
right=attribute,
|
|
949
757
|
is_attr=True,
|
|
@@ -953,19 +761,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
953
761
|
else:
|
|
954
762
|
raise self.ice()
|
|
955
763
|
|
|
956
|
-
def proc_await(self, node: py_ast.Await) ->
|
|
764
|
+
def proc_await(self, node: py_ast.Await) -> uni.AwaitExpr:
|
|
957
765
|
"""Process python node.
|
|
958
766
|
|
|
959
767
|
class Await(expr):
|
|
960
768
|
value: expr
|
|
961
769
|
"""
|
|
962
770
|
value = self.convert(node.value)
|
|
963
|
-
if isinstance(value,
|
|
964
|
-
return
|
|
771
|
+
if isinstance(value, uni.Expr):
|
|
772
|
+
return uni.AwaitExpr(target=value, kid=[value])
|
|
965
773
|
else:
|
|
966
774
|
raise self.ice()
|
|
967
775
|
|
|
968
|
-
def proc_bin_op(self, node: py_ast.BinOp) ->
|
|
776
|
+
def proc_bin_op(self, node: py_ast.BinOp) -> uni.AtomUnit:
|
|
969
777
|
"""Process python node.
|
|
970
778
|
|
|
971
779
|
class BinOp(expr):
|
|
@@ -979,17 +787,17 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
979
787
|
op = self.convert(node.op)
|
|
980
788
|
right = self.convert(node.right)
|
|
981
789
|
if (
|
|
982
|
-
isinstance(left,
|
|
983
|
-
and isinstance(op,
|
|
984
|
-
and isinstance(right,
|
|
790
|
+
isinstance(left, uni.Expr)
|
|
791
|
+
and isinstance(op, uni.Token)
|
|
792
|
+
and isinstance(right, uni.Expr)
|
|
985
793
|
):
|
|
986
|
-
value =
|
|
794
|
+
value = uni.BinaryExpr(
|
|
987
795
|
left=left,
|
|
988
796
|
op=op,
|
|
989
797
|
right=right,
|
|
990
798
|
kid=[left, op, right],
|
|
991
799
|
)
|
|
992
|
-
return
|
|
800
|
+
return uni.AtomUnit(
|
|
993
801
|
value=value,
|
|
994
802
|
kid=[
|
|
995
803
|
self.operator(Tok.RPAREN, "("),
|
|
@@ -1000,7 +808,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1000
808
|
else:
|
|
1001
809
|
raise self.ice()
|
|
1002
810
|
|
|
1003
|
-
def proc_unary_op(self, node: py_ast.UnaryOp) ->
|
|
811
|
+
def proc_unary_op(self, node: py_ast.UnaryOp) -> uni.UnaryExpr:
|
|
1004
812
|
"""Process python node.
|
|
1005
813
|
|
|
1006
814
|
class UnaryOp(expr):
|
|
@@ -1009,8 +817,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1009
817
|
"""
|
|
1010
818
|
op = self.convert(node.op)
|
|
1011
819
|
operand = self.convert(node.operand)
|
|
1012
|
-
if isinstance(op,
|
|
1013
|
-
return
|
|
820
|
+
if isinstance(op, uni.Token) and isinstance(operand, uni.Expr):
|
|
821
|
+
return uni.UnaryExpr(
|
|
1014
822
|
op=op,
|
|
1015
823
|
operand=operand,
|
|
1016
824
|
kid=[op, operand],
|
|
@@ -1018,7 +826,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1018
826
|
else:
|
|
1019
827
|
raise self.ice()
|
|
1020
828
|
|
|
1021
|
-
def proc_bool_op(self, node: py_ast.BoolOp) ->
|
|
829
|
+
def proc_bool_op(self, node: py_ast.BoolOp) -> uni.AtomUnit:
|
|
1022
830
|
"""Process python node.
|
|
1023
831
|
|
|
1024
832
|
class BoolOp(expr): a and b and c
|
|
@@ -1027,18 +835,23 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1027
835
|
"""
|
|
1028
836
|
op = self.convert(node.op)
|
|
1029
837
|
values = [self.convert(value) for value in node.values]
|
|
1030
|
-
valid = [value for value in values if isinstance(value,
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
838
|
+
valid = [value for value in values if isinstance(value, uni.Expr)]
|
|
839
|
+
if isinstance(op, uni.Token) and len(valid) == len(values):
|
|
840
|
+
expr = uni.BoolExpr(op=op, values=valid, kid=[op, *valid])
|
|
841
|
+
return uni.AtomUnit(
|
|
842
|
+
value=expr,
|
|
843
|
+
kid=[
|
|
844
|
+
self.operator(Tok.RPAREN, "("),
|
|
845
|
+
expr,
|
|
846
|
+
self.operator(Tok.LPAREN, ")"),
|
|
847
|
+
],
|
|
848
|
+
)
|
|
1036
849
|
else:
|
|
1037
850
|
raise self.ice()
|
|
1038
851
|
|
|
1039
|
-
def proc_break(self, node: py_ast.Break) ->
|
|
852
|
+
def proc_break(self, node: py_ast.Break) -> uni.CtrlStmt:
|
|
1040
853
|
"""Process python node."""
|
|
1041
|
-
break_tok =
|
|
854
|
+
break_tok = uni.Token(
|
|
1042
855
|
orig_src=self.orig_src,
|
|
1043
856
|
name=Tok.KW_BREAK,
|
|
1044
857
|
value="break",
|
|
@@ -1049,9 +862,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1049
862
|
pos_start=0,
|
|
1050
863
|
pos_end=0,
|
|
1051
864
|
)
|
|
1052
|
-
return
|
|
865
|
+
return uni.CtrlStmt(ctrl=break_tok, kid=[break_tok])
|
|
1053
866
|
|
|
1054
|
-
def proc_call(self, node: py_ast.Call) ->
|
|
867
|
+
def proc_call(self, node: py_ast.Call) -> uni.FuncCall:
|
|
1055
868
|
"""Process python node.
|
|
1056
869
|
|
|
1057
870
|
class Call(expr):
|
|
@@ -1062,33 +875,31 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1062
875
|
keywords: list[keyword]
|
|
1063
876
|
"""
|
|
1064
877
|
func = self.convert(node.func)
|
|
1065
|
-
params_in: list[
|
|
878
|
+
params_in: list[uni.Expr | uni.KWPair] = []
|
|
1066
879
|
args = [self.convert(arg) for arg in node.args]
|
|
1067
880
|
keywords = [self.convert(keyword) for keyword in node.keywords]
|
|
1068
881
|
|
|
1069
882
|
for i in args:
|
|
1070
|
-
if isinstance(i,
|
|
883
|
+
if isinstance(i, uni.Expr):
|
|
1071
884
|
params_in.append(i)
|
|
1072
885
|
for i in keywords:
|
|
1073
|
-
if isinstance(i,
|
|
886
|
+
if isinstance(i, uni.KWPair):
|
|
1074
887
|
params_in.append(i)
|
|
1075
888
|
if len(params_in) != 0:
|
|
1076
|
-
|
|
1077
|
-
items=params_in, delim=Tok.COMMA, kid=params_in
|
|
1078
|
-
)
|
|
889
|
+
kids = [func, *params_in]
|
|
1079
890
|
else:
|
|
1080
|
-
|
|
1081
|
-
if isinstance(func,
|
|
1082
|
-
return
|
|
891
|
+
kids = [func]
|
|
892
|
+
if isinstance(func, uni.Expr):
|
|
893
|
+
return uni.FuncCall(
|
|
1083
894
|
target=func,
|
|
1084
|
-
params=
|
|
895
|
+
params=params_in,
|
|
1085
896
|
genai_call=None,
|
|
1086
|
-
kid=
|
|
897
|
+
kid=kids,
|
|
1087
898
|
)
|
|
1088
899
|
else:
|
|
1089
900
|
raise self.ice()
|
|
1090
901
|
|
|
1091
|
-
def proc_compare(self, node: py_ast.Compare) ->
|
|
902
|
+
def proc_compare(self, node: py_ast.Compare) -> uni.AtomUnit:
|
|
1092
903
|
"""Process python node.
|
|
1093
904
|
|
|
1094
905
|
class Compare(expr):
|
|
@@ -1101,28 +912,32 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1101
912
|
left = self.convert(node.left)
|
|
1102
913
|
comparators = [self.convert(comparator) for comparator in node.comparators]
|
|
1103
914
|
valid_comparators = [
|
|
1104
|
-
comparator for comparator in comparators if isinstance(comparator,
|
|
915
|
+
comparator for comparator in comparators if isinstance(comparator, uni.Expr)
|
|
1105
916
|
]
|
|
1106
|
-
comparators2 = ast.SubNodeList[ast.Expr](
|
|
1107
|
-
items=valid_comparators, delim=Tok.COMMA, kid=comparators
|
|
1108
|
-
)
|
|
1109
917
|
ops = [self.convert(op) for op in node.ops]
|
|
1110
|
-
valid_ops = [op for op in ops if isinstance(op,
|
|
1111
|
-
ops2 = ast.SubNodeList[ast.Token](items=valid_ops, delim=Tok.COMMA, kid=ops)
|
|
918
|
+
valid_ops = [op for op in ops if isinstance(op, uni.Token)]
|
|
1112
919
|
|
|
1113
|
-
kids = [left,
|
|
920
|
+
kids = [left, *valid_ops, *valid_comparators]
|
|
1114
921
|
if (
|
|
1115
|
-
isinstance(left,
|
|
922
|
+
isinstance(left, uni.Expr)
|
|
1116
923
|
and len(ops) == len(valid_ops)
|
|
1117
924
|
and len(comparators) == len(valid_comparators)
|
|
1118
925
|
):
|
|
1119
|
-
|
|
926
|
+
expr = uni.CompareExpr(
|
|
1120
927
|
left=left, rights=valid_comparators, ops=valid_ops, kid=kids
|
|
1121
928
|
)
|
|
929
|
+
return uni.AtomUnit(
|
|
930
|
+
value=expr,
|
|
931
|
+
kid=[
|
|
932
|
+
self.operator(Tok.RPAREN, "("),
|
|
933
|
+
expr,
|
|
934
|
+
self.operator(Tok.LPAREN, ")"),
|
|
935
|
+
],
|
|
936
|
+
)
|
|
1122
937
|
else:
|
|
1123
938
|
raise self.ice()
|
|
1124
939
|
|
|
1125
|
-
def proc_constant(self, node: py_ast.Constant) ->
|
|
940
|
+
def proc_constant(self, node: py_ast.Constant) -> uni.Literal:
|
|
1126
941
|
"""Process python node.
|
|
1127
942
|
|
|
1128
943
|
class Constant(expr):
|
|
@@ -1133,12 +948,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1133
948
|
n: int | float | complex
|
|
1134
949
|
"""
|
|
1135
950
|
type_mapping = {
|
|
1136
|
-
int:
|
|
1137
|
-
float:
|
|
1138
|
-
str:
|
|
1139
|
-
bytes:
|
|
1140
|
-
bool:
|
|
1141
|
-
type(None):
|
|
951
|
+
int: uni.Int,
|
|
952
|
+
float: uni.Float,
|
|
953
|
+
str: uni.String,
|
|
954
|
+
bytes: uni.String,
|
|
955
|
+
bool: uni.Bool,
|
|
956
|
+
type(None): uni.Null,
|
|
1142
957
|
}
|
|
1143
958
|
value_type = type(node.value)
|
|
1144
959
|
if value_type in type_mapping:
|
|
@@ -1167,7 +982,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1167
982
|
pos_end=0,
|
|
1168
983
|
)
|
|
1169
984
|
elif node.value == Ellipsis:
|
|
1170
|
-
return
|
|
985
|
+
return uni.Ellipsis(
|
|
1171
986
|
orig_src=self.orig_src,
|
|
1172
987
|
name=Tok.ELLIPSIS,
|
|
1173
988
|
value="...",
|
|
@@ -1181,9 +996,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1181
996
|
else:
|
|
1182
997
|
raise self.ice("Invalid type for constant")
|
|
1183
998
|
|
|
1184
|
-
def proc_continue(self, node: py_ast.Continue) ->
|
|
999
|
+
def proc_continue(self, node: py_ast.Continue) -> uni.CtrlStmt:
|
|
1185
1000
|
"""Process python node."""
|
|
1186
|
-
continue_tok =
|
|
1001
|
+
continue_tok = uni.Token(
|
|
1187
1002
|
orig_src=self.orig_src,
|
|
1188
1003
|
name=Tok.KW_CONTINUE,
|
|
1189
1004
|
value="continue",
|
|
@@ -1194,9 +1009,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1194
1009
|
pos_start=0,
|
|
1195
1010
|
pos_end=0,
|
|
1196
1011
|
)
|
|
1197
|
-
return
|
|
1012
|
+
return uni.CtrlStmt(ctrl=continue_tok, kid=[continue_tok])
|
|
1198
1013
|
|
|
1199
|
-
def proc_dict(self, node: py_ast.Dict) ->
|
|
1014
|
+
def proc_dict(self, node: py_ast.Dict) -> uni.DictVal:
|
|
1200
1015
|
"""Process python node.
|
|
1201
1016
|
|
|
1202
1017
|
class Dict(expr):
|
|
@@ -1205,18 +1020,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1205
1020
|
"""
|
|
1206
1021
|
keys = [self.convert(i) if i else None for i in node.keys]
|
|
1207
1022
|
values = [self.convert(i) for i in node.values]
|
|
1208
|
-
valid_keys = [i for i in keys if isinstance(i,
|
|
1209
|
-
valid_values = [i for i in values if isinstance(i,
|
|
1210
|
-
kvpair: list[
|
|
1023
|
+
valid_keys = [i for i in keys if isinstance(i, uni.Expr) or i is None]
|
|
1024
|
+
valid_values = [i for i in values if isinstance(i, uni.Expr)]
|
|
1025
|
+
kvpair: list[uni.KVPair] = []
|
|
1211
1026
|
for i in range(len(values)):
|
|
1212
1027
|
key_pluck = valid_keys[i]
|
|
1213
|
-
kvp =
|
|
1028
|
+
kvp = uni.KVPair(
|
|
1214
1029
|
key=key_pluck,
|
|
1215
1030
|
value=valid_values[i],
|
|
1216
1031
|
kid=([key_pluck, valid_values[i]] if key_pluck else [valid_values[i]]),
|
|
1217
1032
|
)
|
|
1218
1033
|
kvpair.append(kvp)
|
|
1219
|
-
return
|
|
1034
|
+
return uni.DictVal(
|
|
1220
1035
|
kv_pairs=kvpair,
|
|
1221
1036
|
kid=(
|
|
1222
1037
|
[*kvpair]
|
|
@@ -1225,7 +1040,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1225
1040
|
),
|
|
1226
1041
|
)
|
|
1227
1042
|
|
|
1228
|
-
def proc_dict_comp(self, node: py_ast.DictComp) ->
|
|
1043
|
+
def proc_dict_comp(self, node: py_ast.DictComp) -> uni.DictCompr:
|
|
1229
1044
|
"""Process python node.
|
|
1230
1045
|
|
|
1231
1046
|
class DictComp(expr):
|
|
@@ -1235,21 +1050,20 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1235
1050
|
"""
|
|
1236
1051
|
key = self.convert(node.key)
|
|
1237
1052
|
value = self.convert(node.value)
|
|
1238
|
-
if isinstance(key,
|
|
1239
|
-
kv_pair =
|
|
1053
|
+
if isinstance(key, uni.Expr) and isinstance(value, uni.Expr):
|
|
1054
|
+
kv_pair = uni.KVPair(key=key, value=value, kid=[key, value])
|
|
1240
1055
|
else:
|
|
1241
1056
|
raise self.ice()
|
|
1242
1057
|
generators = [self.convert(i) for i in node.generators]
|
|
1243
|
-
valid = [i for i in generators if isinstance(i, (
|
|
1058
|
+
valid = [i for i in generators if isinstance(i, (uni.InnerCompr))]
|
|
1244
1059
|
if len(valid) != len(generators):
|
|
1245
1060
|
raise self.ice("Length mismatch in dict compr generators")
|
|
1246
|
-
|
|
1247
|
-
return ast.DictCompr(kv_pair=kv_pair, compr=valid, kid=[kv_pair, compr])
|
|
1061
|
+
return uni.DictCompr(kv_pair=kv_pair, compr=valid, kid=[kv_pair, *valid])
|
|
1248
1062
|
|
|
1249
1063
|
def proc_ellipsis(self, node: py_ast.Ellipsis) -> None:
|
|
1250
1064
|
"""Process python node."""
|
|
1251
1065
|
|
|
1252
|
-
def proc_except_handler(self, node: py_ast.ExceptHandler) ->
|
|
1066
|
+
def proc_except_handler(self, node: py_ast.ExceptHandler) -> uni.Except:
|
|
1253
1067
|
"""Process python node.
|
|
1254
1068
|
|
|
1255
1069
|
class ExceptHandler(excepthandler):
|
|
@@ -1258,9 +1072,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1258
1072
|
body: list[stmt]
|
|
1259
1073
|
"""
|
|
1260
1074
|
type = self.convert(node.type) if node.type else None
|
|
1261
|
-
name:
|
|
1075
|
+
name: uni.Name | None = None
|
|
1262
1076
|
if not type and not node.name:
|
|
1263
|
-
type =
|
|
1077
|
+
type = uni.Name(
|
|
1264
1078
|
orig_src=self.orig_src,
|
|
1265
1079
|
name=Tok.NAME,
|
|
1266
1080
|
value="Exception",
|
|
@@ -1271,7 +1085,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1271
1085
|
pos_start=0,
|
|
1272
1086
|
pos_end=0,
|
|
1273
1087
|
)
|
|
1274
|
-
name =
|
|
1088
|
+
name = uni.Name(
|
|
1275
1089
|
orig_src=self.orig_src,
|
|
1276
1090
|
name=Tok.NAME,
|
|
1277
1091
|
value="e",
|
|
@@ -1283,7 +1097,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1283
1097
|
pos_end=0,
|
|
1284
1098
|
)
|
|
1285
1099
|
else:
|
|
1286
|
-
# type =
|
|
1100
|
+
# type = uni.Name(
|
|
1287
1101
|
# orig_src=self.orig_src,
|
|
1288
1102
|
# name=Tok.NAME,
|
|
1289
1103
|
# value=no,
|
|
@@ -1295,7 +1109,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1295
1109
|
# pos_end=0,
|
|
1296
1110
|
# )
|
|
1297
1111
|
name = (
|
|
1298
|
-
|
|
1112
|
+
uni.Name(
|
|
1299
1113
|
orig_src=self.orig_src,
|
|
1300
1114
|
name=Tok.NAME,
|
|
1301
1115
|
value=node.name,
|
|
@@ -1311,40 +1125,33 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1311
1125
|
)
|
|
1312
1126
|
|
|
1313
1127
|
body = [self.convert(i) for i in node.body]
|
|
1314
|
-
valid = [i for i in body if isinstance(i, (
|
|
1128
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
1315
1129
|
if len(valid) != len(body):
|
|
1316
1130
|
raise self.ice("Length mismatch in except handler body")
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
kid=valid,
|
|
1321
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
1322
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
1323
|
-
)
|
|
1324
|
-
kid = [item for item in [type, name, valid_body] if item]
|
|
1325
|
-
if isinstance(type, ast.Expr) and (isinstance(name, ast.Name) or not name):
|
|
1326
|
-
return ast.Except(
|
|
1131
|
+
kid = [item for item in [type, name, *valid] if item]
|
|
1132
|
+
if isinstance(type, uni.Expr) and (isinstance(name, uni.Name) or not name):
|
|
1133
|
+
return uni.Except(
|
|
1327
1134
|
ex_type=type,
|
|
1328
1135
|
name=name,
|
|
1329
|
-
body=
|
|
1136
|
+
body=valid,
|
|
1330
1137
|
kid=kid,
|
|
1331
1138
|
)
|
|
1332
1139
|
else:
|
|
1333
1140
|
raise self.ice()
|
|
1334
1141
|
|
|
1335
|
-
def proc_expr(self, node: py_ast.Expr) ->
|
|
1142
|
+
def proc_expr(self, node: py_ast.Expr) -> uni.ExprStmt:
|
|
1336
1143
|
"""Process python node.
|
|
1337
1144
|
|
|
1338
1145
|
class Expr(stmt):
|
|
1339
1146
|
value: expr
|
|
1340
1147
|
"""
|
|
1341
1148
|
value = self.convert(node.value)
|
|
1342
|
-
if isinstance(value,
|
|
1343
|
-
return
|
|
1149
|
+
if isinstance(value, uni.Expr):
|
|
1150
|
+
return uni.ExprStmt(expr=value, in_fstring=False, kid=[value])
|
|
1344
1151
|
else:
|
|
1345
1152
|
raise self.ice()
|
|
1346
1153
|
|
|
1347
|
-
def proc_formatted_value(self, node: py_ast.FormattedValue) ->
|
|
1154
|
+
def proc_formatted_value(self, node: py_ast.FormattedValue) -> uni.ExprStmt:
|
|
1348
1155
|
"""Process python node.
|
|
1349
1156
|
|
|
1350
1157
|
class FormattedValue(expr):
|
|
@@ -1355,8 +1162,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1355
1162
|
format_spec: expr | None
|
|
1356
1163
|
"""
|
|
1357
1164
|
value = self.convert(node.value)
|
|
1358
|
-
if isinstance(value,
|
|
1359
|
-
ret =
|
|
1165
|
+
if isinstance(value, uni.Expr):
|
|
1166
|
+
ret = uni.ExprStmt(
|
|
1360
1167
|
expr=value,
|
|
1361
1168
|
in_fstring=True,
|
|
1362
1169
|
kid=[value],
|
|
@@ -1368,7 +1175,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1368
1175
|
def proc_function_type(self, node: py_ast.FunctionType) -> None:
|
|
1369
1176
|
"""Process python node."""
|
|
1370
1177
|
|
|
1371
|
-
def proc_generator_exp(self, node: py_ast.GeneratorExp) ->
|
|
1178
|
+
def proc_generator_exp(self, node: py_ast.GeneratorExp) -> uni.GenCompr:
|
|
1372
1179
|
"""Process python node..
|
|
1373
1180
|
|
|
1374
1181
|
class SetComp(expr):
|
|
@@ -1377,25 +1184,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1377
1184
|
"""
|
|
1378
1185
|
elt = self.convert(node.elt)
|
|
1379
1186
|
generators = [self.convert(gen) for gen in node.generators]
|
|
1380
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1187
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
1381
1188
|
if len(generators) != len(valid):
|
|
1382
1189
|
raise self.ice("Length mismatch in list comp generators")
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
return ast.GenCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
1190
|
+
if isinstance(elt, uni.Expr):
|
|
1191
|
+
return uni.GenCompr(out_expr=elt, compr=valid, kid=[elt, *valid])
|
|
1386
1192
|
else:
|
|
1387
1193
|
raise self.ice()
|
|
1388
1194
|
|
|
1389
|
-
def proc_global(self, node: py_ast.Global) ->
|
|
1195
|
+
def proc_global(self, node: py_ast.Global) -> uni.GlobalStmt:
|
|
1390
1196
|
"""Process python node.
|
|
1391
1197
|
|
|
1392
1198
|
class Global(stmt):
|
|
1393
1199
|
names: list[_Identifier]
|
|
1394
1200
|
"""
|
|
1395
|
-
names: list[
|
|
1201
|
+
names: list[uni.NameAtom] = []
|
|
1396
1202
|
for id in node.names:
|
|
1397
1203
|
names.append(
|
|
1398
|
-
|
|
1204
|
+
uni.Name(
|
|
1399
1205
|
orig_src=self.orig_src,
|
|
1400
1206
|
name=Tok.NAME,
|
|
1401
1207
|
value=id,
|
|
@@ -1407,10 +1213,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1407
1213
|
pos_end=0,
|
|
1408
1214
|
)
|
|
1409
1215
|
)
|
|
1410
|
-
|
|
1411
|
-
return ast.GlobalStmt(target=target, kid=[target])
|
|
1216
|
+
return uni.GlobalStmt(target=names, kid=names)
|
|
1412
1217
|
|
|
1413
|
-
def proc_if_exp(self, node: py_ast.IfExp) ->
|
|
1218
|
+
def proc_if_exp(self, node: py_ast.IfExp) -> uni.IfElseExpr:
|
|
1414
1219
|
"""Process python node.
|
|
1415
1220
|
|
|
1416
1221
|
class IfExp(expr):
|
|
@@ -1422,33 +1227,33 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1422
1227
|
body = self.convert(node.body)
|
|
1423
1228
|
orelse = self.convert(node.orelse)
|
|
1424
1229
|
if (
|
|
1425
|
-
isinstance(test,
|
|
1426
|
-
and isinstance(body,
|
|
1427
|
-
and isinstance(orelse,
|
|
1230
|
+
isinstance(test, uni.Expr)
|
|
1231
|
+
and isinstance(body, uni.Expr)
|
|
1232
|
+
and isinstance(orelse, uni.Expr)
|
|
1428
1233
|
):
|
|
1429
|
-
return
|
|
1234
|
+
return uni.IfElseExpr(
|
|
1430
1235
|
value=body, condition=test, else_value=orelse, kid=[body, test, orelse]
|
|
1431
1236
|
)
|
|
1432
1237
|
else:
|
|
1433
1238
|
raise self.ice()
|
|
1434
1239
|
|
|
1435
|
-
def proc_import(self, node: py_ast.Import) ->
|
|
1240
|
+
def proc_import(self, node: py_ast.Import) -> uni.Import:
|
|
1436
1241
|
"""Process python node.
|
|
1437
1242
|
|
|
1438
1243
|
class Import(stmt):
|
|
1439
1244
|
names: list[alias]
|
|
1440
1245
|
"""
|
|
1441
1246
|
names = [self.convert(name) for name in node.names]
|
|
1442
|
-
valid_names = [name for name in names if isinstance(name,
|
|
1247
|
+
valid_names = [name for name in names if isinstance(name, uni.ExprAsItem)]
|
|
1443
1248
|
if len(valid_names) != len(names):
|
|
1444
|
-
self.
|
|
1249
|
+
self.log_error("Length mismatch in import names")
|
|
1445
1250
|
paths = []
|
|
1446
1251
|
for name in valid_names:
|
|
1447
|
-
if isinstance(name.expr,
|
|
1448
|
-
isinstance(name.alias,
|
|
1252
|
+
if isinstance(name.expr, uni.Name) and (
|
|
1253
|
+
isinstance(name.alias, uni.Name) or name.alias is None
|
|
1449
1254
|
):
|
|
1450
1255
|
paths.append(
|
|
1451
|
-
|
|
1256
|
+
uni.ModulePath(
|
|
1452
1257
|
path=[name.expr],
|
|
1453
1258
|
level=0,
|
|
1454
1259
|
alias=name.alias,
|
|
@@ -1458,29 +1263,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1458
1263
|
# Need to unravel atom trailers
|
|
1459
1264
|
else:
|
|
1460
1265
|
raise self.ice()
|
|
1461
|
-
|
|
1462
|
-
orig_src=self.orig_src,
|
|
1463
|
-
name=Tok.NAME,
|
|
1464
|
-
value="py",
|
|
1465
|
-
line=node.lineno,
|
|
1466
|
-
end_line=node.end_lineno if node.end_lineno else node.lineno,
|
|
1467
|
-
col_start=node.col_offset,
|
|
1468
|
-
col_end=0,
|
|
1469
|
-
pos_start=0,
|
|
1470
|
-
pos_end=0,
|
|
1471
|
-
)
|
|
1472
|
-
pytag = ast.SubTag[ast.Name](tag=lang, kid=[lang])
|
|
1473
|
-
items = ast.SubNodeList[ast.ModulePath](items=paths, delim=Tok.COMMA, kid=paths)
|
|
1474
|
-
ret = ast.Import(
|
|
1475
|
-
hint=pytag,
|
|
1266
|
+
ret = uni.Import(
|
|
1476
1267
|
from_loc=None,
|
|
1477
|
-
items=
|
|
1268
|
+
items=paths,
|
|
1478
1269
|
is_absorb=False,
|
|
1479
|
-
kid=
|
|
1270
|
+
kid=paths,
|
|
1480
1271
|
)
|
|
1481
1272
|
return ret
|
|
1482
1273
|
|
|
1483
|
-
def proc_import_from(self, node: py_ast.ImportFrom) ->
|
|
1274
|
+
def proc_import_from(self, node: py_ast.ImportFrom) -> uni.Import:
|
|
1484
1275
|
"""Process python node.
|
|
1485
1276
|
|
|
1486
1277
|
class ImportFrom(stmt):
|
|
@@ -1488,7 +1279,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1488
1279
|
names: list[alias]
|
|
1489
1280
|
level: int
|
|
1490
1281
|
"""
|
|
1491
|
-
lang =
|
|
1282
|
+
lang = uni.Name(
|
|
1492
1283
|
orig_src=self.orig_src,
|
|
1493
1284
|
name=Tok.NAME,
|
|
1494
1285
|
value="py",
|
|
@@ -1499,11 +1290,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1499
1290
|
pos_start=0,
|
|
1500
1291
|
pos_end=0,
|
|
1501
1292
|
)
|
|
1502
|
-
modpaths: list[
|
|
1293
|
+
modpaths: list[uni.Name] = []
|
|
1503
1294
|
if node.module:
|
|
1504
1295
|
for i in node.module.split("."):
|
|
1505
1296
|
modpaths.append(
|
|
1506
|
-
|
|
1297
|
+
uni.Name(
|
|
1507
1298
|
orig_src=self.orig_src,
|
|
1508
1299
|
name=Tok.NAME,
|
|
1509
1300
|
value=i,
|
|
@@ -1517,22 +1308,23 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1517
1308
|
)
|
|
1518
1309
|
moddots = [self.operator(Tok.DOT, ".") for _ in range(node.level)]
|
|
1519
1310
|
modparts = moddots + modpaths
|
|
1520
|
-
path =
|
|
1521
|
-
path=modpaths,
|
|
1311
|
+
path = uni.ModulePath(
|
|
1312
|
+
path=modpaths if modpaths else None,
|
|
1522
1313
|
level=node.level,
|
|
1523
1314
|
alias=None,
|
|
1524
1315
|
kid=modparts,
|
|
1525
1316
|
)
|
|
1317
|
+
|
|
1526
1318
|
names = [self.convert(name) for name in node.names]
|
|
1527
1319
|
valid_names = []
|
|
1528
1320
|
for name in names:
|
|
1529
1321
|
if (
|
|
1530
|
-
isinstance(name,
|
|
1531
|
-
and isinstance(name.expr,
|
|
1532
|
-
and (isinstance(name.alias,
|
|
1322
|
+
isinstance(name, uni.ExprAsItem)
|
|
1323
|
+
and isinstance(name.expr, uni.Name)
|
|
1324
|
+
and (isinstance(name.alias, uni.Name) or name.alias is None)
|
|
1533
1325
|
):
|
|
1534
1326
|
valid_names.append(
|
|
1535
|
-
|
|
1327
|
+
uni.ModuleItem(
|
|
1536
1328
|
name=name.expr,
|
|
1537
1329
|
alias=name.alias if name.alias else None,
|
|
1538
1330
|
kid=[i for i in name.kid if i],
|
|
@@ -1540,38 +1332,27 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1540
1332
|
)
|
|
1541
1333
|
else:
|
|
1542
1334
|
raise self.ice()
|
|
1543
|
-
items =
|
|
1544
|
-
ast.SubNodeList[ast.ModuleItem](
|
|
1545
|
-
items=valid_names, delim=Tok.COMMA, kid=valid_names
|
|
1546
|
-
)
|
|
1547
|
-
if valid_names
|
|
1548
|
-
else None
|
|
1549
|
-
)
|
|
1335
|
+
items = valid_names
|
|
1550
1336
|
if not items:
|
|
1551
1337
|
raise self.ice("No valid names in import from")
|
|
1552
|
-
pytag =
|
|
1338
|
+
pytag = uni.SubTag[uni.Name](tag=lang, kid=[lang])
|
|
1553
1339
|
if len(node.names) == 1 and node.names[0].name == "*":
|
|
1554
|
-
|
|
1555
|
-
items=[path], delim=Tok.COMMA, kid=[path]
|
|
1556
|
-
)
|
|
1557
|
-
ret = ast.Import(
|
|
1558
|
-
hint=pytag,
|
|
1340
|
+
ret = uni.Import(
|
|
1559
1341
|
from_loc=None,
|
|
1560
|
-
items=
|
|
1342
|
+
items=[path],
|
|
1561
1343
|
is_absorb=True,
|
|
1562
|
-
kid=[pytag,
|
|
1344
|
+
kid=[pytag, path],
|
|
1563
1345
|
)
|
|
1564
1346
|
return ret
|
|
1565
|
-
ret =
|
|
1566
|
-
hint=pytag,
|
|
1347
|
+
ret = uni.Import(
|
|
1567
1348
|
from_loc=path,
|
|
1568
1349
|
items=items,
|
|
1569
1350
|
is_absorb=False,
|
|
1570
|
-
kid=[pytag, path, items],
|
|
1351
|
+
kid=[pytag, path, *items],
|
|
1571
1352
|
)
|
|
1572
1353
|
return ret
|
|
1573
1354
|
|
|
1574
|
-
def proc_joined_str(self, node: py_ast.JoinedStr) ->
|
|
1355
|
+
def proc_joined_str(self, node: py_ast.JoinedStr) -> uni.FString:
|
|
1575
1356
|
"""Process python node.
|
|
1576
1357
|
|
|
1577
1358
|
class JoinedStr(expr):
|
|
@@ -1581,14 +1362,14 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1581
1362
|
"""
|
|
1582
1363
|
values = [self.convert(value) for value in node.values]
|
|
1583
1364
|
valid = [
|
|
1584
|
-
value for value in values if isinstance(value, (
|
|
1365
|
+
value for value in values if isinstance(value, (uni.String, uni.ExprStmt))
|
|
1585
1366
|
]
|
|
1586
|
-
|
|
1587
|
-
|
|
1367
|
+
return uni.FString(
|
|
1368
|
+
parts=valid,
|
|
1369
|
+
kid=[*valid] if valid else [uni.EmptyToken()],
|
|
1588
1370
|
)
|
|
1589
|
-
return ast.FString(parts=valid_values, kid=[valid_values])
|
|
1590
1371
|
|
|
1591
|
-
def proc_lambda(self, node: py_ast.Lambda) ->
|
|
1372
|
+
def proc_lambda(self, node: py_ast.Lambda) -> uni.LambdaExpr:
|
|
1592
1373
|
"""Process python node.
|
|
1593
1374
|
|
|
1594
1375
|
class Lambda(expr):
|
|
@@ -1597,12 +1378,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1597
1378
|
"""
|
|
1598
1379
|
args = self.convert(node.args)
|
|
1599
1380
|
body = self.convert(node.body)
|
|
1600
|
-
if isinstance(args,
|
|
1601
|
-
return
|
|
1381
|
+
if isinstance(args, uni.FuncSignature) and isinstance(body, uni.Expr):
|
|
1382
|
+
return uni.LambdaExpr(signature=args, body=body, kid=[args, body])
|
|
1602
1383
|
else:
|
|
1603
1384
|
raise self.ice()
|
|
1604
1385
|
|
|
1605
|
-
def proc_list(self, node: py_ast.List) ->
|
|
1386
|
+
def proc_list(self, node: py_ast.List) -> uni.ListVal:
|
|
1606
1387
|
"""Process python node.
|
|
1607
1388
|
|
|
1608
1389
|
class List(expr):
|
|
@@ -1610,23 +1391,17 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1610
1391
|
ctx: expr_context
|
|
1611
1392
|
"""
|
|
1612
1393
|
elts = [self.convert(elt) for elt in node.elts]
|
|
1613
|
-
valid_elts = [elt for elt in elts if isinstance(elt,
|
|
1394
|
+
valid_elts = [elt for elt in elts if isinstance(elt, uni.Expr)]
|
|
1614
1395
|
if len(valid_elts) != len(elts):
|
|
1615
1396
|
raise self.ice("Length mismatch in list elements")
|
|
1616
1397
|
l_square = self.operator(Tok.LSQUARE, "[")
|
|
1617
1398
|
r_square = self.operator(Tok.RSQUARE, "]")
|
|
1618
|
-
return
|
|
1619
|
-
values=
|
|
1620
|
-
ast.SubNodeList[ast.Expr](
|
|
1621
|
-
items=valid_elts, delim=Tok.COMMA, kid=valid_elts
|
|
1622
|
-
)
|
|
1623
|
-
if valid_elts
|
|
1624
|
-
else None
|
|
1625
|
-
),
|
|
1399
|
+
return uni.ListVal(
|
|
1400
|
+
values=valid_elts,
|
|
1626
1401
|
kid=[*valid_elts] if valid_elts else [l_square, r_square],
|
|
1627
1402
|
)
|
|
1628
1403
|
|
|
1629
|
-
def proc_list_comp(self, node: py_ast.ListComp) ->
|
|
1404
|
+
def proc_list_comp(self, node: py_ast.ListComp) -> uni.ListCompr:
|
|
1630
1405
|
"""Process python node.
|
|
1631
1406
|
|
|
1632
1407
|
class ListComp(expr):
|
|
@@ -1635,16 +1410,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1635
1410
|
"""
|
|
1636
1411
|
elt = self.convert(node.elt)
|
|
1637
1412
|
generators = [self.convert(gen) for gen in node.generators]
|
|
1638
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1413
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
1639
1414
|
if len(generators) != len(valid):
|
|
1640
1415
|
raise self.ice("Length mismatch in list comp generators")
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
return ast.ListCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
1416
|
+
if isinstance(elt, uni.Expr):
|
|
1417
|
+
return uni.ListCompr(out_expr=elt, compr=valid, kid=[elt, *valid])
|
|
1644
1418
|
else:
|
|
1645
1419
|
raise self.ice()
|
|
1646
1420
|
|
|
1647
|
-
def proc_match(self, node: py_ast.Match) ->
|
|
1421
|
+
def proc_match(self, node: py_ast.Match) -> uni.MatchStmt:
|
|
1648
1422
|
"""Process python node.
|
|
1649
1423
|
|
|
1650
1424
|
class Match(stmt):
|
|
@@ -1653,13 +1427,13 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1653
1427
|
"""
|
|
1654
1428
|
subject = self.convert(node.subject)
|
|
1655
1429
|
cases = [self.convert(i) for i in node.cases]
|
|
1656
|
-
valid = [case for case in cases if isinstance(case,
|
|
1657
|
-
if isinstance(subject,
|
|
1658
|
-
return
|
|
1430
|
+
valid = [case for case in cases if isinstance(case, uni.MatchCase)]
|
|
1431
|
+
if isinstance(subject, uni.Expr):
|
|
1432
|
+
return uni.MatchStmt(target=subject, cases=valid, kid=[subject, *valid])
|
|
1659
1433
|
else:
|
|
1660
1434
|
raise self.ice()
|
|
1661
1435
|
|
|
1662
|
-
def proc_match_as(self, node: py_ast.MatchAs) ->
|
|
1436
|
+
def proc_match_as(self, node: py_ast.MatchAs) -> uni.MatchAs | uni.MatchWild:
|
|
1663
1437
|
"""Process python node.
|
|
1664
1438
|
|
|
1665
1439
|
class MatchAs(pattern):
|
|
@@ -1667,7 +1441,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1667
1441
|
name: _Identifier | None
|
|
1668
1442
|
"""
|
|
1669
1443
|
pattern = self.convert(node.pattern) if node.pattern else None
|
|
1670
|
-
name =
|
|
1444
|
+
name = uni.Name(
|
|
1671
1445
|
orig_src=self.orig_src,
|
|
1672
1446
|
name=Tok.NAME,
|
|
1673
1447
|
value=node.name if node.name else "_",
|
|
@@ -1683,16 +1457,20 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1683
1457
|
pos_end=0,
|
|
1684
1458
|
)
|
|
1685
1459
|
|
|
1686
|
-
if
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
)
|
|
1692
|
-
|
|
1693
|
-
|
|
1460
|
+
if (
|
|
1461
|
+
name.value == "_"
|
|
1462
|
+
or pattern is not None
|
|
1463
|
+
and not isinstance(pattern, uni.MatchPattern)
|
|
1464
|
+
):
|
|
1465
|
+
return uni.MatchWild(kid=[name])
|
|
1466
|
+
|
|
1467
|
+
return uni.MatchAs(
|
|
1468
|
+
name=name,
|
|
1469
|
+
pattern=pattern,
|
|
1470
|
+
kid=[name] if pattern is None else [name, pattern],
|
|
1471
|
+
)
|
|
1694
1472
|
|
|
1695
|
-
def proc_match_class(self, node: py_ast.MatchClass) ->
|
|
1473
|
+
def proc_match_class(self, node: py_ast.MatchClass) -> uni.MatchArch:
|
|
1696
1474
|
"""Process python node.
|
|
1697
1475
|
|
|
1698
1476
|
class MatchClass(pattern):
|
|
@@ -1705,23 +1483,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1705
1483
|
kid = [cls]
|
|
1706
1484
|
if len(node.patterns) != 0:
|
|
1707
1485
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1708
|
-
valid_patterns = [i for i in patterns if isinstance(i,
|
|
1486
|
+
valid_patterns = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1709
1487
|
if len(patterns) == len(valid_patterns):
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
)
|
|
1713
|
-
kid.append(patterns_sub)
|
|
1488
|
+
kid.extend(valid_patterns)
|
|
1489
|
+
patterns_list = valid_patterns
|
|
1714
1490
|
else:
|
|
1715
1491
|
raise self.ice()
|
|
1716
1492
|
else:
|
|
1717
|
-
|
|
1493
|
+
patterns_list = None
|
|
1718
1494
|
|
|
1719
1495
|
if len(node.kwd_patterns):
|
|
1720
|
-
names: list[
|
|
1721
|
-
kv_pairs: list[
|
|
1496
|
+
names: list[uni.Name] = []
|
|
1497
|
+
kv_pairs: list[uni.MatchKVPair] = []
|
|
1722
1498
|
for kwd_attrs in node.kwd_attrs:
|
|
1723
1499
|
names.append(
|
|
1724
|
-
|
|
1500
|
+
uni.Name(
|
|
1725
1501
|
orig_src=self.orig_src,
|
|
1726
1502
|
name=Tok.NAME,
|
|
1727
1503
|
value=kwd_attrs,
|
|
@@ -1735,30 +1511,32 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1735
1511
|
)
|
|
1736
1512
|
kwd_patterns = [self.convert(i) for i in node.kwd_patterns]
|
|
1737
1513
|
valid_kwd_patterns = [
|
|
1738
|
-
i for i in kwd_patterns if isinstance(i,
|
|
1514
|
+
i for i in kwd_patterns if isinstance(i, uni.MatchPattern)
|
|
1739
1515
|
]
|
|
1740
1516
|
for i in range(len(kwd_patterns)):
|
|
1741
1517
|
kv_pairs.append(
|
|
1742
|
-
|
|
1518
|
+
uni.MatchKVPair(
|
|
1743
1519
|
key=names[i],
|
|
1744
1520
|
value=valid_kwd_patterns[i],
|
|
1745
1521
|
kid=[names[i], valid_kwd_patterns[i]],
|
|
1746
1522
|
)
|
|
1747
1523
|
)
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
kid.append(kw_patterns)
|
|
1524
|
+
|
|
1525
|
+
kid.extend(kv_pairs)
|
|
1526
|
+
kw_patterns_list = kv_pairs
|
|
1752
1527
|
else:
|
|
1753
|
-
|
|
1754
|
-
if isinstance(cls, (
|
|
1755
|
-
return
|
|
1756
|
-
name=cls,
|
|
1528
|
+
kw_patterns_list = None
|
|
1529
|
+
if isinstance(cls, (uni.NameAtom, uni.AtomTrailer)):
|
|
1530
|
+
return uni.MatchArch(
|
|
1531
|
+
name=cls,
|
|
1532
|
+
arg_patterns=patterns_list,
|
|
1533
|
+
kw_patterns=kw_patterns_list,
|
|
1534
|
+
kid=kid,
|
|
1757
1535
|
)
|
|
1758
1536
|
else:
|
|
1759
1537
|
raise self.ice()
|
|
1760
1538
|
|
|
1761
|
-
def proc_match_mapping(self, node: py_ast.MatchMapping) ->
|
|
1539
|
+
def proc_match_mapping(self, node: py_ast.MatchMapping) -> uni.MatchMapping:
|
|
1762
1540
|
"""Process python node.
|
|
1763
1541
|
|
|
1764
1542
|
class MatchMapping(pattern):
|
|
@@ -1766,22 +1544,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1766
1544
|
patterns: list[pattern]
|
|
1767
1545
|
rest: _Identifier | None
|
|
1768
1546
|
"""
|
|
1769
|
-
values: list[
|
|
1547
|
+
values: list[uni.MatchKVPair | uni.MatchStar] = []
|
|
1770
1548
|
keys = [self.convert(i) for i in node.keys]
|
|
1771
1549
|
valid_keys = [
|
|
1772
|
-
i
|
|
1550
|
+
i
|
|
1551
|
+
for i in keys
|
|
1552
|
+
if isinstance(i, (uni.MatchPattern, uni.NameAtom, uni.AtomExpr))
|
|
1773
1553
|
]
|
|
1774
1554
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1775
|
-
valid_patterns = [i for i in patterns if isinstance(i,
|
|
1555
|
+
valid_patterns = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1776
1556
|
for i in range(len(valid_keys)):
|
|
1777
|
-
kv_pair =
|
|
1557
|
+
kv_pair = uni.MatchKVPair(
|
|
1778
1558
|
key=valid_keys[i],
|
|
1779
1559
|
value=valid_patterns[i],
|
|
1780
1560
|
kid=[valid_keys[i], valid_patterns[i]],
|
|
1781
1561
|
)
|
|
1782
1562
|
values.append(kv_pair)
|
|
1783
1563
|
if node.rest:
|
|
1784
|
-
name =
|
|
1564
|
+
name = uni.Name(
|
|
1785
1565
|
orig_src=self.orig_src,
|
|
1786
1566
|
name=Tok.NAME,
|
|
1787
1567
|
value=node.rest,
|
|
@@ -1792,40 +1572,40 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1792
1572
|
pos_start=0,
|
|
1793
1573
|
pos_end=0,
|
|
1794
1574
|
)
|
|
1795
|
-
values.append(
|
|
1796
|
-
return
|
|
1575
|
+
values.append(uni.MatchStar(name=name, is_list=False, kid=[name]))
|
|
1576
|
+
return uni.MatchMapping(values=values, kid=values)
|
|
1797
1577
|
|
|
1798
|
-
def proc_match_or(self, node: py_ast.MatchOr) ->
|
|
1578
|
+
def proc_match_or(self, node: py_ast.MatchOr) -> uni.MatchOr:
|
|
1799
1579
|
"""Process python node.
|
|
1800
1580
|
|
|
1801
1581
|
class MatchOr(pattern):
|
|
1802
1582
|
patterns: list[pattern]
|
|
1803
1583
|
"""
|
|
1804
1584
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1805
|
-
valid = [i for i in patterns if isinstance(i,
|
|
1806
|
-
return
|
|
1585
|
+
valid = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1586
|
+
return uni.MatchOr(patterns=valid, kid=valid)
|
|
1807
1587
|
|
|
1808
|
-
def proc_match_sequence(self, node: py_ast.MatchSequence) ->
|
|
1588
|
+
def proc_match_sequence(self, node: py_ast.MatchSequence) -> uni.MatchSequence:
|
|
1809
1589
|
"""Process python node.
|
|
1810
1590
|
|
|
1811
1591
|
class MatchSequence(pattern):
|
|
1812
1592
|
patterns: list[pattern]
|
|
1813
1593
|
"""
|
|
1814
1594
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1815
|
-
valid = [i for i in patterns if isinstance(i,
|
|
1595
|
+
valid = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1816
1596
|
if len(patterns) == len(valid):
|
|
1817
|
-
return
|
|
1597
|
+
return uni.MatchSequence(values=valid, kid=valid)
|
|
1818
1598
|
else:
|
|
1819
1599
|
raise self.ice()
|
|
1820
1600
|
|
|
1821
|
-
def proc_match_singleton(self, node: py_ast.MatchSingleton) ->
|
|
1601
|
+
def proc_match_singleton(self, node: py_ast.MatchSingleton) -> uni.MatchSingleton:
|
|
1822
1602
|
"""Process python node.
|
|
1823
1603
|
|
|
1824
1604
|
class MatchSingleton(pattern):
|
|
1825
1605
|
value: Literal[True, False] | None
|
|
1826
1606
|
"""
|
|
1827
1607
|
type = Tok.NULL if node.value is None else Tok.BOOL
|
|
1828
|
-
ret_type =
|
|
1608
|
+
ret_type = uni.Null if node.value is None else uni.Bool
|
|
1829
1609
|
value = ret_type(
|
|
1830
1610
|
orig_src=self.orig_src,
|
|
1831
1611
|
name=type,
|
|
@@ -1837,18 +1617,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1837
1617
|
pos_start=0,
|
|
1838
1618
|
pos_end=0,
|
|
1839
1619
|
)
|
|
1840
|
-
if isinstance(value, (
|
|
1841
|
-
return
|
|
1620
|
+
if isinstance(value, (uni.Bool, uni.Null)):
|
|
1621
|
+
return uni.MatchSingleton(value=value, kid=[value])
|
|
1842
1622
|
else:
|
|
1843
1623
|
raise self.ice()
|
|
1844
1624
|
|
|
1845
|
-
def proc_match_star(self, node: py_ast.MatchStar) ->
|
|
1625
|
+
def proc_match_star(self, node: py_ast.MatchStar) -> uni.MatchStar:
|
|
1846
1626
|
"""Process python node.
|
|
1847
1627
|
|
|
1848
1628
|
class MatchStar(pattern):
|
|
1849
1629
|
name: _Identifier | None
|
|
1850
1630
|
"""
|
|
1851
|
-
name =
|
|
1631
|
+
name = uni.Name(
|
|
1852
1632
|
orig_src=self.orig_src,
|
|
1853
1633
|
name=Tok.NAME,
|
|
1854
1634
|
value=node.name if node.name else "_",
|
|
@@ -1859,21 +1639,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1859
1639
|
pos_start=0,
|
|
1860
1640
|
pos_end=0,
|
|
1861
1641
|
)
|
|
1862
|
-
return
|
|
1642
|
+
return uni.MatchStar(name=name, is_list=True, kid=[name])
|
|
1863
1643
|
|
|
1864
|
-
def proc_match_value(self, node: py_ast.MatchValue) ->
|
|
1644
|
+
def proc_match_value(self, node: py_ast.MatchValue) -> uni.MatchValue:
|
|
1865
1645
|
"""Process python node.
|
|
1866
1646
|
|
|
1867
1647
|
class MatchValue(pattern):
|
|
1868
1648
|
value: expr
|
|
1869
1649
|
"""
|
|
1870
1650
|
value = self.convert(node.value)
|
|
1871
|
-
if isinstance(value,
|
|
1872
|
-
return
|
|
1651
|
+
if isinstance(value, uni.Expr):
|
|
1652
|
+
return uni.MatchValue(value=value, kid=[value])
|
|
1873
1653
|
else:
|
|
1874
1654
|
raise self.ice()
|
|
1875
1655
|
|
|
1876
|
-
def proc_name(self, node: py_ast.Name) ->
|
|
1656
|
+
def proc_name(self, node: py_ast.Name) -> uni.Name:
|
|
1877
1657
|
"""Process python node.
|
|
1878
1658
|
|
|
1879
1659
|
class Name(expr):
|
|
@@ -1891,7 +1671,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1891
1671
|
]
|
|
1892
1672
|
|
|
1893
1673
|
value = node.id if node.id not in reserved_keywords else f"<>{node.id}"
|
|
1894
|
-
ret =
|
|
1674
|
+
ret = uni.Name(
|
|
1895
1675
|
orig_src=self.orig_src,
|
|
1896
1676
|
name=Tok.NAME,
|
|
1897
1677
|
value=value,
|
|
@@ -1904,7 +1684,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1904
1684
|
)
|
|
1905
1685
|
return ret
|
|
1906
1686
|
|
|
1907
|
-
def proc_named_expr(self, node: py_ast.NamedExpr) ->
|
|
1687
|
+
def proc_named_expr(self, node: py_ast.NamedExpr) -> uni.AtomUnit:
|
|
1908
1688
|
"""Process python node.
|
|
1909
1689
|
|
|
1910
1690
|
class NamedExpr(expr):
|
|
@@ -1913,17 +1693,26 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1913
1693
|
"""
|
|
1914
1694
|
target = self.convert(node.target)
|
|
1915
1695
|
value = self.convert(node.value)
|
|
1916
|
-
if isinstance(value,
|
|
1917
|
-
|
|
1696
|
+
if isinstance(value, uni.Expr) and isinstance(target, uni.Name):
|
|
1697
|
+
op = self.operator(Tok.WALRUS_EQ, ":=")
|
|
1698
|
+
expr = uni.BinaryExpr(
|
|
1918
1699
|
left=target,
|
|
1919
|
-
op=
|
|
1700
|
+
op=op,
|
|
1920
1701
|
right=value,
|
|
1921
|
-
kid=[target, value],
|
|
1702
|
+
kid=[target, op, value],
|
|
1703
|
+
)
|
|
1704
|
+
return uni.AtomUnit(
|
|
1705
|
+
value=expr,
|
|
1706
|
+
kid=[
|
|
1707
|
+
self.operator(Tok.RPAREN, "("),
|
|
1708
|
+
expr,
|
|
1709
|
+
self.operator(Tok.LPAREN, ")"),
|
|
1710
|
+
],
|
|
1922
1711
|
)
|
|
1923
1712
|
else:
|
|
1924
1713
|
raise self.ice()
|
|
1925
1714
|
|
|
1926
|
-
def proc_nonlocal(self, node: py_ast.Nonlocal) ->
|
|
1715
|
+
def proc_nonlocal(self, node: py_ast.Nonlocal) -> uni.NonLocalStmt:
|
|
1927
1716
|
"""Process python node.
|
|
1928
1717
|
|
|
1929
1718
|
class Nonlocal(stmt):
|
|
@@ -1933,11 +1722,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1933
1722
|
|
|
1934
1723
|
reserved_keywords = [v for _, v in TOKEN_MAP.items()]
|
|
1935
1724
|
|
|
1936
|
-
names: list[
|
|
1725
|
+
names: list[uni.NameAtom] = []
|
|
1937
1726
|
for name in node.names:
|
|
1938
1727
|
value = name if name not in reserved_keywords else f"<>{name}"
|
|
1939
1728
|
names.append(
|
|
1940
|
-
|
|
1729
|
+
uni.Name(
|
|
1941
1730
|
orig_src=self.orig_src,
|
|
1942
1731
|
name=Tok.NAME,
|
|
1943
1732
|
value=value,
|
|
@@ -1949,12 +1738,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1949
1738
|
pos_end=0,
|
|
1950
1739
|
)
|
|
1951
1740
|
)
|
|
1952
|
-
|
|
1953
|
-
return ast.NonLocalStmt(target=target, kid=names)
|
|
1741
|
+
return uni.NonLocalStmt(target=names, kid=names)
|
|
1954
1742
|
|
|
1955
|
-
def proc_pass(self, node: py_ast.Pass) ->
|
|
1743
|
+
def proc_pass(self, node: py_ast.Pass) -> uni.Semi:
|
|
1956
1744
|
"""Process python node."""
|
|
1957
|
-
return
|
|
1745
|
+
return uni.Semi(
|
|
1958
1746
|
orig_src=self.orig_src,
|
|
1959
1747
|
name=Tok.SEMI,
|
|
1960
1748
|
value=";",
|
|
@@ -1966,7 +1754,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1966
1754
|
pos_end=0,
|
|
1967
1755
|
)
|
|
1968
1756
|
|
|
1969
|
-
def proc_set(self, node: py_ast.Set) ->
|
|
1757
|
+
def proc_set(self, node: py_ast.Set) -> uni.SetVal:
|
|
1970
1758
|
"""Process python node.
|
|
1971
1759
|
|
|
1972
1760
|
class Set(expr):
|
|
@@ -1974,21 +1762,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1974
1762
|
"""
|
|
1975
1763
|
if len(node.elts) != 0:
|
|
1976
1764
|
elts = [self.convert(i) for i in node.elts]
|
|
1977
|
-
valid = [i for i in elts if isinstance(i, (
|
|
1765
|
+
valid = [i for i in elts if isinstance(i, (uni.Expr))]
|
|
1978
1766
|
if len(valid) != len(elts):
|
|
1979
1767
|
raise self.ice("Length mismatch in set body")
|
|
1980
|
-
|
|
1981
|
-
items=valid, delim=Tok.COMMA, kid=valid
|
|
1982
|
-
)
|
|
1983
|
-
kid: list[ast.AstNode] = [*valid]
|
|
1768
|
+
kid: list[uni.UniNode] = [*valid]
|
|
1984
1769
|
else:
|
|
1985
|
-
|
|
1770
|
+
valid = []
|
|
1986
1771
|
l_brace = self.operator(Tok.LBRACE, "{")
|
|
1987
1772
|
r_brace = self.operator(Tok.RBRACE, "}")
|
|
1988
1773
|
kid = [l_brace, r_brace]
|
|
1989
|
-
return
|
|
1774
|
+
return uni.SetVal(values=valid, kid=kid)
|
|
1990
1775
|
|
|
1991
|
-
def proc_set_comp(self, node: py_ast.SetComp) ->
|
|
1776
|
+
def proc_set_comp(self, node: py_ast.SetComp) -> uni.ListCompr:
|
|
1992
1777
|
"""Process python node.
|
|
1993
1778
|
|
|
1994
1779
|
class SetComp(expr):
|
|
@@ -1997,16 +1782,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1997
1782
|
"""
|
|
1998
1783
|
elt = self.convert(node.elt)
|
|
1999
1784
|
generators = [self.convert(gen) for gen in node.generators]
|
|
2000
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1785
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
2001
1786
|
if len(generators) != len(valid):
|
|
2002
1787
|
raise self.ice("Length mismatch in list comp generators")
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
return ast.SetCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
1788
|
+
if isinstance(elt, uni.Expr):
|
|
1789
|
+
return uni.SetCompr(out_expr=elt, compr=valid, kid=[elt, *valid])
|
|
2006
1790
|
else:
|
|
2007
1791
|
raise self.ice()
|
|
2008
1792
|
|
|
2009
|
-
def proc_slice(self, node: py_ast.Slice) ->
|
|
1793
|
+
def proc_slice(self, node: py_ast.Slice) -> uni.IndexSlice:
|
|
2010
1794
|
"""Process python node.
|
|
2011
1795
|
|
|
2012
1796
|
class Slice(_Slice):
|
|
@@ -2021,19 +1805,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2021
1805
|
if not valid_kid:
|
|
2022
1806
|
valid_kid = [self.operator(Tok.COLON, ":")]
|
|
2023
1807
|
if (
|
|
2024
|
-
(isinstance(lower,
|
|
2025
|
-
and (isinstance(upper,
|
|
2026
|
-
and (isinstance(step,
|
|
1808
|
+
(isinstance(lower, uni.Expr) or lower is None)
|
|
1809
|
+
and (isinstance(upper, uni.Expr) or upper is None)
|
|
1810
|
+
and (isinstance(step, uni.Expr) or step is None)
|
|
2027
1811
|
):
|
|
2028
|
-
return
|
|
2029
|
-
slices=[
|
|
1812
|
+
return uni.IndexSlice(
|
|
1813
|
+
slices=[uni.IndexSlice.Slice(lower, upper, step)],
|
|
2030
1814
|
is_range=True,
|
|
2031
1815
|
kid=valid_kid,
|
|
2032
1816
|
)
|
|
2033
1817
|
else:
|
|
2034
1818
|
raise self.ice()
|
|
2035
1819
|
|
|
2036
|
-
def proc_starred(self, node: py_ast.Starred) ->
|
|
1820
|
+
def proc_starred(self, node: py_ast.Starred) -> uni.UnaryExpr:
|
|
2037
1821
|
"""Process python node.
|
|
2038
1822
|
|
|
2039
1823
|
class Starred(expr):
|
|
@@ -2042,12 +1826,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2042
1826
|
"""
|
|
2043
1827
|
star_tok = self.operator(Tok.STAR_MUL, "*")
|
|
2044
1828
|
value = self.convert(node.value)
|
|
2045
|
-
if isinstance(value,
|
|
2046
|
-
return
|
|
1829
|
+
if isinstance(value, uni.Expr):
|
|
1830
|
+
return uni.UnaryExpr(operand=value, op=star_tok, kid=[value, star_tok])
|
|
2047
1831
|
else:
|
|
2048
1832
|
raise self.ice()
|
|
2049
1833
|
|
|
2050
|
-
def proc_subscript(self, node: py_ast.Subscript) ->
|
|
1834
|
+
def proc_subscript(self, node: py_ast.Subscript) -> uni.AtomTrailer:
|
|
2051
1835
|
"""Process python node.
|
|
2052
1836
|
|
|
2053
1837
|
class Subscript(expr):
|
|
@@ -2057,32 +1841,32 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2057
1841
|
"""
|
|
2058
1842
|
value = self.convert(node.value)
|
|
2059
1843
|
slice = self.convert(node.slice)
|
|
2060
|
-
if not isinstance(slice,
|
|
2061
|
-
slice =
|
|
2062
|
-
slices=[
|
|
1844
|
+
if not isinstance(slice, uni.IndexSlice) and isinstance(slice, uni.Expr):
|
|
1845
|
+
slice = uni.IndexSlice(
|
|
1846
|
+
slices=[uni.IndexSlice.Slice(slice, None, None)],
|
|
2063
1847
|
is_range=False,
|
|
2064
1848
|
kid=[slice],
|
|
2065
1849
|
)
|
|
2066
1850
|
if (
|
|
2067
|
-
not isinstance(slice,
|
|
2068
|
-
and isinstance(slice,
|
|
2069
|
-
and slice.values
|
|
1851
|
+
not isinstance(slice, uni.IndexSlice)
|
|
1852
|
+
and isinstance(slice, uni.TupleVal)
|
|
1853
|
+
and slice.values
|
|
2070
1854
|
):
|
|
2071
1855
|
|
|
2072
|
-
slices: list[
|
|
2073
|
-
for index_slice in slice.values
|
|
2074
|
-
if not isinstance(index_slice,
|
|
1856
|
+
slices: list[uni.IndexSlice.Slice] = []
|
|
1857
|
+
for index_slice in slice.values:
|
|
1858
|
+
if not isinstance(index_slice, uni.IndexSlice):
|
|
2075
1859
|
raise self.ice()
|
|
2076
1860
|
slices.append(index_slice.slices[0])
|
|
2077
1861
|
|
|
2078
|
-
slice =
|
|
1862
|
+
slice = uni.IndexSlice(
|
|
2079
1863
|
slices=slices,
|
|
2080
1864
|
is_range=True,
|
|
2081
1865
|
kid=[slice],
|
|
2082
1866
|
)
|
|
2083
1867
|
|
|
2084
|
-
if isinstance(value,
|
|
2085
|
-
return
|
|
1868
|
+
if isinstance(value, uni.Expr) and isinstance(slice, uni.IndexSlice):
|
|
1869
|
+
return uni.AtomTrailer(
|
|
2086
1870
|
target=value,
|
|
2087
1871
|
right=slice,
|
|
2088
1872
|
is_attr=False,
|
|
@@ -2092,7 +1876,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2092
1876
|
else:
|
|
2093
1877
|
raise self.ice()
|
|
2094
1878
|
|
|
2095
|
-
def proc_try(self, node: py_ast.Try | py_ast.TryStar) ->
|
|
1879
|
+
def proc_try(self, node: py_ast.Try | py_ast.TryStar) -> uni.TryStmt:
|
|
2096
1880
|
"""Process python node.
|
|
2097
1881
|
|
|
2098
1882
|
class Try(stmt):
|
|
@@ -2102,76 +1886,59 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2102
1886
|
finalbody: list[stmt]
|
|
2103
1887
|
"""
|
|
2104
1888
|
body = [self.convert(i) for i in node.body]
|
|
2105
|
-
valid = [i for i in body if isinstance(i, (
|
|
1889
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
2106
1890
|
if len(valid) != len(body):
|
|
2107
1891
|
raise self.ice("Length mismatch in try body")
|
|
2108
|
-
valid_body =
|
|
2109
|
-
|
|
2110
|
-
delim=Tok.WS,
|
|
2111
|
-
kid=valid,
|
|
2112
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
2113
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
2114
|
-
)
|
|
2115
|
-
kid: list[ast.AstNode] = [valid_body]
|
|
1892
|
+
valid_body = valid
|
|
1893
|
+
kid: list[uni.UniNode] = [*valid_body]
|
|
2116
1894
|
|
|
2117
1895
|
if len(node.handlers) != 0:
|
|
2118
1896
|
handlers = [self.convert(i) for i in node.handlers]
|
|
2119
|
-
valid_handlers = [i for i in handlers if isinstance(i, (
|
|
1897
|
+
valid_handlers = [i for i in handlers if isinstance(i, (uni.Except))]
|
|
2120
1898
|
if len(handlers) != len(valid_handlers):
|
|
2121
1899
|
raise self.ice("Length mismatch in try handlers")
|
|
2122
|
-
excepts =
|
|
2123
|
-
|
|
2124
|
-
)
|
|
2125
|
-
kid.append(excepts)
|
|
1900
|
+
excepts = valid_handlers
|
|
1901
|
+
kid.extend(valid_handlers)
|
|
2126
1902
|
else:
|
|
2127
|
-
excepts =
|
|
1903
|
+
excepts = []
|
|
2128
1904
|
|
|
2129
1905
|
if len(node.orelse) != 0:
|
|
2130
1906
|
orelse = [self.convert(i) for i in node.orelse]
|
|
2131
|
-
valid_orelse = [i for i in orelse if isinstance(i, (
|
|
1907
|
+
valid_orelse = [i for i in orelse if isinstance(i, (uni.CodeBlockStmt))]
|
|
2132
1908
|
if len(orelse) != len(valid_orelse):
|
|
2133
1909
|
raise self.ice("Length mismatch in try orelse")
|
|
2134
|
-
else_body =
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
kid=valid_orelse,
|
|
2138
|
-
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
2139
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
2140
|
-
)
|
|
2141
|
-
elsestmt = ast.ElseStmt(body=else_body, kid=[else_body])
|
|
2142
|
-
kid.append(else_body)
|
|
1910
|
+
else_body = valid_orelse
|
|
1911
|
+
elsestmt = uni.ElseStmt(body=else_body, kid=else_body)
|
|
1912
|
+
kid.extend(else_body)
|
|
2143
1913
|
else:
|
|
2144
1914
|
else_body = None
|
|
2145
1915
|
|
|
2146
1916
|
if len(node.finalbody) != 0:
|
|
2147
1917
|
finalbody = [self.convert(i) for i in node.finalbody]
|
|
2148
1918
|
valid_finalbody = [
|
|
2149
|
-
i for i in finalbody if isinstance(i, (
|
|
1919
|
+
i for i in finalbody if isinstance(i, (uni.CodeBlockStmt))
|
|
2150
1920
|
]
|
|
2151
1921
|
if len(finalbody) != len(valid_finalbody):
|
|
2152
1922
|
raise self.ice("Length mismatch in try finalbody")
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
1923
|
+
finally_stmt_obj: Optional[uni.FinallyStmt] = (
|
|
1924
|
+
fin_append := uni.FinallyStmt(
|
|
1925
|
+
body=valid_finalbody,
|
|
1926
|
+
kid=valid_finalbody,
|
|
1927
|
+
)
|
|
2159
1928
|
)
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
kid.append(finally_stmt)
|
|
1929
|
+
kid.append(fin_append)
|
|
2163
1930
|
else:
|
|
2164
|
-
|
|
2165
|
-
ret =
|
|
1931
|
+
finally_stmt_obj = None
|
|
1932
|
+
ret = uni.TryStmt(
|
|
2166
1933
|
body=valid_body,
|
|
2167
1934
|
excepts=excepts,
|
|
2168
1935
|
else_body=elsestmt if else_body else None,
|
|
2169
|
-
finally_body=
|
|
1936
|
+
finally_body=finally_stmt_obj,
|
|
2170
1937
|
kid=kid,
|
|
2171
1938
|
)
|
|
2172
1939
|
return ret
|
|
2173
1940
|
|
|
2174
|
-
def proc_try_star(self, node: py_ast.TryStar) ->
|
|
1941
|
+
def proc_try_star(self, node: py_ast.TryStar) -> uni.TryStmt:
|
|
2175
1942
|
"""Process python node.
|
|
2176
1943
|
|
|
2177
1944
|
class Try(stmt):
|
|
@@ -2182,7 +1949,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2182
1949
|
"""
|
|
2183
1950
|
return self.proc_try(node)
|
|
2184
1951
|
|
|
2185
|
-
def proc_tuple(self, node: py_ast.Tuple) ->
|
|
1952
|
+
def proc_tuple(self, node: py_ast.Tuple) -> uni.TupleVal:
|
|
2186
1953
|
"""Process python node.
|
|
2187
1954
|
|
|
2188
1955
|
class Tuple(expr):
|
|
@@ -2191,52 +1958,49 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2191
1958
|
"""
|
|
2192
1959
|
elts = [self.convert(elt) for elt in node.elts]
|
|
2193
1960
|
if len(node.elts) != 0:
|
|
2194
|
-
|
|
2195
|
-
if len(elts) != len(
|
|
1961
|
+
valid_elts = [i for i in elts if isinstance(i, (uni.Expr, uni.KWPair))]
|
|
1962
|
+
if len(elts) != len(valid_elts):
|
|
2196
1963
|
raise self.ice("Length mismatch in tuple elts")
|
|
2197
|
-
valid_elts = ast.SubNodeList[ast.Expr | ast.KWPair](
|
|
2198
|
-
items=valid, delim=Tok.COMMA, kid=valid
|
|
2199
|
-
)
|
|
2200
1964
|
kid = elts
|
|
2201
1965
|
else:
|
|
2202
1966
|
l_paren = self.operator(Tok.LPAREN, "(")
|
|
2203
1967
|
r_paren = self.operator(Tok.RPAREN, ")")
|
|
2204
|
-
valid_elts =
|
|
1968
|
+
valid_elts = []
|
|
2205
1969
|
kid = [l_paren, r_paren]
|
|
2206
|
-
return
|
|
1970
|
+
return uni.TupleVal(values=valid_elts, kid=kid)
|
|
2207
1971
|
|
|
2208
|
-
def proc_yield(self, node: py_ast.Yield) ->
|
|
1972
|
+
def proc_yield(self, node: py_ast.Yield) -> uni.YieldExpr:
|
|
2209
1973
|
"""Process python node.
|
|
2210
1974
|
|
|
2211
1975
|
class Yield(expr):
|
|
2212
1976
|
value: expr | None
|
|
2213
1977
|
"""
|
|
2214
1978
|
value = self.convert(node.value) if node.value else None
|
|
2215
|
-
if isinstance(value,
|
|
2216
|
-
return
|
|
1979
|
+
if isinstance(value, uni.Expr):
|
|
1980
|
+
return uni.YieldExpr(expr=value, with_from=False, kid=[value])
|
|
2217
1981
|
elif not value:
|
|
2218
|
-
return
|
|
1982
|
+
return uni.YieldExpr(
|
|
2219
1983
|
expr=None, with_from=False, kid=[self.operator(Tok.KW_YIELD, "yield")]
|
|
2220
1984
|
)
|
|
2221
1985
|
else:
|
|
2222
1986
|
raise self.ice()
|
|
2223
1987
|
|
|
2224
|
-
def proc_yield_from(self, node: py_ast.YieldFrom) ->
|
|
1988
|
+
def proc_yield_from(self, node: py_ast.YieldFrom) -> uni.YieldExpr:
|
|
2225
1989
|
"""Process python node."""
|
|
2226
1990
|
value = self.convert(node.value)
|
|
2227
|
-
if isinstance(value,
|
|
2228
|
-
return
|
|
1991
|
+
if isinstance(value, uni.Expr):
|
|
1992
|
+
return uni.YieldExpr(expr=value, with_from=True, kid=[value])
|
|
2229
1993
|
else:
|
|
2230
1994
|
raise self.ice()
|
|
2231
1995
|
|
|
2232
|
-
def proc_alias(self, node: py_ast.alias) ->
|
|
1996
|
+
def proc_alias(self, node: py_ast.alias) -> uni.ExprAsItem:
|
|
2233
1997
|
"""Process python node.
|
|
2234
1998
|
|
|
2235
1999
|
class alias(AST):
|
|
2236
2000
|
name: _Identifier
|
|
2237
2001
|
asname: _Identifier | None
|
|
2238
2002
|
"""
|
|
2239
|
-
name =
|
|
2003
|
+
name = uni.Name(
|
|
2240
2004
|
orig_src=self.orig_src,
|
|
2241
2005
|
name=Tok.NAME,
|
|
2242
2006
|
value=node.name,
|
|
@@ -2248,7 +2012,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2248
2012
|
pos_end=0,
|
|
2249
2013
|
)
|
|
2250
2014
|
asname = (
|
|
2251
|
-
|
|
2015
|
+
uni.Name(
|
|
2252
2016
|
orig_src=self.orig_src,
|
|
2253
2017
|
name=Tok.NAME,
|
|
2254
2018
|
value=node.asname,
|
|
@@ -2262,11 +2026,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2262
2026
|
if node.asname
|
|
2263
2027
|
else None
|
|
2264
2028
|
)
|
|
2265
|
-
return
|
|
2029
|
+
return uni.ExprAsItem(
|
|
2266
2030
|
expr=name, alias=asname, kid=[name, asname] if asname else [name]
|
|
2267
2031
|
)
|
|
2268
2032
|
|
|
2269
|
-
def proc_arg(self, node: py_ast.arg) ->
|
|
2033
|
+
def proc_arg(self, node: py_ast.arg) -> uni.ParamVar:
|
|
2270
2034
|
"""Process python node.
|
|
2271
2035
|
|
|
2272
2036
|
class arg(AST):
|
|
@@ -2282,7 +2046,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2282
2046
|
]
|
|
2283
2047
|
|
|
2284
2048
|
value = node.arg if node.arg not in reserved_keywords else f"<>{node.arg}"
|
|
2285
|
-
name =
|
|
2049
|
+
name = uni.Name(
|
|
2286
2050
|
orig_src=self.orig_src,
|
|
2287
2051
|
name=Tok.NAME,
|
|
2288
2052
|
value=value,
|
|
@@ -2296,7 +2060,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2296
2060
|
ann_expr = (
|
|
2297
2061
|
self.convert(node.annotation)
|
|
2298
2062
|
if node.annotation
|
|
2299
|
-
else
|
|
2063
|
+
else uni.Name(
|
|
2300
2064
|
orig_src=self.orig_src,
|
|
2301
2065
|
name=Tok.NAME,
|
|
2302
2066
|
value="Any",
|
|
@@ -2308,15 +2072,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2308
2072
|
pos_end=0,
|
|
2309
2073
|
)
|
|
2310
2074
|
)
|
|
2311
|
-
if not isinstance(ann_expr,
|
|
2075
|
+
if not isinstance(ann_expr, uni.Expr):
|
|
2312
2076
|
raise self.ice("Expected annotation to be an expression")
|
|
2313
|
-
annot =
|
|
2314
|
-
paramvar =
|
|
2077
|
+
annot = uni.SubTag[uni.Expr](tag=ann_expr, kid=[ann_expr])
|
|
2078
|
+
paramvar = uni.ParamVar(
|
|
2315
2079
|
name=name, type_tag=annot, unpack=None, value=None, kid=[name, annot]
|
|
2316
2080
|
)
|
|
2317
2081
|
return paramvar
|
|
2318
2082
|
|
|
2319
|
-
def proc_arguments(self, node: py_ast.arguments) ->
|
|
2083
|
+
def proc_arguments(self, node: py_ast.arguments) -> uni.FuncSignature:
|
|
2320
2084
|
"""Process python node.
|
|
2321
2085
|
|
|
2322
2086
|
class arguments(AST):
|
|
@@ -2329,8 +2093,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2329
2093
|
"""
|
|
2330
2094
|
args = [self.convert(arg) for arg in node.args]
|
|
2331
2095
|
vararg = self.convert(node.vararg) if node.vararg else None
|
|
2332
|
-
if vararg and isinstance(vararg,
|
|
2333
|
-
vararg.unpack =
|
|
2096
|
+
if vararg and isinstance(vararg, uni.ParamVar):
|
|
2097
|
+
vararg.unpack = uni.Token(
|
|
2334
2098
|
orig_src=self.orig_src,
|
|
2335
2099
|
name=Tok.STAR_MUL,
|
|
2336
2100
|
value="*",
|
|
@@ -2349,14 +2113,14 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2349
2113
|
kwdefault = self.convert(kwd) if kwd else None
|
|
2350
2114
|
if (
|
|
2351
2115
|
kwdefault
|
|
2352
|
-
and isinstance(kwa,
|
|
2353
|
-
and isinstance(kwdefault,
|
|
2116
|
+
and isinstance(kwa, uni.ParamVar)
|
|
2117
|
+
and isinstance(kwdefault, uni.Expr)
|
|
2354
2118
|
):
|
|
2355
2119
|
kwa.value = kwdefault
|
|
2356
2120
|
kwa.add_kids_right([kwa.value])
|
|
2357
2121
|
kwarg = self.convert(node.kwarg) if node.kwarg else None
|
|
2358
|
-
if kwarg and isinstance(kwarg,
|
|
2359
|
-
kwarg.unpack =
|
|
2122
|
+
if kwarg and isinstance(kwarg, uni.ParamVar):
|
|
2123
|
+
kwarg.unpack = uni.Token(
|
|
2360
2124
|
orig_src=self.orig_src,
|
|
2361
2125
|
name=Tok.STAR_POW,
|
|
2362
2126
|
value="**",
|
|
@@ -2371,7 +2135,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2371
2135
|
defaults = [self.convert(expr) for expr in node.defaults]
|
|
2372
2136
|
params = [*args]
|
|
2373
2137
|
for param, default in zip(params[::-1], defaults[::-1]):
|
|
2374
|
-
if isinstance(default,
|
|
2138
|
+
if isinstance(default, uni.Expr) and isinstance(param, uni.ParamVar):
|
|
2375
2139
|
param.value = default
|
|
2376
2140
|
param.add_kids_right([default])
|
|
2377
2141
|
if vararg:
|
|
@@ -2381,28 +2145,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2381
2145
|
params.append(kwarg)
|
|
2382
2146
|
params += defaults
|
|
2383
2147
|
|
|
2384
|
-
valid_params = [param for param in params if isinstance(param,
|
|
2148
|
+
valid_params = [param for param in params if isinstance(param, uni.ParamVar)]
|
|
2385
2149
|
if valid_params:
|
|
2386
|
-
fs_params =
|
|
2387
|
-
|
|
2388
|
-
)
|
|
2389
|
-
return ast.FuncSignature(
|
|
2150
|
+
fs_params = valid_params
|
|
2151
|
+
return uni.FuncSignature(
|
|
2390
2152
|
params=fs_params,
|
|
2391
2153
|
return_type=None,
|
|
2392
|
-
kid=
|
|
2154
|
+
kid=fs_params,
|
|
2393
2155
|
)
|
|
2394
2156
|
else:
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
return ast.FuncSignature(
|
|
2398
|
-
params=None,
|
|
2157
|
+
return uni.FuncSignature(
|
|
2158
|
+
params=[],
|
|
2399
2159
|
return_type=None,
|
|
2400
|
-
kid=[
|
|
2160
|
+
kid=[self.operator(Tok.LPAREN, "("), self.operator(Tok.RPAREN, ")")],
|
|
2401
2161
|
)
|
|
2402
2162
|
|
|
2403
|
-
def operator(self, tok: Tok, value: str) ->
|
|
2163
|
+
def operator(self, tok: Tok, value: str) -> uni.Token:
|
|
2404
2164
|
"""Create an operator token."""
|
|
2405
|
-
return
|
|
2165
|
+
return uni.Token(
|
|
2406
2166
|
orig_src=self.orig_src,
|
|
2407
2167
|
name=tok,
|
|
2408
2168
|
value=value,
|
|
@@ -2414,123 +2174,123 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2414
2174
|
pos_end=0,
|
|
2415
2175
|
)
|
|
2416
2176
|
|
|
2417
|
-
def proc_and(self, node: py_ast.And) ->
|
|
2177
|
+
def proc_and(self, node: py_ast.And) -> uni.Token:
|
|
2418
2178
|
"""Process python node."""
|
|
2419
2179
|
return self.operator(Tok.KW_AND, "and")
|
|
2420
2180
|
|
|
2421
|
-
def proc_or(self, node: py_ast.Or) ->
|
|
2181
|
+
def proc_or(self, node: py_ast.Or) -> uni.Token:
|
|
2422
2182
|
"""Process python node."""
|
|
2423
2183
|
return self.operator(Tok.KW_OR, "or")
|
|
2424
2184
|
|
|
2425
|
-
def proc_add(self, node: py_ast.Add) ->
|
|
2185
|
+
def proc_add(self, node: py_ast.Add) -> uni.Token:
|
|
2426
2186
|
"""Process python node."""
|
|
2427
2187
|
return self.operator(Tok.PLUS, "+")
|
|
2428
2188
|
|
|
2429
|
-
def proc_bit_and(self, node: py_ast.BitAnd) ->
|
|
2189
|
+
def proc_bit_and(self, node: py_ast.BitAnd) -> uni.Token:
|
|
2430
2190
|
"""Process python node."""
|
|
2431
2191
|
return self.operator(Tok.BW_AND, "&")
|
|
2432
2192
|
|
|
2433
|
-
def proc_bit_or(self, node: py_ast.BitOr) ->
|
|
2193
|
+
def proc_bit_or(self, node: py_ast.BitOr) -> uni.Token:
|
|
2434
2194
|
"""Process python node."""
|
|
2435
2195
|
return self.operator(Tok.BW_OR, "|")
|
|
2436
2196
|
|
|
2437
|
-
def proc_bit_xor(self, node: py_ast.BitXor) ->
|
|
2197
|
+
def proc_bit_xor(self, node: py_ast.BitXor) -> uni.Token:
|
|
2438
2198
|
"""Process python node."""
|
|
2439
2199
|
return self.operator(Tok.BW_XOR, "^")
|
|
2440
2200
|
|
|
2441
|
-
def proc_div(self, node: py_ast.Div) ->
|
|
2201
|
+
def proc_div(self, node: py_ast.Div) -> uni.Token:
|
|
2442
2202
|
"""Process python node."""
|
|
2443
2203
|
return self.operator(Tok.DIV, "/")
|
|
2444
2204
|
|
|
2445
|
-
def proc_floor_div(self, node: py_ast.FloorDiv) ->
|
|
2205
|
+
def proc_floor_div(self, node: py_ast.FloorDiv) -> uni.Token:
|
|
2446
2206
|
"""Process python node."""
|
|
2447
2207
|
return self.operator(Tok.FLOOR_DIV, "//")
|
|
2448
2208
|
|
|
2449
|
-
def proc_l_shift(self, node: py_ast.LShift) ->
|
|
2209
|
+
def proc_l_shift(self, node: py_ast.LShift) -> uni.Token:
|
|
2450
2210
|
"""Process python node."""
|
|
2451
2211
|
return self.operator(Tok.LSHIFT, "<<")
|
|
2452
2212
|
|
|
2453
|
-
def proc_mod(self, node: py_ast.Mod) ->
|
|
2213
|
+
def proc_mod(self, node: py_ast.Mod) -> uni.Token:
|
|
2454
2214
|
"""Process python node."""
|
|
2455
2215
|
return self.operator(Tok.MOD, "%")
|
|
2456
2216
|
|
|
2457
|
-
def proc_mult(self, node: py_ast.Mult) ->
|
|
2217
|
+
def proc_mult(self, node: py_ast.Mult) -> uni.Token:
|
|
2458
2218
|
"""Process python node."""
|
|
2459
2219
|
return self.operator(Tok.STAR_MUL, "*")
|
|
2460
2220
|
|
|
2461
|
-
def proc_mat_mult(self, node: py_ast.MatMult) ->
|
|
2221
|
+
def proc_mat_mult(self, node: py_ast.MatMult) -> uni.Token:
|
|
2462
2222
|
"""Process python node."""
|
|
2463
2223
|
return self.operator(Tok.DECOR_OP, "@")
|
|
2464
2224
|
|
|
2465
|
-
def proc_pow(self, node: py_ast.Pow) ->
|
|
2225
|
+
def proc_pow(self, node: py_ast.Pow) -> uni.Token:
|
|
2466
2226
|
"""Process python node."""
|
|
2467
2227
|
return self.operator(Tok.STAR_POW, "**")
|
|
2468
2228
|
|
|
2469
|
-
def proc_r_shift(self, node: py_ast.RShift) ->
|
|
2229
|
+
def proc_r_shift(self, node: py_ast.RShift) -> uni.Token:
|
|
2470
2230
|
"""Process python node."""
|
|
2471
2231
|
return self.operator(Tok.RSHIFT, ">>")
|
|
2472
2232
|
|
|
2473
|
-
def proc_sub(self, node: py_ast.Sub) ->
|
|
2233
|
+
def proc_sub(self, node: py_ast.Sub) -> uni.Token:
|
|
2474
2234
|
"""Process python node."""
|
|
2475
2235
|
return self.operator(Tok.MINUS, "-")
|
|
2476
2236
|
|
|
2477
|
-
def proc_invert(self, node: py_ast.Invert) ->
|
|
2237
|
+
def proc_invert(self, node: py_ast.Invert) -> uni.Token:
|
|
2478
2238
|
"""Process python node."""
|
|
2479
2239
|
return self.operator(Tok.BW_NOT, "~")
|
|
2480
2240
|
|
|
2481
|
-
def proc_not(self, node: py_ast.Not) ->
|
|
2241
|
+
def proc_not(self, node: py_ast.Not) -> uni.Token:
|
|
2482
2242
|
"""Process python node."""
|
|
2483
2243
|
return self.operator(Tok.NOT, "not")
|
|
2484
2244
|
|
|
2485
|
-
def proc_u_add(self, node: py_ast.UAdd) ->
|
|
2245
|
+
def proc_u_add(self, node: py_ast.UAdd) -> uni.Token:
|
|
2486
2246
|
"""Process python node."""
|
|
2487
2247
|
return self.operator(Tok.PLUS, "+")
|
|
2488
2248
|
|
|
2489
|
-
def proc_u_sub(self, node: py_ast.USub) ->
|
|
2249
|
+
def proc_u_sub(self, node: py_ast.USub) -> uni.Token:
|
|
2490
2250
|
"""Process python node."""
|
|
2491
2251
|
return self.operator(Tok.MINUS, "-")
|
|
2492
2252
|
|
|
2493
|
-
def proc_eq(self, node: py_ast.Eq) ->
|
|
2253
|
+
def proc_eq(self, node: py_ast.Eq) -> uni.Token:
|
|
2494
2254
|
"""Process python node."""
|
|
2495
2255
|
return self.operator(Tok.EE, "==")
|
|
2496
2256
|
|
|
2497
|
-
def proc_gt(self, node: py_ast.Gt) ->
|
|
2257
|
+
def proc_gt(self, node: py_ast.Gt) -> uni.Token:
|
|
2498
2258
|
"""Process python node."""
|
|
2499
2259
|
return self.operator(Tok.GT, ">")
|
|
2500
2260
|
|
|
2501
|
-
def proc_gt_e(self, node: py_ast.GtE) ->
|
|
2261
|
+
def proc_gt_e(self, node: py_ast.GtE) -> uni.Token:
|
|
2502
2262
|
"""Process python node."""
|
|
2503
2263
|
return self.operator(Tok.GTE, ">=")
|
|
2504
2264
|
|
|
2505
|
-
def proc_in(self, node: py_ast.In) ->
|
|
2265
|
+
def proc_in(self, node: py_ast.In) -> uni.Token:
|
|
2506
2266
|
"""Process python node."""
|
|
2507
2267
|
return self.operator(Tok.KW_IN, "in")
|
|
2508
2268
|
|
|
2509
|
-
def proc_is(self, node: py_ast.Is) ->
|
|
2269
|
+
def proc_is(self, node: py_ast.Is) -> uni.Token:
|
|
2510
2270
|
"""Process python node."""
|
|
2511
2271
|
return self.operator(Tok.KW_IS, "is")
|
|
2512
2272
|
|
|
2513
|
-
def proc_is_not(self, node: py_ast.IsNot) ->
|
|
2273
|
+
def proc_is_not(self, node: py_ast.IsNot) -> uni.Token:
|
|
2514
2274
|
"""Process python node."""
|
|
2515
2275
|
return self.operator(Tok.KW_ISN, "is not")
|
|
2516
2276
|
|
|
2517
|
-
def proc_lt(self, node: py_ast.Lt) ->
|
|
2277
|
+
def proc_lt(self, node: py_ast.Lt) -> uni.Token:
|
|
2518
2278
|
"""Process python node."""
|
|
2519
2279
|
return self.operator(Tok.LT, "<")
|
|
2520
2280
|
|
|
2521
|
-
def proc_lt_e(self, node: py_ast.LtE) ->
|
|
2281
|
+
def proc_lt_e(self, node: py_ast.LtE) -> uni.Token:
|
|
2522
2282
|
"""Process python node."""
|
|
2523
2283
|
return self.operator(Tok.LTE, "<=")
|
|
2524
2284
|
|
|
2525
|
-
def proc_not_eq(self, node: py_ast.NotEq) ->
|
|
2285
|
+
def proc_not_eq(self, node: py_ast.NotEq) -> uni.Token:
|
|
2526
2286
|
"""Process python node."""
|
|
2527
2287
|
return self.operator(Tok.NE, "!=")
|
|
2528
2288
|
|
|
2529
|
-
def proc_not_in(self, node: py_ast.NotIn) ->
|
|
2289
|
+
def proc_not_in(self, node: py_ast.NotIn) -> uni.Token:
|
|
2530
2290
|
"""Process python node."""
|
|
2531
2291
|
return self.operator(Tok.KW_NIN, "not in")
|
|
2532
2292
|
|
|
2533
|
-
def proc_comprehension(self, node: py_ast.comprehension) ->
|
|
2293
|
+
def proc_comprehension(self, node: py_ast.comprehension) -> uni.InnerCompr:
|
|
2534
2294
|
"""Process python node.
|
|
2535
2295
|
|
|
2536
2296
|
class comprehension(AST):
|
|
@@ -2543,12 +2303,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2543
2303
|
iter = self.convert(node.iter)
|
|
2544
2304
|
if len(node.ifs) != 0:
|
|
2545
2305
|
ifs_list = [self.convert(ifs) for ifs in node.ifs]
|
|
2546
|
-
valid = [ifs for ifs in ifs_list if isinstance(ifs,
|
|
2306
|
+
valid = [ifs for ifs in ifs_list if isinstance(ifs, uni.Expr)]
|
|
2547
2307
|
else:
|
|
2548
2308
|
valid = None
|
|
2549
2309
|
is_async = node.is_async > 0
|
|
2550
|
-
if isinstance(target,
|
|
2551
|
-
return
|
|
2310
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
2311
|
+
return uni.InnerCompr(
|
|
2552
2312
|
is_async=is_async,
|
|
2553
2313
|
target=target,
|
|
2554
2314
|
collection=iter,
|
|
@@ -2558,7 +2318,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2558
2318
|
else:
|
|
2559
2319
|
raise self.ice()
|
|
2560
2320
|
|
|
2561
|
-
def proc_keyword(self, node: py_ast.keyword) ->
|
|
2321
|
+
def proc_keyword(self, node: py_ast.keyword) -> uni.KWPair:
|
|
2562
2322
|
"""Process python node.
|
|
2563
2323
|
|
|
2564
2324
|
class keyword(AST):
|
|
@@ -2567,7 +2327,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2567
2327
|
arg: _Identifier | None
|
|
2568
2328
|
value: expr
|
|
2569
2329
|
"""
|
|
2570
|
-
arg =
|
|
2330
|
+
arg = uni.Name(
|
|
2571
2331
|
orig_src=self.orig_src,
|
|
2572
2332
|
name=Tok.NAME,
|
|
2573
2333
|
value=node.arg if node.arg else "_",
|
|
@@ -2579,12 +2339,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2579
2339
|
pos_end=0,
|
|
2580
2340
|
)
|
|
2581
2341
|
value = self.convert(node.value)
|
|
2582
|
-
if isinstance(value,
|
|
2583
|
-
return
|
|
2342
|
+
if isinstance(value, uni.Expr):
|
|
2343
|
+
return uni.KWPair(key=arg, value=value, kid=[arg, value])
|
|
2584
2344
|
else:
|
|
2585
2345
|
raise self.ice()
|
|
2586
2346
|
|
|
2587
|
-
def proc_match_case(self, node: py_ast.match_case) ->
|
|
2347
|
+
def proc_match_case(self, node: py_ast.match_case) -> uni.MatchCase:
|
|
2588
2348
|
"""Process python node.
|
|
2589
2349
|
|
|
2590
2350
|
class match_case(AST):
|
|
@@ -2595,11 +2355,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2595
2355
|
pattern = self.convert(node.pattern)
|
|
2596
2356
|
guard = self.convert(node.guard) if node.guard else None
|
|
2597
2357
|
body = [self.convert(i) for i in node.body]
|
|
2598
|
-
valid = [i for i in body if isinstance(i,
|
|
2599
|
-
if isinstance(pattern,
|
|
2600
|
-
isinstance(guard,
|
|
2358
|
+
valid = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
2359
|
+
if isinstance(pattern, uni.MatchPattern) and (
|
|
2360
|
+
isinstance(guard, uni.Expr) or guard is None
|
|
2601
2361
|
):
|
|
2602
|
-
return
|
|
2362
|
+
return uni.MatchCase(
|
|
2603
2363
|
pattern=pattern,
|
|
2604
2364
|
guard=guard,
|
|
2605
2365
|
body=valid,
|
|
@@ -2608,7 +2368,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2608
2368
|
else:
|
|
2609
2369
|
raise self.ice()
|
|
2610
2370
|
|
|
2611
|
-
def proc_withitem(self, node: py_ast.withitem) ->
|
|
2371
|
+
def proc_withitem(self, node: py_ast.withitem) -> uni.ExprAsItem:
|
|
2612
2372
|
"""Process python node.
|
|
2613
2373
|
|
|
2614
2374
|
class withitem(AST):
|
|
@@ -2617,10 +2377,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2617
2377
|
"""
|
|
2618
2378
|
context_expr = self.convert(node.context_expr)
|
|
2619
2379
|
optional_vars = self.convert(node.optional_vars) if node.optional_vars else None
|
|
2620
|
-
if isinstance(context_expr,
|
|
2621
|
-
isinstance(optional_vars,
|
|
2380
|
+
if isinstance(context_expr, uni.Expr) and (
|
|
2381
|
+
isinstance(optional_vars, uni.Expr) or optional_vars is None
|
|
2622
2382
|
):
|
|
2623
|
-
return
|
|
2383
|
+
return uni.ExprAsItem(
|
|
2624
2384
|
expr=context_expr,
|
|
2625
2385
|
alias=optional_vars if optional_vars else None,
|
|
2626
2386
|
kid=[context_expr, optional_vars] if optional_vars else [context_expr],
|
|
@@ -2640,11 +2400,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2640
2400
|
def proc_type_var_tuple(self, node: py_ast.TypeVarTuple) -> None:
|
|
2641
2401
|
"""Process python node."""
|
|
2642
2402
|
|
|
2643
|
-
def convert_to_doc(self, string:
|
|
2403
|
+
def convert_to_doc(self, string: uni.String) -> None:
|
|
2644
2404
|
"""Convert a string to a docstring."""
|
|
2645
2405
|
string.value = f'"""{string.value[1:-1]}"""'
|
|
2646
2406
|
|
|
2647
|
-
def aug_op_map(self, tok_dict: dict, op:
|
|
2407
|
+
def aug_op_map(self, tok_dict: dict, op: uni.Token) -> str:
|
|
2648
2408
|
"""aug_mapper."""
|
|
2649
2409
|
op.value += "="
|
|
2650
2410
|
for _key, value in tok_dict.items():
|