jaclang 0.7.33__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/__init__.py +7 -414
- jaclang/cli/cli.md +5 -5
- jaclang/cli/cli.py +311 -214
- jaclang/cli/cmdreg.py +188 -31
- jaclang/compiler/__init__.py +10 -15
- jaclang/compiler/{codeloc.py → codeinfo.py} +11 -30
- jaclang/compiler/constant.py +10 -33
- jaclang/compiler/jac.lark +61 -92
- jaclang/compiler/larkparse/jac_parser.py +3444 -0
- jaclang/compiler/parser.py +1054 -1341
- jaclang/compiler/passes/__init__.py +2 -2
- jaclang/compiler/passes/main/__init__.py +33 -14
- jaclang/compiler/passes/main/annex_pass.py +85 -0
- jaclang/compiler/passes/main/cfg_build_pass.py +275 -0
- jaclang/compiler/passes/main/def_impl_match_pass.py +146 -102
- jaclang/compiler/passes/main/def_use_pass.py +64 -269
- jaclang/compiler/passes/main/import_pass.py +175 -360
- jaclang/compiler/passes/main/inheritance_pass.py +107 -105
- jaclang/compiler/passes/main/pyast_gen_pass.py +1129 -1600
- jaclang/compiler/passes/main/pyast_load_pass.py +540 -584
- jaclang/compiler/passes/main/pybc_gen_pass.py +38 -35
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +46 -160
- jaclang/compiler/passes/main/sym_tab_build_pass.py +113 -1202
- jaclang/compiler/passes/main/sym_tab_link_pass.py +141 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/access_modifier.jac +10 -9
- jaclang/compiler/passes/main/tests/fixtures/atest.impl.jac +3 -0
- jaclang/compiler/passes/main/tests/fixtures/atest.jac +11 -0
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl/getme.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.jac +3 -3
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.something.else.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/base.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/base2.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base2.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/blip.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/cfg_ability_test.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/cfg_gen.jac +19 -0
- jaclang/compiler/passes/main/tests/fixtures/circular_import.jac +7 -0
- jaclang/compiler/passes/main/tests/fixtures/data_spatial_types.jac +12 -12
- jaclang/compiler/passes/main/tests/fixtures/decls.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defn_decl_mismatch.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defs_and_uses.jac +6 -6
- jaclang/compiler/passes/main/tests/fixtures/enumerations.jac +13 -0
- jaclang/compiler/passes/main/tests/fixtures/fstrings.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/func.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/func2.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/game1.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/impl/defs1.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/defs2.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/imps.jac +0 -8
- jaclang/compiler/passes/main/tests/fixtures/impl_grab.impl.jac +5 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/impl_grab.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/incautoimpl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/main_err.impl.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/main_err.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/mod_type_assign.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/mtest.impl.jac +6 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/mtest.jac +1 -1
- jaclang/{tests → compiler/passes/main/tests}/fixtures/nested_impls.jac +14 -15
- jaclang/compiler/passes/main/tests/fixtures/py_imp_test.jac +7 -7
- jaclang/compiler/passes/main/tests/fixtures/second_err.jac +4 -0
- jaclang/compiler/passes/main/tests/fixtures/str2doc.py +3 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/__init__.py +5 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/actions.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/main.jac +14 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/no_dupls.jac +35 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/one.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/type_info.jac +4 -4
- jaclang/compiler/passes/main/tests/test_cfg_build_pass.py +99 -0
- jaclang/compiler/passes/main/tests/test_decl_impl_match_pass.py +157 -0
- jaclang/compiler/passes/main/tests/test_def_use_pass.py +4 -6
- jaclang/compiler/passes/main/tests/test_import_pass.py +59 -46
- jaclang/compiler/passes/main/tests/test_pyast_build_pass.py +15 -0
- jaclang/compiler/passes/main/tests/test_pyast_gen_pass.py +25 -34
- jaclang/compiler/passes/main/tests/test_pybc_gen_pass.py +3 -3
- jaclang/compiler/passes/main/tests/test_sub_node_pass.py +8 -7
- jaclang/compiler/passes/main/tests/test_sym_tab_build_pass.py +4 -4
- jaclang/compiler/passes/main/tests/test_sym_tab_link_pass.py +62 -0
- jaclang/compiler/passes/tool/__init__.py +2 -0
- jaclang/compiler/passes/tool/doc_ir.py +179 -0
- jaclang/compiler/passes/tool/doc_ir_gen_pass.py +1210 -0
- jaclang/compiler/passes/tool/fuse_comments_pass.py +90 -70
- jaclang/compiler/passes/tool/jac_formatter_pass.py +122 -2554
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +249 -97
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +94 -97
- jaclang/compiler/passes/tool/tests/fixtures/doc_string.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/access_mod_check.jac +5 -5
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/archetype_test.jac +13 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/decorator_stack.jac +7 -7
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/line_spacing.jac +8 -8
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.dot +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.txt +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/ability_impl_long_comprehension.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/call_with_many_parameters.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/simple_walker.jac +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/try_block_and_walker_spawn_and_fstrings.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/type_annotation.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac +10 -4
- jaclang/compiler/passes/tool/tests/test_doc_ir_gen_pass.py +29 -0
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +63 -88
- jaclang/compiler/passes/tool/tests/test_unparse_validate.py +27 -28
- jaclang/compiler/passes/transform.py +56 -16
- jaclang/compiler/passes/{ir_pass.py → uni_pass.py} +35 -52
- jaclang/compiler/program.py +205 -0
- jaclang/compiler/tests/fixtures/codegentext.jac +31 -0
- jaclang/compiler/tests/fixtures/fam.jac +10 -10
- jaclang/compiler/tests/fixtures/hello_world.jac +1 -1
- jaclang/compiler/tests/fixtures/staticcheck.jac +2 -2
- jaclang/compiler/tests/test_importer.py +21 -16
- jaclang/compiler/tests/test_parser.py +38 -17
- jaclang/compiler/{absyntree.py → unitree.py} +1120 -1012
- jaclang/langserve/engine.py +183 -171
- jaclang/langserve/sem_manager.py +26 -22
- jaclang/langserve/server.py +6 -15
- jaclang/langserve/tests/fixtures/base_module_structure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_err.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_pure.impl.jac +5 -5
- jaclang/langserve/tests/fixtures/circle_pure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle_pure_err.impl.jac +2 -2
- jaclang/langserve/tests/fixtures/circle_pure_err.jac +7 -7
- jaclang/langserve/tests/fixtures/import_include_statements.jac +6 -6
- jaclang/langserve/tests/fixtures/rename.jac +6 -6
- jaclang/langserve/tests/server_test/test_lang_serve.py +262 -0
- jaclang/langserve/tests/server_test/utils.py +115 -0
- jaclang/langserve/tests/test_sem_tokens.py +2 -2
- jaclang/langserve/tests/test_server.py +41 -23
- jaclang/langserve/utils.jac +438 -0
- jaclang/runtimelib/{architype.py → archetype.py} +85 -61
- jaclang/runtimelib/builtin.py +92 -0
- jaclang/runtimelib/constructs.py +11 -13
- jaclang/runtimelib/importer.py +63 -51
- jaclang/runtimelib/machine.py +1551 -144
- jaclang/runtimelib/memory.py +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/graph_purger.jac +1 -1
- jaclang/{plugin → runtimelib}/tests/fixtures/impl_match.jac +2 -2
- jaclang/runtimelib/tests/fixtures/impl_match_impl.jac +3 -0
- jaclang/{plugin → runtimelib}/tests/fixtures/other_root_access.jac +7 -7
- jaclang/{plugin → runtimelib}/tests/fixtures/savable_object.jac +3 -5
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_node_connection.jac +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_persistent.jac +1 -1
- jaclang/runtimelib/tests/test_features.py +72 -0
- jaclang/{plugin → runtimelib}/tests/test_jaseci.py +6 -5
- jaclang/runtimelib/utils.py +31 -63
- jaclang/settings.py +1 -6
- jaclang/tests/fixtures/{abc.jac → abc_check.jac} +6 -6
- jaclang/tests/fixtures/arch_rel_import_creation.jac +4 -4
- jaclang/tests/fixtures/async_ability.jac +18 -0
- jaclang/tests/fixtures/async_walker.jac +23 -0
- jaclang/tests/fixtures/baddy.jac +1 -1
- jaclang/tests/fixtures/base_class1.jac +2 -2
- jaclang/tests/fixtures/base_class2.jac +2 -2
- jaclang/tests/fixtures/base_class_complex_expr.jac +3 -3
- jaclang/tests/fixtures/builtin_dotgen.jac +1 -1
- jaclang/tests/fixtures/builtin_dotgen_json.jac +21 -0
- jaclang/tests/fixtures/byllmissue.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs2.jac +1 -1
- jaclang/tests/fixtures/cls_method.jac +6 -6
- jaclang/tests/fixtures/concurrency.jac +39 -0
- jaclang/tests/fixtures/connect_traverse_syntax.jac +18 -0
- jaclang/tests/fixtures/create_dynamic_archetype.jac +35 -0
- jaclang/tests/fixtures/decl_defn_param_name.jac +4 -4
- jaclang/tests/fixtures/deep/deeper/__init__.jac +1 -0
- jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac +2 -3
- jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac +3 -3
- jaclang/tests/fixtures/deep/deeper/snd_lev.jac +2 -2
- jaclang/tests/fixtures/deep/mycode.jac +1 -1
- jaclang/tests/fixtures/deep/one_lev.jac +3 -4
- jaclang/tests/fixtures/deep/one_lev_dup.jac +2 -2
- jaclang/tests/fixtures/deep_convert.jac +1 -1
- jaclang/tests/fixtures/deep_import.jac +2 -2
- jaclang/tests/fixtures/deep_import_interp.jac +8 -0
- jaclang/tests/fixtures/deep_import_mods.jac +3 -3
- jaclang/tests/fixtures/deferred_field.jac +1 -1
- jaclang/tests/fixtures/del_clean.jac +7 -0
- jaclang/tests/fixtures/disconn.jac +3 -3
- jaclang/tests/fixtures/dynamic_archetype.jac +34 -0
- jaclang/tests/fixtures/edge_node_walk.jac +12 -12
- jaclang/tests/fixtures/edge_ops.jac +7 -7
- jaclang/tests/fixtures/edges_walk.jac +10 -10
- jaclang/tests/fixtures/edgetypeissue.jac +1 -1
- jaclang/tests/fixtures/enum_inside_archtype.jac +4 -4
- jaclang/tests/fixtures/err.impl.jac +1 -1
- jaclang/tests/fixtures/err.jac +2 -2
- jaclang/tests/fixtures/err_runtime.jac +2 -2
- jaclang/tests/fixtures/foo.jac +7 -7
- jaclang/tests/fixtures/game1.jac +4 -4
- jaclang/tests/fixtures/gendot_bubble_sort.jac +4 -4
- jaclang/tests/fixtures/glob_multivar_statement.jac +1 -1
- jaclang/tests/fixtures/guess_game.jac +5 -5
- jaclang/tests/fixtures/has_goodness.jac +1 -1
- jaclang/tests/fixtures/hash_init_check.jac +3 -3
- jaclang/tests/fixtures/hello.jac +1 -1
- jaclang/tests/fixtures/ignore.jac +3 -3
- jaclang/tests/fixtures/ignore_dup.jac +3 -3
- jaclang/tests/fixtures/impl_match_confused.impl.jac +1 -1
- jaclang/tests/fixtures/import.jac +9 -9
- jaclang/tests/fixtures/import_all.jac +1 -1
- jaclang/tests/fixtures/index_slice.jac +1 -1
- jaclang/tests/fixtures/inherit_check.jac +3 -3
- jaclang/tests/fixtures/jac_from_py.py +4 -0
- jaclang/tests/fixtures/jacsamp.jac +1 -1
- jaclang/tests/fixtures/jactest_main.jac +1 -1
- jaclang/tests/fixtures/jp_importer.jac +7 -8
- jaclang/tests/fixtures/jp_importer_auto.jac +3 -3
- jaclang/tests/fixtures/lambda.jac +2 -2
- jaclang/tests/fixtures/needs_import.jac +6 -6
- jaclang/tests/fixtures/needs_import_1.jac +1 -1
- jaclang/tests/fixtures/needs_import_2.jac +1 -1
- jaclang/tests/fixtures/needs_import_3.jac +1 -1
- jaclang/tests/fixtures/needs_import_dup.jac +6 -6
- jaclang/tests/fixtures/node_del.jac +60 -0
- jaclang/tests/fixtures/nosigself.jac +3 -3
- jaclang/tests/fixtures/py2jac.py +30 -0
- jaclang/tests/fixtures/py_bool_expr.py +7 -0
- jaclang/tests/fixtures/py_namedexpr.py +7 -0
- jaclang/tests/fixtures/pyfunc_3.py +0 -2
- jaclang/tests/fixtures/random_check.jac +5 -5
- jaclang/tests/fixtures/refs_target.jac +17 -0
- jaclang/tests/fixtures/simple_archs.jac +2 -2
- jaclang/tests/fixtures/simple_walk.jac +52 -0
- jaclang/tests/fixtures/slice_vals.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep_multilev.jac +3 -3
- jaclang/tests/fixtures/trailing_comma.jac +4 -4
- jaclang/tests/fixtures/type_info.jac +5 -5
- jaclang/{compiler/passes/main/tests → tests}/fixtures/uninitialized_hasvars.jac +1 -1
- jaclang/tests/fixtures/visit_order.jac +4 -4
- jaclang/tests/fixtures/walker_override.jac +2 -2
- jaclang/tests/fixtures/walker_update.jac +5 -5
- jaclang/tests/fixtures/with_context.jac +4 -4
- jaclang/tests/test_bugs.py +2 -2
- jaclang/tests/test_cli.py +118 -223
- jaclang/tests/test_language.py +474 -468
- jaclang/tests/test_man_code.py +2 -2
- jaclang/tests/test_reference.py +4 -4
- jaclang/tests/test_settings.py +16 -16
- jaclang/tests/test_typecheck.py +555 -0
- jaclang/utils/__init__.py +4 -0
- jaclang/utils/helpers.py +12 -27
- jaclang/utils/lang_tools.py +84 -74
- jaclang/utils/module_resolver.py +69 -0
- jaclang/utils/test.py +8 -5
- jaclang/utils/tests/test_lang_tools.py +38 -13
- jaclang/utils/treeprinter.py +177 -40
- jaclang/vendor/__init__.py +1 -2
- jaclang/vendor/attr/__init__.py +14 -44
- jaclang/vendor/attr/__init__.pyi +155 -321
- jaclang/vendor/attr/_cmp.py +25 -15
- jaclang/vendor/attr/_cmp.pyi +7 -7
- jaclang/vendor/attr/_compat.py +15 -8
- jaclang/vendor/attr/_config.py +1 -1
- jaclang/vendor/attr/_funcs.py +148 -163
- jaclang/vendor/attr/_make.py +859 -855
- jaclang/vendor/attr/_next_gen.py +426 -32
- jaclang/vendor/attr/converters.py +67 -49
- jaclang/vendor/attr/converters.pyi +13 -7
- jaclang/vendor/attr/filters.py +17 -11
- jaclang/vendor/attr/filters.pyi +3 -3
- jaclang/vendor/attr/setters.py +11 -5
- jaclang/vendor/attr/setters.pyi +2 -1
- jaclang/vendor/attr/validators.py +191 -162
- jaclang/vendor/attr/validators.pyi +25 -27
- jaclang/vendor/attrs/__init__.py +9 -5
- jaclang/vendor/attrs/__init__.pyi +225 -29
- jaclang/vendor/attrs-25.3.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/METADATA +83 -53
- jaclang/vendor/attrs-25.3.0.dist-info/RECORD +56 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/WHEEL +1 -1
- jaclang/vendor/bin/dmypy +8 -0
- jaclang/vendor/bin/mypy +8 -0
- jaclang/vendor/bin/mypyc +8 -0
- jaclang/vendor/bin/stubgen +8 -0
- jaclang/vendor/bin/stubtest +8 -0
- jaclang/vendor/cattr/gen.py +2 -2
- jaclang/vendor/cattr/preconf/bson.py +1 -0
- jaclang/vendor/cattr/preconf/json.py +1 -0
- jaclang/vendor/cattr/preconf/msgpack.py +1 -0
- jaclang/vendor/cattr/preconf/orjson.py +1 -0
- jaclang/vendor/cattr/preconf/pyyaml.py +1 -0
- jaclang/vendor/cattr/preconf/tomlkit.py +1 -0
- jaclang/vendor/cattr/preconf/ujson.py +1 -0
- jaclang/vendor/cattrs/__init__.py +21 -21
- jaclang/vendor/cattrs/_compat.py +176 -62
- jaclang/vendor/cattrs/_generics.py +5 -3
- jaclang/vendor/cattrs/cols.py +289 -0
- jaclang/vendor/cattrs/converters.py +505 -187
- jaclang/vendor/cattrs/disambiguators.py +118 -45
- jaclang/vendor/cattrs/dispatch.py +66 -36
- jaclang/vendor/cattrs/fns.py +6 -1
- jaclang/vendor/cattrs/gen/__init__.py +365 -202
- jaclang/vendor/cattrs/gen/_generics.py +41 -5
- jaclang/vendor/cattrs/gen/_lc.py +3 -2
- jaclang/vendor/cattrs/gen/_shared.py +39 -32
- jaclang/vendor/cattrs/gen/typeddicts.py +75 -88
- jaclang/vendor/cattrs/preconf/__init__.py +20 -0
- jaclang/vendor/cattrs/preconf/bson.py +7 -8
- jaclang/vendor/cattrs/preconf/cbor2.py +3 -0
- jaclang/vendor/cattrs/preconf/json.py +8 -4
- jaclang/vendor/cattrs/preconf/msgpack.py +3 -0
- jaclang/vendor/cattrs/preconf/msgspec.py +185 -0
- jaclang/vendor/cattrs/preconf/orjson.py +20 -7
- jaclang/vendor/cattrs/preconf/pyyaml.py +15 -3
- jaclang/vendor/cattrs/preconf/tomlkit.py +3 -1
- jaclang/vendor/cattrs/preconf/ujson.py +3 -0
- jaclang/vendor/cattrs/strategies/__init__.py +1 -0
- jaclang/vendor/cattrs/strategies/_class_methods.py +1 -1
- jaclang/vendor/cattrs/strategies/_subclasses.py +43 -29
- jaclang/vendor/cattrs/strategies/_unions.py +47 -24
- jaclang/vendor/cattrs/v.py +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/INSTALLER +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/METADATA +161 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/RECORD +96 -0
- jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/WHEEL +1 -1
- jaclang/vendor/lark/__init__.py +38 -38
- jaclang/vendor/lark/__pyinstaller/__init__.py +6 -6
- jaclang/vendor/lark/__pyinstaller/hook-lark.py +14 -14
- jaclang/vendor/lark/ast_utils.py +59 -59
- jaclang/vendor/lark/common.py +86 -89
- jaclang/vendor/lark/exceptions.py +292 -292
- jaclang/vendor/lark/grammar.py +130 -130
- jaclang/vendor/lark/grammars/common.lark +59 -59
- jaclang/vendor/lark/grammars/lark.lark +62 -62
- jaclang/vendor/lark/grammars/python.lark +302 -302
- jaclang/vendor/lark/grammars/unicode.lark +7 -7
- jaclang/vendor/lark/indenter.py +143 -112
- jaclang/vendor/lark/lark.py +658 -661
- jaclang/vendor/lark/lexer.py +678 -678
- jaclang/vendor/lark/load_grammar.py +1428 -1428
- jaclang/vendor/lark/parse_tree_builder.py +391 -391
- jaclang/vendor/lark/parser_frontends.py +257 -257
- jaclang/vendor/lark/parsers/cyk.py +340 -340
- jaclang/vendor/lark/parsers/earley.py +317 -308
- jaclang/vendor/lark/parsers/earley_common.py +42 -42
- jaclang/vendor/lark/parsers/earley_forest.py +802 -810
- jaclang/vendor/lark/parsers/grammar_analysis.py +203 -203
- jaclang/vendor/lark/parsers/lalr_analysis.py +332 -332
- jaclang/vendor/lark/parsers/lalr_interactive_parser.py +158 -157
- jaclang/vendor/lark/parsers/lalr_parser.py +122 -122
- jaclang/vendor/lark/parsers/lalr_parser_state.py +110 -110
- jaclang/vendor/lark/parsers/xearley.py +165 -165
- jaclang/vendor/lark/reconstruct.py +107 -107
- jaclang/vendor/lark/tools/__init__.py +70 -71
- jaclang/vendor/lark/tools/nearley.py +202 -202
- jaclang/vendor/lark/tools/serialize.py +32 -32
- jaclang/vendor/lark/tools/standalone.py +196 -196
- jaclang/vendor/lark/tree.py +267 -272
- jaclang/vendor/lark/tree_matcher.py +186 -186
- jaclang/vendor/lark/utils.py +346 -361
- jaclang/vendor/lark/visitors.py +596 -593
- jaclang/vendor/lark-1.2.2.dist-info/INSTALLER +1 -0
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/METADATA +48 -47
- jaclang/vendor/lark-1.2.2.dist-info/RECORD +83 -0
- jaclang/vendor/{mypy_extensions-1.0.0.dist-info → lark-1.2.2.dist-info}/WHEEL +1 -1
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info/licenses}/LICENSE +18 -18
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/METADATA +2 -1
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/RECORD +17 -10
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/WHEEL +1 -1
- jaclang/vendor/pluggy/_version.py +7 -2
- jaclang/vendor/pluggy-1.5.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/pluggy-1.5.0.dist-info/METADATA +6 -5
- jaclang/vendor/pluggy-1.5.0.dist-info/RECORD +24 -14
- jaclang/vendor/pluggy-1.5.0.dist-info/WHEEL +1 -1
- jaclang/vendor/pygls-1.3.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/pygls-1.3.1.dist-info/METADATA +2 -2
- jaclang/vendor/pygls-1.3.1.dist-info/RECORD +45 -24
- jaclang/vendor/pygls-1.3.1.dist-info/WHEEL +1 -1
- {jaclang-0.7.33.dist-info → jaclang-0.8.0.dist-info}/METADATA +4 -4
- jaclang-0.8.0.dist-info/RECORD +552 -0
- {jaclang-0.7.33.dist-info → jaclang-0.8.0.dist-info}/WHEEL +1 -1
- jaclang/compiler/.gitignore +0 -1
- jaclang/compiler/compile.py +0 -119
- jaclang/compiler/passes/main/access_modifier_pass.py +0 -130
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +0 -656
- jaclang/compiler/passes/main/py_collect_dep_pass.py +0 -78
- jaclang/compiler/passes/main/pyout_pass.py +0 -86
- jaclang/compiler/passes/main/registry_pass.py +0 -156
- jaclang/compiler/passes/main/schedules.py +0 -47
- jaclang/compiler/passes/main/sub_node_tab_pass.py +0 -36
- jaclang/compiler/passes/main/tests/fixtures/registry.jac +0 -36
- jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py +0 -114
- jaclang/compiler/passes/main/tests/test_registry_pass.py +0 -31
- jaclang/compiler/passes/main/tests/test_type_check_pass.py +0 -91
- jaclang/compiler/passes/main/tests/test_typeinfo_pass.py +0 -29
- jaclang/compiler/passes/main/type_check_pass.py +0 -128
- jaclang/compiler/passes/tool/schedules.py +0 -18
- jaclang/compiler/passes/tool/tests/fixtures/genai/essay_review.jac +0 -36
- jaclang/compiler/passes/tool/tests/fixtures/genai/expert_answer.jac +0 -17
- jaclang/compiler/passes/tool/tests/fixtures/genai/joke_gen.jac +0 -32
- jaclang/compiler/passes/tool/tests/fixtures/genai/odd_word_out.jac +0 -27
- jaclang/compiler/passes/tool/tests/fixtures/genai/personality_finder.jac +0 -35
- jaclang/compiler/passes/tool/tests/fixtures/genai/text_to_type.jac +0 -25
- jaclang/compiler/passes/tool/tests/fixtures/genai/translator.jac +0 -13
- jaclang/compiler/passes/tool/tests/fixtures/genai/wikipedia.jac +0 -63
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/architype_test.jac +0 -13
- jaclang/compiler/passes/utils/mypy_ast_build.py +0 -940
- jaclang/compiler/py_info.py +0 -22
- jaclang/compiler/semtable.py +0 -159
- jaclang/compiler/symtable.py +0 -297
- jaclang/langserve/utils.py +0 -458
- jaclang/plugin/__init__.py +0 -7
- jaclang/plugin/builtin.py +0 -57
- jaclang/plugin/default.py +0 -1443
- jaclang/plugin/feature.py +0 -574
- jaclang/plugin/plugin.md +0 -471
- jaclang/plugin/spec.py +0 -536
- jaclang/plugin/tests/fixtures/impl_match_impl.jac +0 -3
- jaclang/plugin/tests/test_features.py +0 -56
- jaclang/runtimelib/context.py +0 -191
- jaclang/tests/fixtures/create_dynamic_architype.jac +0 -35
- jaclang/tests/fixtures/dynamic_architype.jac +0 -34
- jaclang/tests/fixtures/impl_grab.impl.jac +0 -5
- jaclang/tests/fixtures/mtest.impl.jac +0 -6
- jaclang/tests/fixtures/registry.jac +0 -58
- jaclang/tests/fixtures/semstr.jac +0 -30
- jaclang/tests/main.jac +0 -2
- jaclang/utils/profiler.py +0 -62
- jaclang/vendor/attrs-23.2.0.dist-info/RECORD +0 -35
- jaclang/vendor/cattrs-23.2.3.dist-info/METADATA +0 -221
- jaclang/vendor/cattrs-23.2.3.dist-info/RECORD +0 -48
- jaclang/vendor/lark-1.1.9.dist-info/RECORD +0 -46
- jaclang/vendor/lark-1.1.9.dist-info/WHEEL +0 -5
- jaclang/vendor/mypy/__init__.py +0 -1
- jaclang/vendor/mypy/__main__.py +0 -37
- jaclang/vendor/mypy/api.py +0 -94
- jaclang/vendor/mypy/applytype.py +0 -172
- jaclang/vendor/mypy/argmap.py +0 -268
- jaclang/vendor/mypy/binder.py +0 -538
- jaclang/vendor/mypy/bogus_type.py +0 -27
- jaclang/vendor/mypy/build.py +0 -3562
- jaclang/vendor/mypy/checker.py +0 -8445
- jaclang/vendor/mypy/checkexpr.py +0 -6623
- jaclang/vendor/mypy/checkmember.py +0 -1363
- jaclang/vendor/mypy/checkpattern.py +0 -801
- jaclang/vendor/mypy/checkstrformat.py +0 -1109
- jaclang/vendor/mypy/config_parser.py +0 -670
- jaclang/vendor/mypy/constant_fold.py +0 -187
- jaclang/vendor/mypy/constraints.py +0 -1636
- jaclang/vendor/mypy/copytype.py +0 -133
- jaclang/vendor/mypy/defaults.py +0 -46
- jaclang/vendor/mypy/dmypy/__main__.py +0 -6
- jaclang/vendor/mypy/dmypy/client.py +0 -749
- jaclang/vendor/mypy/dmypy_os.py +0 -42
- jaclang/vendor/mypy/dmypy_server.py +0 -1107
- jaclang/vendor/mypy/dmypy_util.py +0 -117
- jaclang/vendor/mypy/erasetype.py +0 -278
- jaclang/vendor/mypy/errorcodes.py +0 -291
- jaclang/vendor/mypy/errors.py +0 -1280
- jaclang/vendor/mypy/evalexpr.py +0 -205
- jaclang/vendor/mypy/expandtype.py +0 -524
- jaclang/vendor/mypy/exprtotype.py +0 -209
- jaclang/vendor/mypy/fastparse.py +0 -2147
- jaclang/vendor/mypy/find_sources.py +0 -243
- jaclang/vendor/mypy/fixup.py +0 -428
- jaclang/vendor/mypy/freetree.py +0 -23
- jaclang/vendor/mypy/fscache.py +0 -309
- jaclang/vendor/mypy/fswatcher.py +0 -106
- jaclang/vendor/mypy/gclogger.py +0 -47
- jaclang/vendor/mypy/git.py +0 -34
- jaclang/vendor/mypy/graph_utils.py +0 -112
- jaclang/vendor/mypy/indirection.py +0 -121
- jaclang/vendor/mypy/infer.py +0 -75
- jaclang/vendor/mypy/inspections.py +0 -627
- jaclang/vendor/mypy/ipc.py +0 -310
- jaclang/vendor/mypy/join.py +0 -871
- jaclang/vendor/mypy/literals.py +0 -306
- jaclang/vendor/mypy/lookup.py +0 -61
- jaclang/vendor/mypy/main.py +0 -1574
- jaclang/vendor/mypy/maptype.py +0 -106
- jaclang/vendor/mypy/meet.py +0 -1140
- jaclang/vendor/mypy/memprofile.py +0 -121
- jaclang/vendor/mypy/message_registry.py +0 -329
- jaclang/vendor/mypy/messages.py +0 -3186
- jaclang/vendor/mypy/metastore.py +0 -225
- jaclang/vendor/mypy/mixedtraverser.py +0 -112
- jaclang/vendor/mypy/modulefinder.py +0 -875
- jaclang/vendor/mypy/moduleinspect.py +0 -184
- jaclang/vendor/mypy/mro.py +0 -62
- jaclang/vendor/mypy/nodes.py +0 -4115
- jaclang/vendor/mypy/operators.py +0 -126
- jaclang/vendor/mypy/options.py +0 -556
- jaclang/vendor/mypy/parse.py +0 -30
- jaclang/vendor/mypy/partially_defined.py +0 -675
- jaclang/vendor/mypy/patterns.py +0 -150
- jaclang/vendor/mypy/plugin.py +0 -901
- jaclang/vendor/mypy/plugins/attrs.py +0 -1166
- jaclang/vendor/mypy/plugins/common.py +0 -440
- jaclang/vendor/mypy/plugins/ctypes.py +0 -245
- jaclang/vendor/mypy/plugins/dataclasses.py +0 -1108
- jaclang/vendor/mypy/plugins/default.py +0 -531
- jaclang/vendor/mypy/plugins/enums.py +0 -259
- jaclang/vendor/mypy/plugins/functools.py +0 -104
- jaclang/vendor/mypy/plugins/proper_plugin.py +0 -175
- jaclang/vendor/mypy/plugins/singledispatch.py +0 -224
- jaclang/vendor/mypy/py.typed +0 -1
- jaclang/vendor/mypy/pyinfo.py +0 -78
- jaclang/vendor/mypy/reachability.py +0 -362
- jaclang/vendor/mypy/refinfo.py +0 -92
- jaclang/vendor/mypy/renaming.py +0 -568
- jaclang/vendor/mypy/report.py +0 -924
- jaclang/vendor/mypy/scope.py +0 -125
- jaclang/vendor/mypy/semanal.py +0 -7187
- jaclang/vendor/mypy/semanal_classprop.py +0 -187
- jaclang/vendor/mypy/semanal_enum.py +0 -253
- jaclang/vendor/mypy/semanal_infer.py +0 -128
- jaclang/vendor/mypy/semanal_main.py +0 -511
- jaclang/vendor/mypy/semanal_namedtuple.py +0 -670
- jaclang/vendor/mypy/semanal_newtype.py +0 -273
- jaclang/vendor/mypy/semanal_pass1.py +0 -156
- jaclang/vendor/mypy/semanal_shared.py +0 -490
- jaclang/vendor/mypy/semanal_typeargs.py +0 -265
- jaclang/vendor/mypy/semanal_typeddict.py +0 -575
- jaclang/vendor/mypy/server/astdiff.py +0 -518
- jaclang/vendor/mypy/server/astmerge.py +0 -562
- jaclang/vendor/mypy/server/aststrip.py +0 -281
- jaclang/vendor/mypy/server/deps.py +0 -1137
- jaclang/vendor/mypy/server/mergecheck.py +0 -83
- jaclang/vendor/mypy/server/objgraph.py +0 -101
- jaclang/vendor/mypy/server/subexpr.py +0 -198
- jaclang/vendor/mypy/server/target.py +0 -11
- jaclang/vendor/mypy/server/trigger.py +0 -26
- jaclang/vendor/mypy/server/update.py +0 -1339
- jaclang/vendor/mypy/sharedparse.py +0 -112
- jaclang/vendor/mypy/solve.py +0 -562
- jaclang/vendor/mypy/split_namespace.py +0 -35
- jaclang/vendor/mypy/state.py +0 -28
- jaclang/vendor/mypy/stats.py +0 -489
- jaclang/vendor/mypy/strconv.py +0 -641
- jaclang/vendor/mypy/stubdoc.py +0 -491
- jaclang/vendor/mypy/stubgen.py +0 -1886
- jaclang/vendor/mypy/stubgenc.py +0 -993
- jaclang/vendor/mypy/stubinfo.py +0 -173
- jaclang/vendor/mypy/stubtest.py +0 -2079
- jaclang/vendor/mypy/stubutil.py +0 -834
- jaclang/vendor/mypy/subtypes.py +0 -1980
- jaclang/vendor/mypy/suggestions.py +0 -1046
- jaclang/vendor/mypy/test/config.py +0 -28
- jaclang/vendor/mypy/test/data.py +0 -821
- jaclang/vendor/mypy/test/helpers.py +0 -476
- jaclang/vendor/mypy/test/meta/_pytest.py +0 -72
- jaclang/vendor/mypy/test/meta/test_diff_helper.py +0 -47
- jaclang/vendor/mypy/test/meta/test_parse_data.py +0 -73
- jaclang/vendor/mypy/test/meta/test_update_data.py +0 -135
- jaclang/vendor/mypy/test/test_find_sources.py +0 -376
- jaclang/vendor/mypy/test/test_ref_info.py +0 -45
- jaclang/vendor/mypy/test/testapi.py +0 -45
- jaclang/vendor/mypy/test/testargs.py +0 -77
- jaclang/vendor/mypy/test/testcheck.py +0 -322
- jaclang/vendor/mypy/test/testcmdline.py +0 -152
- jaclang/vendor/mypy/test/testconstraints.py +0 -134
- jaclang/vendor/mypy/test/testdaemon.py +0 -132
- jaclang/vendor/mypy/test/testdeps.py +0 -77
- jaclang/vendor/mypy/test/testdiff.py +0 -67
- jaclang/vendor/mypy/test/testerrorstream.py +0 -46
- jaclang/vendor/mypy/test/testfinegrained.py +0 -438
- jaclang/vendor/mypy/test/testfinegrainedcache.py +0 -18
- jaclang/vendor/mypy/test/testformatter.py +0 -85
- jaclang/vendor/mypy/test/testfscache.py +0 -101
- jaclang/vendor/mypy/test/testgraph.py +0 -83
- jaclang/vendor/mypy/test/testinfer.py +0 -373
- jaclang/vendor/mypy/test/testipc.py +0 -119
- jaclang/vendor/mypy/test/testmerge.py +0 -238
- jaclang/vendor/mypy/test/testmodulefinder.py +0 -278
- jaclang/vendor/mypy/test/testmypyc.py +0 -14
- jaclang/vendor/mypy/test/testparse.py +0 -107
- jaclang/vendor/mypy/test/testpep561.py +0 -211
- jaclang/vendor/mypy/test/testpythoneval.py +0 -117
- jaclang/vendor/mypy/test/testreports.py +0 -55
- jaclang/vendor/mypy/test/testsemanal.py +0 -209
- jaclang/vendor/mypy/test/testsolve.py +0 -285
- jaclang/vendor/mypy/test/teststubgen.py +0 -1412
- jaclang/vendor/mypy/test/teststubinfo.py +0 -12
- jaclang/vendor/mypy/test/teststubtest.py +0 -2492
- jaclang/vendor/mypy/test/testsubtypes.py +0 -303
- jaclang/vendor/mypy/test/testtransform.py +0 -64
- jaclang/vendor/mypy/test/testtypegen.py +0 -83
- jaclang/vendor/mypy/test/testtypes.py +0 -1551
- jaclang/vendor/mypy/test/testutil.py +0 -111
- jaclang/vendor/mypy/test/typefixture.py +0 -415
- jaclang/vendor/mypy/test/update_data.py +0 -87
- jaclang/vendor/mypy/test/visitors.py +0 -63
- jaclang/vendor/mypy/traverser.py +0 -961
- jaclang/vendor/mypy/treetransform.py +0 -800
- jaclang/vendor/mypy/tvar_scope.py +0 -169
- jaclang/vendor/mypy/type_visitor.py +0 -564
- jaclang/vendor/mypy/typeanal.py +0 -2596
- jaclang/vendor/mypy/typeops.py +0 -1082
- jaclang/vendor/mypy/types.py +0 -3708
- jaclang/vendor/mypy/types_utils.py +0 -166
- jaclang/vendor/mypy/typeshed/LICENSE +0 -237
- jaclang/vendor/mypy/typeshed/stdlib/VERSIONS +0 -309
- jaclang/vendor/mypy/typeshed/stdlib/__future__.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/__main__.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/_ast.pyi +0 -591
- jaclang/vendor/mypy/typeshed/stdlib/_bisect.pyi +0 -84
- jaclang/vendor/mypy/typeshed/stdlib/_bootlocale.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/_codecs.pyi +0 -133
- jaclang/vendor/mypy/typeshed/stdlib/_collections_abc.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/_compat_pickle.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/_compression.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/_csv.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/_ctypes.pyi +0 -207
- jaclang/vendor/mypy/typeshed/stdlib/_curses.pyi +0 -566
- jaclang/vendor/mypy/typeshed/stdlib/_decimal.pyi +0 -281
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_thread.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_threading.pyi +0 -164
- jaclang/vendor/mypy/typeshed/stdlib/_heapq.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/_imp.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/_json.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/_locale.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/_lsprof.pyi +0 -35
- jaclang/vendor/mypy/typeshed/stdlib/_markupbase.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_msi.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/_operator.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/_osx_support.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/_posixsubprocess.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_py_abc.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/_pydecimal.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/_random.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/_sitebuiltins.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_socket.pyi +0 -803
- jaclang/vendor/mypy/typeshed/stdlib/_stat.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/_thread.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/_threading_local.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_tkinter.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/_tracemalloc.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/__init__.pyi +0 -347
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/xml.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/_warnings.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/_weakref.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/_weakrefset.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/_winapi.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/abc.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/aifc.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/antigravity.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/argparse.pyi +0 -595
- jaclang/vendor/mypy/typeshed/stdlib/array.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/ast.pyi +0 -277
- jaclang/vendor/mypy/typeshed/stdlib/asynchat.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/__init__.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_events.pyi +0 -440
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_futures.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/constants.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/coroutines.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/events.pyi +0 -580
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/exceptions.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/futures.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/locks.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/log.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/mixins.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +0 -64
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/protocols.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/queues.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/runners.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/selector_events.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/sslproto.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/staggered.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/streams.pyi +0 -153
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/subprocess.pyi +0 -229
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/tasks.pyi +0 -497
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/threads.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/timeouts.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/transports.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/trsock.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/unix_events.pyi +0 -196
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_events.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/asyncore.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/atexit.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/audioop.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/base64.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/bdb.pyi +0 -102
- jaclang/vendor/mypy/typeshed/stdlib/binascii.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/binhex.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/bisect.pyi +0 -4
- jaclang/vendor/mypy/typeshed/stdlib/builtins.pyi +0 -1936
- jaclang/vendor/mypy/typeshed/stdlib/bz2.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/cProfile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/calendar.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/cgi.pyi +0 -118
- jaclang/vendor/mypy/typeshed/stdlib/cgitb.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/chunk.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/cmath.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/cmd.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/code.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/codecs.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/codeop.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/collections/__init__.pyi +0 -485
- jaclang/vendor/mypy/typeshed/stdlib/collections/abc.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/colorsys.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/compileall.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +0 -126
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/process.pyi +0 -233
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/configparser.pyi +0 -313
- jaclang/vendor/mypy/typeshed/stdlib/contextlib.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/contextvars.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/copy.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/copyreg.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/crypt.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/csv.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/__init__.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/_endian.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/util.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/wintypes.pyi +0 -298
- jaclang/vendor/mypy/typeshed/stdlib/curses/__init__.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/ascii.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/curses/has_key.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/curses/panel.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/textpad.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/dataclasses.pyi +0 -315
- jaclang/vendor/mypy/typeshed/stdlib/datetime.pyi +0 -295
- jaclang/vendor/mypy/typeshed/stdlib/dbm/__init__.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/dbm/dumb.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/dbm/gnu.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/dbm/ndbm.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/decimal.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/difflib.pyi +0 -140
- jaclang/vendor/mypy/typeshed/stdlib/dis.pyi +0 -144
- jaclang/vendor/mypy/typeshed/stdlib/distutils/__init__.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/distutils/archive_util.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/ccompiler.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cmd.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_py.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/check.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/clean.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/config.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_data.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/register.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/sdist.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/upload.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/config.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/core.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/debug.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dep_util.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dir_util.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dist.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/distutils/errors.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/extension.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/distutils/file_util.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/distutils/filelist.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/log.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/spawn.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/distutils/sysconfig.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/text_file.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/util.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/distutils/version.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/doctest.pyi +0 -248
- jaclang/vendor/mypy/typeshed/stdlib/dummy_threading.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/email/__init__.pyi +0 -29
- jaclang/vendor/mypy/typeshed/stdlib/email/_header_value_parser.pyi +0 -392
- jaclang/vendor/mypy/typeshed/stdlib/email/_policybase.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/email/base64mime.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/email/charset.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/email/contentmanager.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/email/encoders.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/errors.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/email/feedparser.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/email/generator.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/email/header.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/email/headerregistry.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/email/iterators.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/email/message.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/application.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/audio.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/base.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/image.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/message.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/multipart.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/text.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/email/parser.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/email/policy.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/email/quoprimime.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/email/utils.pyi +0 -70
- jaclang/vendor/mypy/typeshed/stdlib/encodings/__init__.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/ensurepip/__init__.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/enum.pyi +0 -320
- jaclang/vendor/mypy/typeshed/stdlib/errno.pyi +0 -222
- jaclang/vendor/mypy/typeshed/stdlib/faulthandler.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/fcntl.pyi +0 -127
- jaclang/vendor/mypy/typeshed/stdlib/filecmp.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/fileinput.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/fnmatch.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/formatter.pyi +0 -88
- jaclang/vendor/mypy/typeshed/stdlib/fractions.pyi +0 -150
- jaclang/vendor/mypy/typeshed/stdlib/ftplib.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/functools.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/gc.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/genericpath.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/getopt.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/getpass.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/gettext.pyi +0 -169
- jaclang/vendor/mypy/typeshed/stdlib/glob.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/graphlib.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/grp.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/gzip.pyi +0 -160
- jaclang/vendor/mypy/typeshed/stdlib/hashlib.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/heapq.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/hmac.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/html/__init__.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/entities.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/parser.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/http/__init__.pyi +0 -105
- jaclang/vendor/mypy/typeshed/stdlib/http/client.pyi +0 -259
- jaclang/vendor/mypy/typeshed/stdlib/http/cookiejar.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/http/cookies.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/http/server.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/imaplib.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/imghdr.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/imp.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/importlib/__init__.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/importlib/_abc.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/importlib/abc.pyi +0 -172
- jaclang/vendor/mypy/typeshed/stdlib/importlib/machinery.pyi +0 -179
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/importlib/readers.pyi +0 -68
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/abc.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/readers.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/simple.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/importlib/simple.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/importlib/util.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/inspect.pyi +0 -632
- jaclang/vendor/mypy/typeshed/stdlib/io.pyi +0 -238
- jaclang/vendor/mypy/typeshed/stdlib/ipaddress.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/itertools.pyi +0 -273
- jaclang/vendor/mypy/typeshed/stdlib/json/__init__.pyi +0 -61
- jaclang/vendor/mypy/typeshed/stdlib/json/decoder.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/json/encoder.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/json/tool.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/keyword.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/main.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +0 -96
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pygram.pyi +0 -114
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pytree.pyi +0 -117
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/refactor.pyi +0 -82
- jaclang/vendor/mypy/typeshed/stdlib/linecache.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/locale.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/logging/__init__.pyi +0 -658
- jaclang/vendor/mypy/typeshed/stdlib/logging/config.pyi +0 -134
- jaclang/vendor/mypy/typeshed/stdlib/logging/handlers.pyi +0 -275
- jaclang/vendor/mypy/typeshed/stdlib/lzma.pyi +0 -197
- jaclang/vendor/mypy/typeshed/stdlib/mailbox.pyi +0 -256
- jaclang/vendor/mypy/typeshed/stdlib/mailcap.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/marshal.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/math.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/mimetypes.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/mmap.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/modulefinder.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/msilib/__init__.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/msilib/schema.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/msilib/sequence.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/msilib/text.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/msvcrt.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/connection.pyi +0 -75
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/context.pyi +0 -189
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +0 -77
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/heap.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/managers.pyi +0 -212
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/pool.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/process.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/queues.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +0 -107
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/util.pyi +0 -98
- jaclang/vendor/mypy/typeshed/stdlib/netrc.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/nis.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/nntplib.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/nt.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/ntpath.pyi +0 -119
- jaclang/vendor/mypy/typeshed/stdlib/nturl2path.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/numbers.pyi +0 -209
- jaclang/vendor/mypy/typeshed/stdlib/opcode.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/operator.pyi +0 -110
- jaclang/vendor/mypy/typeshed/stdlib/optparse.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/os/__init__.pyi +0 -1157
- jaclang/vendor/mypy/typeshed/stdlib/os/path.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/ossaudiodev.pyi +0 -131
- jaclang/vendor/mypy/typeshed/stdlib/parser.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/pathlib.pyi +0 -232
- jaclang/vendor/mypy/typeshed/stdlib/pdb.pyi +0 -181
- jaclang/vendor/mypy/typeshed/stdlib/pickle.pyi +0 -271
- jaclang/vendor/mypy/typeshed/stdlib/pickletools.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/pipes.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/pkgutil.pyi +0 -53
- jaclang/vendor/mypy/typeshed/stdlib/platform.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/plistlib.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/poplib.pyi +0 -71
- jaclang/vendor/mypy/typeshed/stdlib/posix.pyi +0 -361
- jaclang/vendor/mypy/typeshed/stdlib/posixpath.pyi +0 -161
- jaclang/vendor/mypy/typeshed/stdlib/pprint.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/profile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/pstats.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/pty.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/pwd.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/py_compile.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/pyclbr.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/pydoc.pyi +0 -261
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/topics.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/__init__.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/errors.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/model.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/queue.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/quopri.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/random.pyi +0 -138
- jaclang/vendor/mypy/typeshed/stdlib/re.pyi +0 -290
- jaclang/vendor/mypy/typeshed/stdlib/readline.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/reprlib.pyi +0 -65
- jaclang/vendor/mypy/typeshed/stdlib/resource.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/rlcompleter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/runpy.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/sched.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/secrets.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/select.pyi +0 -155
- jaclang/vendor/mypy/typeshed/stdlib/selectors.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/shelve.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/shlex.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/shutil.pyi +0 -185
- jaclang/vendor/mypy/typeshed/stdlib/signal.pyi +0 -188
- jaclang/vendor/mypy/typeshed/stdlib/site.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/smtpd.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/smtplib.pyi +0 -204
- jaclang/vendor/mypy/typeshed/stdlib/sndhdr.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/socket.pyi +0 -825
- jaclang/vendor/mypy/typeshed/stdlib/socketserver.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/spwd.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +0 -551
- jaclang/vendor/mypy/typeshed/stdlib/sre_compile.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/sre_constants.pyi +0 -130
- jaclang/vendor/mypy/typeshed/stdlib/sre_parse.pyi +0 -104
- jaclang/vendor/mypy/typeshed/stdlib/ssl.pyi +0 -537
- jaclang/vendor/mypy/typeshed/stdlib/stat.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/statistics.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/string.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/stringprep.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/struct.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/subprocess.pyi +0 -2615
- jaclang/vendor/mypy/typeshed/stdlib/sunau.pyi +0 -86
- jaclang/vendor/mypy/typeshed/stdlib/symbol.pyi +0 -93
- jaclang/vendor/mypy/typeshed/stdlib/symtable.pyi +0 -58
- jaclang/vendor/mypy/typeshed/stdlib/sys/__init__.pyi +0 -373
- jaclang/vendor/mypy/typeshed/stdlib/sys/_monitoring.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/sysconfig.pyi +0 -48
- jaclang/vendor/mypy/typeshed/stdlib/syslog.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/tabnanny.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tarfile.pyi +0 -441
- jaclang/vendor/mypy/typeshed/stdlib/telnetlib.pyi +0 -122
- jaclang/vendor/mypy/typeshed/stdlib/tempfile.pyi +0 -477
- jaclang/vendor/mypy/typeshed/stdlib/termios.pyi +0 -267
- jaclang/vendor/mypy/typeshed/stdlib/textwrap.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/this.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/threading.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/time.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/timeit.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/__init__.pyi +0 -3654
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/commondialog.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/constants.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dialog.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dnd.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/filedialog.pyi +0 -151
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/font.pyi +0 -116
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/messagebox.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/tix.pyi +0 -299
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/ttk.pyi +0 -1204
- jaclang/vendor/mypy/typeshed/stdlib/token.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/tokenize.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/tomllib.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/trace.pyi +0 -79
- jaclang/vendor/mypy/typeshed/stdlib/traceback.pyi +0 -262
- jaclang/vendor/mypy/typeshed/stdlib/tracemalloc.pyi +0 -124
- jaclang/vendor/mypy/typeshed/stdlib/tty.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/turtle.pyi +0 -713
- jaclang/vendor/mypy/typeshed/stdlib/types.pyi +0 -614
- jaclang/vendor/mypy/typeshed/stdlib/typing.pyi +0 -976
- jaclang/vendor/mypy/typeshed/stdlib/typing_extensions.pyi +0 -509
- jaclang/vendor/mypy/typeshed/stdlib/unicodedata.pyi +0 -73
- jaclang/vendor/mypy/typeshed/stdlib/unittest/__init__.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/unittest/_log.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/unittest/async_case.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/unittest/case.pyi +0 -342
- jaclang/vendor/mypy/typeshed/stdlib/unittest/loader.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/unittest/main.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/unittest/mock.pyi +0 -430
- jaclang/vendor/mypy/typeshed/stdlib/unittest/result.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/unittest/runner.pyi +0 -72
- jaclang/vendor/mypy/typeshed/stdlib/unittest/signals.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/unittest/suite.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/unittest/util.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/urllib/error.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/parse.pyi +0 -210
- jaclang/vendor/mypy/typeshed/stdlib/urllib/request.pyi +0 -400
- jaclang/vendor/mypy/typeshed/stdlib/urllib/response.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/urllib/robotparser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/uu.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/uuid.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/warnings.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/wave.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/weakref.pyi +0 -149
- jaclang/vendor/mypy/typeshed/stdlib/webbrowser.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/winreg.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/winsound.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/handlers.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/headers.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/types.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/util.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/validate.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/xdrlib.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/xml/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/__init__.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/domreg.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minidom.pyi +0 -404
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +0 -327
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/__init__.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/handler.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +0 -87
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/client.pyi +0 -296
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/server.pyi +0 -143
- jaclang/vendor/mypy/typeshed/stdlib/xxlimited.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/zipapp.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/__init__.pyi +0 -306
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/_path.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/zipimport.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/zlib.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +0 -218
- jaclang/vendor/mypy/typestate.py +0 -323
- jaclang/vendor/mypy/typetraverser.py +0 -148
- jaclang/vendor/mypy/typevars.py +0 -93
- jaclang/vendor/mypy/typevartuples.py +0 -32
- jaclang/vendor/mypy/util.py +0 -869
- jaclang/vendor/mypy/version.py +0 -1
- jaclang/vendor/mypy/visitor.py +0 -621
- jaclang/vendor/mypy/xml/mypy-html.css +0 -104
- jaclang/vendor/mypy/xml/mypy-html.xslt +0 -81
- jaclang/vendor/mypy/xml/mypy-txt.xslt +0 -100
- jaclang/vendor/mypy/xml/mypy.xsd +0 -50
- jaclang/vendor/mypy-1.10.0.dist-info/LICENSE +0 -229
- jaclang/vendor/mypy-1.10.0.dist-info/METADATA +0 -48
- jaclang/vendor/mypy-1.10.0.dist-info/RECORD +0 -1241
- jaclang/vendor/mypy-1.10.0.dist-info/WHEEL +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/entry_points.txt +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/top_level.txt +0 -3
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/LICENSE +0 -27
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/METADATA +0 -29
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/RECORD +0 -6
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/top_level.txt +0 -1
- jaclang/vendor/mypy_extensions.py +0 -213
- jaclang/vendor/mypyc/README.md +0 -133
- jaclang/vendor/mypyc/__init__.py +0 -0
- jaclang/vendor/mypyc/__main__.py +0 -57
- jaclang/vendor/mypyc/analysis/__init__.py +0 -0
- jaclang/vendor/mypyc/analysis/attrdefined.py +0 -436
- jaclang/vendor/mypyc/analysis/blockfreq.py +0 -32
- jaclang/vendor/mypyc/analysis/dataflow.py +0 -628
- jaclang/vendor/mypyc/analysis/ircheck.py +0 -433
- jaclang/vendor/mypyc/analysis/selfleaks.py +0 -211
- jaclang/vendor/mypyc/build.py +0 -616
- jaclang/vendor/mypyc/codegen/__init__.py +0 -0
- jaclang/vendor/mypyc/codegen/cstring.py +0 -54
- jaclang/vendor/mypyc/codegen/emit.py +0 -1193
- jaclang/vendor/mypyc/codegen/emitclass.py +0 -1060
- jaclang/vendor/mypyc/codegen/emitfunc.py +0 -852
- jaclang/vendor/mypyc/codegen/emitmodule.py +0 -1136
- jaclang/vendor/mypyc/codegen/emitwrapper.py +0 -979
- jaclang/vendor/mypyc/codegen/literals.py +0 -302
- jaclang/vendor/mypyc/common.py +0 -136
- jaclang/vendor/mypyc/crash.py +0 -31
- jaclang/vendor/mypyc/doc/Makefile +0 -20
- jaclang/vendor/mypyc/doc/bool_operations.rst +0 -27
- jaclang/vendor/mypyc/doc/compilation_units.rst +0 -20
- jaclang/vendor/mypyc/doc/conf.py +0 -59
- jaclang/vendor/mypyc/doc/cpython-timings.md +0 -25
- jaclang/vendor/mypyc/doc/dev-intro.md +0 -548
- jaclang/vendor/mypyc/doc/dict_operations.rst +0 -59
- jaclang/vendor/mypyc/doc/differences_from_python.rst +0 -332
- jaclang/vendor/mypyc/doc/float_operations.rst +0 -50
- jaclang/vendor/mypyc/doc/future.md +0 -42
- jaclang/vendor/mypyc/doc/getting_started.rst +0 -240
- jaclang/vendor/mypyc/doc/index.rst +0 -61
- jaclang/vendor/mypyc/doc/int_operations.rst +0 -162
- jaclang/vendor/mypyc/doc/introduction.rst +0 -150
- jaclang/vendor/mypyc/doc/list_operations.rst +0 -65
- jaclang/vendor/mypyc/doc/make.bat +0 -35
- jaclang/vendor/mypyc/doc/native_classes.rst +0 -206
- jaclang/vendor/mypyc/doc/native_operations.rst +0 -55
- jaclang/vendor/mypyc/doc/performance_tips_and_tricks.rst +0 -244
- jaclang/vendor/mypyc/doc/set_operations.rst +0 -47
- jaclang/vendor/mypyc/doc/str_operations.rst +0 -35
- jaclang/vendor/mypyc/doc/tuple_operations.rst +0 -33
- jaclang/vendor/mypyc/doc/using_type_annotations.rst +0 -398
- jaclang/vendor/mypyc/errors.py +0 -29
- jaclang/vendor/mypyc/external/googletest/LICENSE +0 -28
- jaclang/vendor/mypyc/external/googletest/README.md +0 -280
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-death-test.h +0 -294
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-message.h +0 -250
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h +0 -1444
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +0 -510
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-printers.h +0 -993
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-spi.h +0 -232
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-test-part.h +0 -179
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-typed-test.h +0 -263
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest.h +0 -2236
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_pred_impl.h +0 -358
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_prod.h +0 -58
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +0 -69
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest.h +0 -41
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -319
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +0 -206
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-internal.h +0 -1238
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5146
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -286
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +0 -731
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +0 -93
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port.h +0 -2560
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-string.h +0 -167
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +0 -3331
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -297
- jaclang/vendor/mypyc/external/googletest/make/Makefile +0 -61
- jaclang/vendor/mypyc/external/googletest/src/gtest-all.cc +0 -48
- jaclang/vendor/mypyc/external/googletest/src/gtest-death-test.cc +0 -1342
- jaclang/vendor/mypyc/external/googletest/src/gtest-filepath.cc +0 -387
- jaclang/vendor/mypyc/external/googletest/src/gtest-internal-inl.h +0 -1183
- jaclang/vendor/mypyc/external/googletest/src/gtest-port.cc +0 -1259
- jaclang/vendor/mypyc/external/googletest/src/gtest-printers.cc +0 -373
- jaclang/vendor/mypyc/external/googletest/src/gtest-test-part.cc +0 -110
- jaclang/vendor/mypyc/external/googletest/src/gtest-typed-test.cc +0 -118
- jaclang/vendor/mypyc/external/googletest/src/gtest.cc +0 -5388
- jaclang/vendor/mypyc/external/googletest/src/gtest_main.cc +0 -38
- jaclang/vendor/mypyc/ir/__init__.py +0 -0
- jaclang/vendor/mypyc/ir/class_ir.py +0 -499
- jaclang/vendor/mypyc/ir/func_ir.py +0 -370
- jaclang/vendor/mypyc/ir/module_ir.py +0 -88
- jaclang/vendor/mypyc/ir/ops.py +0 -1727
- jaclang/vendor/mypyc/ir/pprint.py +0 -516
- jaclang/vendor/mypyc/ir/rtypes.py +0 -1038
- jaclang/vendor/mypyc/irbuild/__init__.py +0 -0
- jaclang/vendor/mypyc/irbuild/ast_helpers.py +0 -123
- jaclang/vendor/mypyc/irbuild/builder.py +0 -1394
- jaclang/vendor/mypyc/irbuild/callable_class.py +0 -173
- jaclang/vendor/mypyc/irbuild/classdef.py +0 -850
- jaclang/vendor/mypyc/irbuild/constant_fold.py +0 -95
- jaclang/vendor/mypyc/irbuild/context.py +0 -186
- jaclang/vendor/mypyc/irbuild/env_class.py +0 -223
- jaclang/vendor/mypyc/irbuild/expression.py +0 -1070
- jaclang/vendor/mypyc/irbuild/for_helpers.py +0 -1075
- jaclang/vendor/mypyc/irbuild/format_str_tokenizer.py +0 -250
- jaclang/vendor/mypyc/irbuild/function.py +0 -1088
- jaclang/vendor/mypyc/irbuild/generator.py +0 -346
- jaclang/vendor/mypyc/irbuild/ll_builder.py +0 -2389
- jaclang/vendor/mypyc/irbuild/main.py +0 -153
- jaclang/vendor/mypyc/irbuild/mapper.py +0 -221
- jaclang/vendor/mypyc/irbuild/match.py +0 -355
- jaclang/vendor/mypyc/irbuild/nonlocalcontrol.py +0 -197
- jaclang/vendor/mypyc/irbuild/prebuildvisitor.py +0 -203
- jaclang/vendor/mypyc/irbuild/prepare.py +0 -609
- jaclang/vendor/mypyc/irbuild/specialize.py +0 -822
- jaclang/vendor/mypyc/irbuild/statement.py +0 -1017
- jaclang/vendor/mypyc/irbuild/targets.py +0 -57
- jaclang/vendor/mypyc/irbuild/util.py +0 -189
- jaclang/vendor/mypyc/irbuild/visitor.py +0 -401
- jaclang/vendor/mypyc/irbuild/vtable.py +0 -82
- jaclang/vendor/mypyc/lib-rt/CPy.h +0 -638
- jaclang/vendor/mypyc/lib-rt/bytes_ops.c +0 -143
- jaclang/vendor/mypyc/lib-rt/dict_ops.c +0 -446
- jaclang/vendor/mypyc/lib-rt/exc_ops.c +0 -259
- jaclang/vendor/mypyc/lib-rt/float_ops.c +0 -192
- jaclang/vendor/mypyc/lib-rt/generic_ops.c +0 -64
- jaclang/vendor/mypyc/lib-rt/getargs.c +0 -450
- jaclang/vendor/mypyc/lib-rt/getargsfast.c +0 -569
- jaclang/vendor/mypyc/lib-rt/init.c +0 -13
- jaclang/vendor/mypyc/lib-rt/int_ops.c +0 -803
- jaclang/vendor/mypyc/lib-rt/list_ops.c +0 -335
- jaclang/vendor/mypyc/lib-rt/misc_ops.c +0 -942
- jaclang/vendor/mypyc/lib-rt/module_shim.tmpl +0 -18
- jaclang/vendor/mypyc/lib-rt/mypyc_util.h +0 -118
- jaclang/vendor/mypyc/lib-rt/pythoncapi_compat.h +0 -497
- jaclang/vendor/mypyc/lib-rt/pythonsupport.h +0 -533
- jaclang/vendor/mypyc/lib-rt/set_ops.c +0 -17
- jaclang/vendor/mypyc/lib-rt/setup.py +0 -70
- jaclang/vendor/mypyc/lib-rt/str_ops.c +0 -241
- jaclang/vendor/mypyc/lib-rt/test_capi.cc +0 -585
- jaclang/vendor/mypyc/lib-rt/tuple_ops.c +0 -61
- jaclang/vendor/mypyc/lower/__init__.py +0 -0
- jaclang/vendor/mypyc/lower/int_ops.py +0 -113
- jaclang/vendor/mypyc/lower/list_ops.py +0 -45
- jaclang/vendor/mypyc/lower/misc_ops.py +0 -12
- jaclang/vendor/mypyc/lower/registry.py +0 -26
- jaclang/vendor/mypyc/namegen.py +0 -115
- jaclang/vendor/mypyc/options.py +0 -32
- jaclang/vendor/mypyc/primitives/__init__.py +0 -0
- jaclang/vendor/mypyc/primitives/bytes_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/dict_ops.py +0 -325
- jaclang/vendor/mypyc/primitives/exc_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/float_ops.py +0 -168
- jaclang/vendor/mypyc/primitives/generic_ops.py +0 -384
- jaclang/vendor/mypyc/primitives/int_ops.py +0 -303
- jaclang/vendor/mypyc/primitives/list_ops.py +0 -310
- jaclang/vendor/mypyc/primitives/misc_ops.py +0 -267
- jaclang/vendor/mypyc/primitives/registry.py +0 -360
- jaclang/vendor/mypyc/primitives/set_ops.py +0 -121
- jaclang/vendor/mypyc/primitives/str_ops.py +0 -229
- jaclang/vendor/mypyc/primitives/tuple_ops.py +0 -83
- jaclang/vendor/mypyc/rt_subtype.py +0 -77
- jaclang/vendor/mypyc/sametype.py +0 -83
- jaclang/vendor/mypyc/subtype.py +0 -88
- jaclang/vendor/mypyc/test/__init__.py +0 -0
- jaclang/vendor/mypyc/test/config.py +0 -13
- jaclang/vendor/mypyc/test/test_alwaysdefined.py +0 -46
- jaclang/vendor/mypyc/test/test_analysis.py +0 -77
- jaclang/vendor/mypyc/test/test_cheader.py +0 -53
- jaclang/vendor/mypyc/test/test_commandline.py +0 -82
- jaclang/vendor/mypyc/test/test_emit.py +0 -69
- jaclang/vendor/mypyc/test/test_emitclass.py +0 -35
- jaclang/vendor/mypyc/test/test_emitfunc.py +0 -928
- jaclang/vendor/mypyc/test/test_emitwrapper.py +0 -60
- jaclang/vendor/mypyc/test/test_exceptions.py +0 -56
- jaclang/vendor/mypyc/test/test_external.py +0 -49
- jaclang/vendor/mypyc/test/test_irbuild.py +0 -87
- jaclang/vendor/mypyc/test/test_ircheck.py +0 -199
- jaclang/vendor/mypyc/test/test_literals.py +0 -90
- jaclang/vendor/mypyc/test/test_lowering.py +0 -56
- jaclang/vendor/mypyc/test/test_namegen.py +0 -48
- jaclang/vendor/mypyc/test/test_optimizations.py +0 -68
- jaclang/vendor/mypyc/test/test_pprint.py +0 -42
- jaclang/vendor/mypyc/test/test_rarray.py +0 -48
- jaclang/vendor/mypyc/test/test_refcount.py +0 -59
- jaclang/vendor/mypyc/test/test_run.py +0 -426
- jaclang/vendor/mypyc/test/test_serialization.py +0 -108
- jaclang/vendor/mypyc/test/test_struct.py +0 -112
- jaclang/vendor/mypyc/test/test_tuplename.py +0 -33
- jaclang/vendor/mypyc/test/test_typeops.py +0 -97
- jaclang/vendor/mypyc/test/testutil.py +0 -283
- jaclang/vendor/mypyc/test-data/alwaysdefined.test +0 -732
- jaclang/vendor/mypyc/test-data/analysis.test +0 -470
- jaclang/vendor/mypyc/test-data/commandline.test +0 -245
- jaclang/vendor/mypyc/test-data/driver/driver.py +0 -48
- jaclang/vendor/mypyc/test-data/exceptions-freq.test +0 -125
- jaclang/vendor/mypyc/test-data/exceptions.test +0 -699
- jaclang/vendor/mypyc/test-data/fixtures/ir.py +0 -373
- jaclang/vendor/mypyc/test-data/fixtures/testutil.py +0 -103
- jaclang/vendor/mypyc/test-data/fixtures/typing-full.pyi +0 -169
- jaclang/vendor/mypyc/test-data/irbuild-any.test +0 -236
- jaclang/vendor/mypyc/test-data/irbuild-basic.test +0 -3399
- jaclang/vendor/mypyc/test-data/irbuild-bool.test +0 -424
- jaclang/vendor/mypyc/test-data/irbuild-bytes.test +0 -181
- jaclang/vendor/mypyc/test-data/irbuild-classes.test +0 -1302
- jaclang/vendor/mypyc/test-data/irbuild-constant-fold.test +0 -480
- jaclang/vendor/mypyc/test-data/irbuild-dict.test +0 -584
- jaclang/vendor/mypyc/test-data/irbuild-dunders.test +0 -215
- jaclang/vendor/mypyc/test-data/irbuild-float.test +0 -497
- jaclang/vendor/mypyc/test-data/irbuild-generics.test +0 -150
- jaclang/vendor/mypyc/test-data/irbuild-glue-methods.test +0 -437
- jaclang/vendor/mypyc/test-data/irbuild-i16.test +0 -526
- jaclang/vendor/mypyc/test-data/irbuild-i32.test +0 -598
- jaclang/vendor/mypyc/test-data/irbuild-i64.test +0 -2144
- jaclang/vendor/mypyc/test-data/irbuild-int.test +0 -194
- jaclang/vendor/mypyc/test-data/irbuild-isinstance.test +0 -109
- jaclang/vendor/mypyc/test-data/irbuild-lists.test +0 -513
- jaclang/vendor/mypyc/test-data/irbuild-match.test +0 -1717
- jaclang/vendor/mypyc/test-data/irbuild-math.test +0 -64
- jaclang/vendor/mypyc/test-data/irbuild-nested.test +0 -807
- jaclang/vendor/mypyc/test-data/irbuild-optional.test +0 -536
- jaclang/vendor/mypyc/test-data/irbuild-set.test +0 -806
- jaclang/vendor/mypyc/test-data/irbuild-singledispatch.test +0 -257
- jaclang/vendor/mypyc/test-data/irbuild-statements.test +0 -1060
- jaclang/vendor/mypyc/test-data/irbuild-str.test +0 -312
- jaclang/vendor/mypyc/test-data/irbuild-strip-asserts.test +0 -12
- jaclang/vendor/mypyc/test-data/irbuild-try.test +0 -523
- jaclang/vendor/mypyc/test-data/irbuild-tuple.test +0 -386
- jaclang/vendor/mypyc/test-data/irbuild-u8.test +0 -543
- jaclang/vendor/mypyc/test-data/irbuild-unreachable.test +0 -241
- jaclang/vendor/mypyc/test-data/irbuild-vectorcall.test +0 -153
- jaclang/vendor/mypyc/test-data/lowering-int.test +0 -377
- jaclang/vendor/mypyc/test-data/lowering-list.test +0 -33
- jaclang/vendor/mypyc/test-data/opt-copy-propagation.test +0 -400
- jaclang/vendor/mypyc/test-data/opt-flag-elimination.test +0 -296
- jaclang/vendor/mypyc/test-data/refcount.test +0 -1482
- jaclang/vendor/mypyc/test-data/run-async.test +0 -173
- jaclang/vendor/mypyc/test-data/run-attrs.test +0 -318
- jaclang/vendor/mypyc/test-data/run-bench.test +0 -196
- jaclang/vendor/mypyc/test-data/run-bools.test +0 -229
- jaclang/vendor/mypyc/test-data/run-bytes.test +0 -302
- jaclang/vendor/mypyc/test-data/run-classes.test +0 -2505
- jaclang/vendor/mypyc/test-data/run-dicts.test +0 -334
- jaclang/vendor/mypyc/test-data/run-dunders.test +0 -945
- jaclang/vendor/mypyc/test-data/run-exceptions.test +0 -448
- jaclang/vendor/mypyc/test-data/run-floats.test +0 -516
- jaclang/vendor/mypyc/test-data/run-functions.test +0 -1310
- jaclang/vendor/mypyc/test-data/run-generators.test +0 -682
- jaclang/vendor/mypyc/test-data/run-i16.test +0 -338
- jaclang/vendor/mypyc/test-data/run-i32.test +0 -336
- jaclang/vendor/mypyc/test-data/run-i64.test +0 -1519
- jaclang/vendor/mypyc/test-data/run-imports.test +0 -265
- jaclang/vendor/mypyc/test-data/run-integers.test +0 -540
- jaclang/vendor/mypyc/test-data/run-lists.test +0 -411
- jaclang/vendor/mypyc/test-data/run-loops.test +0 -485
- jaclang/vendor/mypyc/test-data/run-match.test +0 -283
- jaclang/vendor/mypyc/test-data/run-math.test +0 -106
- jaclang/vendor/mypyc/test-data/run-misc.test +0 -1170
- jaclang/vendor/mypyc/test-data/run-multimodule.test +0 -887
- jaclang/vendor/mypyc/test-data/run-mypy-sim.test +0 -138
- jaclang/vendor/mypyc/test-data/run-primitives.test +0 -375
- jaclang/vendor/mypyc/test-data/run-python37.test +0 -159
- jaclang/vendor/mypyc/test-data/run-python38.test +0 -88
- jaclang/vendor/mypyc/test-data/run-sets.test +0 -150
- jaclang/vendor/mypyc/test-data/run-singledispatch.test +0 -698
- jaclang/vendor/mypyc/test-data/run-strings.test +0 -641
- jaclang/vendor/mypyc/test-data/run-traits.test +0 -411
- jaclang/vendor/mypyc/test-data/run-tuples.test +0 -258
- jaclang/vendor/mypyc/test-data/run-u8.test +0 -303
- jaclang/vendor/mypyc/transform/__init__.py +0 -0
- jaclang/vendor/mypyc/transform/copy_propagation.py +0 -94
- jaclang/vendor/mypyc/transform/exceptions.py +0 -182
- jaclang/vendor/mypyc/transform/flag_elimination.py +0 -108
- jaclang/vendor/mypyc/transform/ir_transform.py +0 -368
- jaclang/vendor/mypyc/transform/lower.py +0 -33
- jaclang/vendor/mypyc/transform/refcount.py +0 -294
- jaclang/vendor/mypyc/transform/uninit.py +0 -190
- jaclang/vendor/typing_extensions-4.12.2.dist-info/LICENSE +0 -279
- jaclang/vendor/typing_extensions-4.12.2.dist-info/METADATA +0 -67
- jaclang/vendor/typing_extensions-4.12.2.dist-info/RECORD +0 -5
- jaclang/vendor/typing_extensions-4.12.2.dist-info/WHEEL +0 -4
- jaclang/vendor/typing_extensions.py +0 -3641
- jaclang-0.7.33.dist-info/RECORD +0 -1562
- /jaclang/{vendor/mypy/dmypy → compiler/larkparse}/__init__.py +0 -0
- /jaclang/{tests → compiler/passes/main/tests}/fixtures/access_checker.jac +0 -0
- /jaclang/{vendor/mypy/plugins/__init__.py → langserve/tests/fixtures/deep_check_crash.jac} +0 -0
- /jaclang/{vendor/mypy/server/__init__.py → langserve/tests/server_test/code_test.py} +0 -0
- /jaclang/{plugin → runtimelib}/tests/__init__.py +0 -0
- /jaclang/{plugin → runtimelib}/tests/fixtures/traversing_save.jac +0 -0
- /jaclang/{vendor/mypy/test → tests}/__init__.py +0 -0
- /jaclang/{vendor/mypy/test/meta → tests/fixtures}/__init__.py +0 -0
- /jaclang/tests/fixtures/{architype_def_bug.jac → archetype_def_bug.jac} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/concurrent/__init__.pyi → attrs-25.3.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/__init__.pyi → cattrs-24.1.3.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi → lark-1.2.2.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/entry_points.txt +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/top_level.txt +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/email/mime/__init__.pyi → lsprotocol-2023.0.1.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/lsprotocol-2023.0.1.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/__init__.pyi → pluggy-1.5.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/pluggy-1.5.0.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi → pygls-1.3.1.dist-info/REQUESTED} +0 -0
- {jaclang-0.7.33.dist-info → jaclang-0.8.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,92 +1,91 @@
|
|
|
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
|
-
with_entry_subnodelist =
|
|
64
|
+
def gen_mod_code(with_entry_body: list[uni.CodeBlockStmt]) -> uni.ModuleCode:
|
|
65
|
+
with_entry_subnodelist = uni.SubNodeList[uni.CodeBlockStmt](
|
|
67
66
|
items=with_entry_body,
|
|
68
67
|
delim=Tok.WS,
|
|
69
68
|
kid=with_entry_body,
|
|
70
69
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
71
70
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
72
71
|
)
|
|
73
|
-
return
|
|
72
|
+
return uni.ModuleCode(
|
|
74
73
|
name=None,
|
|
75
74
|
body=with_entry_subnodelist,
|
|
76
75
|
kid=[with_entry_subnodelist],
|
|
77
76
|
doc=None,
|
|
78
77
|
)
|
|
79
78
|
|
|
80
|
-
extracted: list[T |
|
|
81
|
-
with_entry_body: list[
|
|
79
|
+
extracted: list[T | uni.ModuleCode] = []
|
|
80
|
+
with_entry_body: list[uni.CodeBlockStmt] = []
|
|
82
81
|
for i in body:
|
|
83
82
|
if isinstance(i, exclude_types):
|
|
84
83
|
if len(with_entry_body):
|
|
85
84
|
extracted.append(gen_mod_code(with_entry_body))
|
|
86
85
|
with_entry_body = []
|
|
87
86
|
extracted.append(i)
|
|
88
|
-
elif isinstance(i,
|
|
89
|
-
if isinstance(i,
|
|
87
|
+
elif isinstance(i, uni.CodeBlockStmt):
|
|
88
|
+
if isinstance(i, uni.ExprStmt) and isinstance(i.expr, uni.String):
|
|
90
89
|
self.convert_to_doc(i.expr)
|
|
91
90
|
with_entry_body.append(i)
|
|
92
91
|
else:
|
|
@@ -96,7 +95,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
96
95
|
extracted.append(gen_mod_code(with_entry_body))
|
|
97
96
|
return extracted
|
|
98
97
|
|
|
99
|
-
def proc_module(self, node: py_ast.Module) ->
|
|
98
|
+
def proc_module(self, node: py_ast.Module) -> uni.Module:
|
|
100
99
|
"""Process python node.
|
|
101
100
|
|
|
102
101
|
class Module(mod):
|
|
@@ -104,37 +103,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
104
103
|
body: list[stmt]
|
|
105
104
|
type_ignores: list[TypeIgnore]
|
|
106
105
|
"""
|
|
107
|
-
elements: list[
|
|
106
|
+
elements: list[uni.UniNode] = [self.convert(i) for i in node.body]
|
|
108
107
|
elements[0] = (
|
|
109
108
|
elements[0].expr
|
|
110
|
-
if isinstance(elements[0],
|
|
111
|
-
and isinstance(elements[0].expr,
|
|
109
|
+
if isinstance(elements[0], uni.ExprStmt)
|
|
110
|
+
and isinstance(elements[0].expr, uni.String)
|
|
112
111
|
else elements[0]
|
|
113
112
|
)
|
|
114
|
-
doc_str_list = [elements[0]] if isinstance(elements[0],
|
|
113
|
+
doc_str_list = [elements[0]] if isinstance(elements[0], uni.String) else []
|
|
115
114
|
valid = (
|
|
116
115
|
(doc_str_list)
|
|
117
|
-
+ self.extract_with_entry(elements[1:], (
|
|
116
|
+
+ self.extract_with_entry(elements[1:], (uni.ElementStmt, uni.EmptyToken))
|
|
118
117
|
if doc_str_list
|
|
119
|
-
else self.extract_with_entry(elements[:], (
|
|
118
|
+
else self.extract_with_entry(elements[:], (uni.ElementStmt, uni.EmptyToken))
|
|
120
119
|
)
|
|
121
|
-
doc_str = elements[0] if isinstance(elements[0],
|
|
120
|
+
doc_str = elements[0] if isinstance(elements[0], uni.String) else None
|
|
122
121
|
self.convert_to_doc(doc_str) if doc_str else None
|
|
123
|
-
ret =
|
|
122
|
+
ret = uni.Module(
|
|
124
123
|
name=self.mod_path.split(os.path.sep)[-1].split(".")[0],
|
|
125
|
-
source=
|
|
124
|
+
source=uni.Source("", mod_path=self.mod_path),
|
|
126
125
|
doc=doc_str,
|
|
127
|
-
body=valid[1:] if valid and isinstance(valid[0],
|
|
126
|
+
body=valid[1:] if valid and isinstance(valid[0], uni.String) else valid,
|
|
128
127
|
terminals=[],
|
|
129
|
-
is_imported=False,
|
|
130
128
|
kid=valid,
|
|
131
129
|
)
|
|
132
|
-
ret.
|
|
130
|
+
ret.is_raised_from_py = True
|
|
133
131
|
return self.nu(ret)
|
|
134
132
|
|
|
135
133
|
def proc_function_def(
|
|
136
134
|
self, node: py_ast.FunctionDef | py_ast.AsyncFunctionDef
|
|
137
|
-
) ->
|
|
135
|
+
) -> uni.Ability:
|
|
138
136
|
"""Process python node.
|
|
139
137
|
|
|
140
138
|
class FunctionDef(stmt):
|
|
@@ -151,7 +149,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
151
149
|
reserved_keywords = [v for _, v in TOKEN_MAP.items()]
|
|
152
150
|
|
|
153
151
|
value = node.name if node.name not in reserved_keywords else f"<>{node.name}"
|
|
154
|
-
name =
|
|
152
|
+
name = uni.Name(
|
|
155
153
|
orig_src=self.orig_src,
|
|
156
154
|
name=Tok.NAME,
|
|
157
155
|
value=value,
|
|
@@ -163,19 +161,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
163
161
|
pos_end=0,
|
|
164
162
|
)
|
|
165
163
|
body = [self.convert(i) for i in node.body]
|
|
166
|
-
valid = [i for i in body if isinstance(i, (
|
|
164
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
167
165
|
if len(valid) != len(body):
|
|
168
166
|
raise self.ice("Length mismatch in function body")
|
|
169
167
|
|
|
170
168
|
if (
|
|
171
169
|
len(valid)
|
|
172
|
-
and isinstance(valid[0],
|
|
173
|
-
and isinstance(valid[0].expr,
|
|
170
|
+
and isinstance(valid[0], uni.ExprStmt)
|
|
171
|
+
and isinstance(valid[0].expr, uni.String)
|
|
174
172
|
):
|
|
175
173
|
self.convert_to_doc(valid[0].expr)
|
|
176
|
-
doc = valid[0]
|
|
177
|
-
valid_body =
|
|
178
|
-
items=
|
|
174
|
+
doc = valid[0].expr
|
|
175
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
176
|
+
items=valid[1:],
|
|
179
177
|
delim=Tok.WS,
|
|
180
178
|
kid=valid[1:] + [doc],
|
|
181
179
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
@@ -183,7 +181,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
183
181
|
)
|
|
184
182
|
else:
|
|
185
183
|
doc = None
|
|
186
|
-
valid_body =
|
|
184
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
187
185
|
items=valid,
|
|
188
186
|
delim=Tok.WS,
|
|
189
187
|
kid=valid,
|
|
@@ -191,24 +189,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
191
189
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
192
190
|
)
|
|
193
191
|
decorators = [self.convert(i) for i in node.decorator_list]
|
|
194
|
-
valid_dec = [i for i in decorators if isinstance(i,
|
|
192
|
+
valid_dec = [i for i in decorators if isinstance(i, uni.Expr)]
|
|
195
193
|
if len(valid_dec) != len(decorators):
|
|
196
194
|
raise self.ice("Length mismatch in decorators on function")
|
|
197
195
|
valid_decorators = (
|
|
198
|
-
|
|
196
|
+
uni.SubNodeList[uni.Expr](
|
|
199
197
|
items=valid_dec, delim=Tok.DECOR_OP, kid=decorators
|
|
200
198
|
)
|
|
201
199
|
if len(valid_dec)
|
|
202
200
|
else None
|
|
203
201
|
)
|
|
204
202
|
res = self.convert(node.args)
|
|
205
|
-
sig: Optional[
|
|
206
|
-
res if isinstance(res,
|
|
203
|
+
sig: Optional[uni.FuncSignature] = (
|
|
204
|
+
res if isinstance(res, uni.FuncSignature) else None
|
|
207
205
|
)
|
|
208
206
|
ret_sig = self.convert(node.returns) if node.returns else None
|
|
209
|
-
if isinstance(ret_sig,
|
|
207
|
+
if isinstance(ret_sig, uni.Expr):
|
|
210
208
|
if not sig:
|
|
211
|
-
sig =
|
|
209
|
+
sig = uni.FuncSignature(params=None, return_type=ret_sig, kid=[ret_sig])
|
|
212
210
|
else:
|
|
213
211
|
sig.return_type = ret_sig
|
|
214
212
|
sig.add_kids_right([sig.return_type])
|
|
@@ -217,7 +215,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
217
215
|
)
|
|
218
216
|
if not sig:
|
|
219
217
|
raise self.ice("Function signature not found")
|
|
220
|
-
ret =
|
|
218
|
+
ret = uni.Ability(
|
|
221
219
|
name_ref=name,
|
|
222
220
|
is_async=False,
|
|
223
221
|
is_static=False,
|
|
@@ -227,12 +225,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
227
225
|
signature=sig,
|
|
228
226
|
body=valid_body,
|
|
229
227
|
decorators=valid_decorators,
|
|
230
|
-
doc=
|
|
228
|
+
doc=doc,
|
|
231
229
|
kid=kid,
|
|
232
230
|
)
|
|
233
231
|
return ret
|
|
234
232
|
|
|
235
|
-
def proc_async_function_def(self, node: py_ast.AsyncFunctionDef) ->
|
|
233
|
+
def proc_async_function_def(self, node: py_ast.AsyncFunctionDef) -> uni.Ability:
|
|
236
234
|
"""Process python node.
|
|
237
235
|
|
|
238
236
|
class AsyncFunctionDef(stmt):
|
|
@@ -250,7 +248,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
250
248
|
ability.is_async = True
|
|
251
249
|
return ability
|
|
252
250
|
|
|
253
|
-
def proc_class_def(self, node: py_ast.ClassDef) ->
|
|
251
|
+
def proc_class_def(self, node: py_ast.ClassDef) -> uni.Archetype | uni.Enum:
|
|
254
252
|
"""Process python node.
|
|
255
253
|
|
|
256
254
|
class ClassDef(stmt):
|
|
@@ -264,7 +262,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
264
262
|
if sys.version_info >= (3, 12):
|
|
265
263
|
type_params: list[type_param]
|
|
266
264
|
"""
|
|
267
|
-
name =
|
|
265
|
+
name = uni.Name(
|
|
268
266
|
orig_src=self.orig_src,
|
|
269
267
|
name=Tok.NAME,
|
|
270
268
|
value=node.name,
|
|
@@ -275,7 +273,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
275
273
|
pos_start=0,
|
|
276
274
|
pos_end=0,
|
|
277
275
|
)
|
|
278
|
-
arch_type =
|
|
276
|
+
arch_type = uni.Token(
|
|
279
277
|
orig_src=self.orig_src,
|
|
280
278
|
name=Tok.KW_CLASS,
|
|
281
279
|
value="class",
|
|
@@ -289,11 +287,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
289
287
|
body = [self.convert(i) for i in node.body]
|
|
290
288
|
for body_stmt in body:
|
|
291
289
|
if (
|
|
292
|
-
isinstance(body_stmt,
|
|
293
|
-
and isinstance(body_stmt.name_ref,
|
|
290
|
+
isinstance(body_stmt, uni.Ability)
|
|
291
|
+
and isinstance(body_stmt.name_ref, uni.Name)
|
|
294
292
|
and body_stmt.name_ref.value == "__init__"
|
|
295
293
|
):
|
|
296
|
-
tok =
|
|
294
|
+
tok = uni.Name(
|
|
297
295
|
orig_src=self.orig_src,
|
|
298
296
|
name=Tok.KW_INIT,
|
|
299
297
|
value="init",
|
|
@@ -304,11 +302,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
304
302
|
pos_start=0,
|
|
305
303
|
pos_end=0,
|
|
306
304
|
)
|
|
307
|
-
body_stmt.name_ref =
|
|
305
|
+
body_stmt.name_ref = uni.SpecialVarRef(var=tok)
|
|
308
306
|
if (
|
|
309
|
-
isinstance(body_stmt,
|
|
307
|
+
isinstance(body_stmt, uni.Ability)
|
|
310
308
|
and body_stmt.signature
|
|
311
|
-
and isinstance(body_stmt.signature,
|
|
309
|
+
and isinstance(body_stmt.signature, uni.FuncSignature)
|
|
312
310
|
and body_stmt.signature.params
|
|
313
311
|
):
|
|
314
312
|
body_stmt.signature.params.items = [
|
|
@@ -318,22 +316,22 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
318
316
|
]
|
|
319
317
|
doc = (
|
|
320
318
|
body[0].expr
|
|
321
|
-
if isinstance(body[0],
|
|
322
|
-
and isinstance(body[0].expr,
|
|
319
|
+
if isinstance(body[0], uni.ExprStmt)
|
|
320
|
+
and isinstance(body[0].expr, uni.String)
|
|
323
321
|
else None
|
|
324
322
|
)
|
|
325
323
|
self.convert_to_doc(doc) if doc else None
|
|
326
324
|
body = body[1:] if doc else body
|
|
327
|
-
valid: list[
|
|
328
|
-
self.extract_with_entry(body,
|
|
329
|
-
if body and not (isinstance(body[0],
|
|
325
|
+
valid: list[uni.ArchBlockStmt] = (
|
|
326
|
+
self.extract_with_entry(body, uni.ArchBlockStmt)
|
|
327
|
+
if body and not (isinstance(body[0], uni.Semi) and len(body) == 1)
|
|
330
328
|
else []
|
|
331
329
|
)
|
|
332
|
-
empty_block: Sequence[
|
|
330
|
+
empty_block: Sequence[uni.UniNode] = [
|
|
333
331
|
self.operator(Tok.LBRACE, "{"),
|
|
334
332
|
self.operator(Tok.RBRACE, "}"),
|
|
335
333
|
]
|
|
336
|
-
valid_body =
|
|
334
|
+
valid_body = uni.SubNodeList[uni.ArchBlockStmt](
|
|
337
335
|
items=valid,
|
|
338
336
|
delim=Tok.WS,
|
|
339
337
|
kid=(valid if valid else empty_block),
|
|
@@ -341,90 +339,25 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
341
339
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
342
340
|
)
|
|
343
341
|
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,
|
|
342
|
+
base_classes: list[uni.Expr] = [
|
|
343
|
+
base for base in converted_base_classes if isinstance(base, uni.Expr)
|
|
346
344
|
]
|
|
347
345
|
valid_bases = (
|
|
348
|
-
|
|
346
|
+
uni.SubNodeList[uni.Expr](
|
|
349
347
|
items=base_classes, delim=Tok.COMMA, kid=base_classes
|
|
350
348
|
)
|
|
351
349
|
if base_classes
|
|
352
350
|
else None
|
|
353
351
|
)
|
|
354
352
|
converted_decorators_list = [self.convert(i) for i in node.decorator_list]
|
|
355
|
-
decorators = [i for i in converted_decorators_list if isinstance(i,
|
|
353
|
+
decorators = [i for i in converted_decorators_list if isinstance(i, uni.Expr)]
|
|
356
354
|
valid_decorators = (
|
|
357
|
-
|
|
355
|
+
uni.SubNodeList[uni.Expr](
|
|
358
356
|
items=decorators, delim=Tok.DECOR_OP, kid=decorators
|
|
359
357
|
)
|
|
360
358
|
if decorators
|
|
361
359
|
else None
|
|
362
360
|
)
|
|
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
|
-
)
|
|
428
361
|
kid = (
|
|
429
362
|
[name, valid_bases, valid_body, doc]
|
|
430
363
|
if doc and valid_bases
|
|
@@ -434,7 +367,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
434
367
|
else [name, valid_body, doc] if doc else [name, valid_body]
|
|
435
368
|
)
|
|
436
369
|
)
|
|
437
|
-
return
|
|
370
|
+
return uni.Archetype(
|
|
438
371
|
arch_type=arch_type,
|
|
439
372
|
name=name,
|
|
440
373
|
access=None,
|
|
@@ -445,7 +378,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
445
378
|
decorators=valid_decorators,
|
|
446
379
|
)
|
|
447
380
|
|
|
448
|
-
def proc_return(self, node: py_ast.Return) ->
|
|
381
|
+
def proc_return(self, node: py_ast.Return) -> uni.ReturnStmt | None:
|
|
449
382
|
"""Process python node.
|
|
450
383
|
|
|
451
384
|
class Return(stmt):
|
|
@@ -454,15 +387,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
454
387
|
"""
|
|
455
388
|
value = self.convert(node.value) if node.value else None
|
|
456
389
|
if not value:
|
|
457
|
-
return
|
|
390
|
+
return uni.ReturnStmt(
|
|
458
391
|
expr=None, kid=[self.operator(Tok.KW_RETURN, "return")]
|
|
459
392
|
)
|
|
460
|
-
elif value and isinstance(value,
|
|
461
|
-
return
|
|
393
|
+
elif value and isinstance(value, uni.Expr):
|
|
394
|
+
return uni.ReturnStmt(expr=value, kid=[value])
|
|
462
395
|
else:
|
|
463
396
|
raise self.ice("Invalid return value")
|
|
464
397
|
|
|
465
|
-
def proc_delete(self, node: py_ast.Delete) ->
|
|
398
|
+
def proc_delete(self, node: py_ast.Delete) -> uni.DeleteStmt:
|
|
466
399
|
"""Process python node.
|
|
467
400
|
|
|
468
401
|
class Delete(stmt):
|
|
@@ -470,23 +403,23 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
470
403
|
targets: list[expr]
|
|
471
404
|
"""
|
|
472
405
|
exprs = [self.convert(target) for target in node.targets]
|
|
473
|
-
valid_exprs = [expr for expr in exprs if isinstance(expr,
|
|
406
|
+
valid_exprs = [expr for expr in exprs if isinstance(expr, uni.Expr)]
|
|
474
407
|
if not len(valid_exprs) or len(valid_exprs) != len(exprs):
|
|
475
408
|
raise self.ice("Length mismatch in delete targets")
|
|
476
|
-
target =
|
|
409
|
+
target = uni.SubNodeList[uni.Expr | uni.KWPair](
|
|
477
410
|
items=[*valid_exprs], delim=Tok.COMMA, kid=exprs
|
|
478
411
|
)
|
|
479
412
|
target_1 = (
|
|
480
413
|
valid_exprs[0]
|
|
481
414
|
if len(valid_exprs) > 1
|
|
482
|
-
else
|
|
415
|
+
else uni.TupleVal(values=target, kid=[target])
|
|
483
416
|
)
|
|
484
|
-
return
|
|
417
|
+
return uni.DeleteStmt(
|
|
485
418
|
target=target_1,
|
|
486
419
|
kid=[target],
|
|
487
420
|
)
|
|
488
421
|
|
|
489
|
-
def proc_assign(self, node: py_ast.Assign) ->
|
|
422
|
+
def proc_assign(self, node: py_ast.Assign) -> uni.Assignment:
|
|
490
423
|
"""Process python node.
|
|
491
424
|
|
|
492
425
|
class Assign(stmt):
|
|
@@ -495,15 +428,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
495
428
|
"""
|
|
496
429
|
value = self.convert(node.value)
|
|
497
430
|
targets = [self.convert(target) for target in node.targets]
|
|
498
|
-
valid = [target for target in targets if isinstance(target,
|
|
431
|
+
valid = [target for target in targets if isinstance(target, uni.Expr)]
|
|
499
432
|
if len(valid) == len(targets):
|
|
500
|
-
valid_targets =
|
|
433
|
+
valid_targets = uni.SubNodeList[uni.Expr](
|
|
501
434
|
items=valid, delim=Tok.EQ, kid=valid
|
|
502
435
|
)
|
|
503
436
|
else:
|
|
504
437
|
raise self.ice("Length mismatch in assignment targets")
|
|
505
|
-
if isinstance(value,
|
|
506
|
-
return
|
|
438
|
+
if isinstance(value, uni.Expr):
|
|
439
|
+
return uni.Assignment(
|
|
507
440
|
target=valid_targets,
|
|
508
441
|
value=value,
|
|
509
442
|
type_tag=None,
|
|
@@ -512,7 +445,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
512
445
|
else:
|
|
513
446
|
raise self.ice()
|
|
514
447
|
|
|
515
|
-
def proc_aug_assign(self, node: py_ast.AugAssign) ->
|
|
448
|
+
def proc_aug_assign(self, node: py_ast.AugAssign) -> uni.Assignment:
|
|
516
449
|
"""Process python node.
|
|
517
450
|
|
|
518
451
|
class AugAssign(stmt):
|
|
@@ -525,18 +458,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
525
458
|
|
|
526
459
|
target = self.convert(node.target)
|
|
527
460
|
op = self.convert(node.op)
|
|
528
|
-
if isinstance(op,
|
|
461
|
+
if isinstance(op, uni.Token):
|
|
529
462
|
op.name = self.aug_op_map(TOKEN_MAP, op)
|
|
530
463
|
value = self.convert(node.value)
|
|
531
464
|
if (
|
|
532
|
-
isinstance(value,
|
|
533
|
-
and isinstance(target,
|
|
534
|
-
and isinstance(op,
|
|
465
|
+
isinstance(value, uni.Expr)
|
|
466
|
+
and isinstance(target, uni.Expr)
|
|
467
|
+
and isinstance(op, uni.Token)
|
|
535
468
|
):
|
|
536
|
-
targ =
|
|
469
|
+
targ = uni.SubNodeList[uni.Expr](
|
|
537
470
|
items=[target], delim=Tok.COMMA, kid=[target]
|
|
538
471
|
)
|
|
539
|
-
return
|
|
472
|
+
return uni.Assignment(
|
|
540
473
|
target=targ,
|
|
541
474
|
type_tag=None,
|
|
542
475
|
mutable=True,
|
|
@@ -547,7 +480,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
547
480
|
else:
|
|
548
481
|
raise self.ice()
|
|
549
482
|
|
|
550
|
-
def proc_ann_assign(self, node: py_ast.AnnAssign) ->
|
|
483
|
+
def proc_ann_assign(self, node: py_ast.AnnAssign) -> uni.Assignment:
|
|
551
484
|
"""Process python node.
|
|
552
485
|
|
|
553
486
|
class AnnAssign(stmt):
|
|
@@ -559,22 +492,22 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
559
492
|
"""
|
|
560
493
|
target = self.convert(node.target)
|
|
561
494
|
annotation = self.convert(node.annotation)
|
|
562
|
-
if isinstance(annotation,
|
|
563
|
-
annotation_subtag =
|
|
495
|
+
if isinstance(annotation, uni.Expr):
|
|
496
|
+
annotation_subtag = uni.SubTag[uni.Expr](tag=annotation, kid=[annotation])
|
|
564
497
|
else:
|
|
565
498
|
raise self.ice()
|
|
566
499
|
value = self.convert(node.value) if node.value else None
|
|
567
500
|
if (
|
|
568
|
-
(isinstance(value, (
|
|
569
|
-
and isinstance(annotation,
|
|
570
|
-
and isinstance(target,
|
|
501
|
+
(isinstance(value, (uni.Expr, uni.YieldExpr)) or not value)
|
|
502
|
+
and isinstance(annotation, uni.Expr)
|
|
503
|
+
and isinstance(target, uni.Expr)
|
|
571
504
|
):
|
|
572
|
-
target =
|
|
505
|
+
target = uni.SubNodeList[uni.Expr](
|
|
573
506
|
items=[target], delim=Tok.EQ, kid=[target]
|
|
574
507
|
)
|
|
575
|
-
return
|
|
508
|
+
return uni.Assignment(
|
|
576
509
|
target=target,
|
|
577
|
-
value=value if isinstance(value, (
|
|
510
|
+
value=value if isinstance(value, (uni.Expr, uni.YieldExpr)) else None,
|
|
578
511
|
type_tag=annotation_subtag,
|
|
579
512
|
kid=(
|
|
580
513
|
[target, annotation_subtag, value]
|
|
@@ -585,7 +518,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
585
518
|
else:
|
|
586
519
|
raise self.ice()
|
|
587
520
|
|
|
588
|
-
def proc_for(self, node: py_ast.For) ->
|
|
521
|
+
def proc_for(self, node: py_ast.For) -> uni.InForStmt:
|
|
589
522
|
"""Process python node.
|
|
590
523
|
|
|
591
524
|
class For(stmt):
|
|
@@ -598,11 +531,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
598
531
|
target = self.convert(node.target)
|
|
599
532
|
iter = self.convert(node.iter)
|
|
600
533
|
body = [self.convert(i) for i in node.body]
|
|
601
|
-
val_body = [i for i in body if isinstance(i,
|
|
534
|
+
val_body = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
602
535
|
if len(val_body) != len(body):
|
|
603
536
|
raise self.ice("Length mismatch in for body")
|
|
604
537
|
|
|
605
|
-
valid_body =
|
|
538
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
606
539
|
items=val_body,
|
|
607
540
|
delim=Tok.WS,
|
|
608
541
|
kid=val_body,
|
|
@@ -610,11 +543,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
610
543
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
611
544
|
)
|
|
612
545
|
orelse = [self.convert(i) for i in node.orelse]
|
|
613
|
-
val_orelse = [i for i in orelse if isinstance(i,
|
|
546
|
+
val_orelse = [i for i in orelse if isinstance(i, uni.CodeBlockStmt)]
|
|
614
547
|
if len(val_orelse) != len(orelse):
|
|
615
548
|
raise self.ice("Length mismatch in for orelse")
|
|
616
549
|
if orelse:
|
|
617
|
-
valid_orelse =
|
|
550
|
+
valid_orelse = uni.SubNodeList[uni.CodeBlockStmt](
|
|
618
551
|
items=val_orelse,
|
|
619
552
|
delim=Tok.WS,
|
|
620
553
|
kid=orelse,
|
|
@@ -624,12 +557,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
624
557
|
else:
|
|
625
558
|
valid_orelse = None
|
|
626
559
|
fin_orelse = (
|
|
627
|
-
|
|
560
|
+
uni.ElseStmt(body=valid_orelse, kid=[valid_orelse])
|
|
628
561
|
if valid_orelse
|
|
629
562
|
else None
|
|
630
563
|
)
|
|
631
|
-
if isinstance(target,
|
|
632
|
-
return
|
|
564
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
565
|
+
return uni.InForStmt(
|
|
633
566
|
target=target,
|
|
634
567
|
is_async=False,
|
|
635
568
|
collection=iter,
|
|
@@ -644,7 +577,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
644
577
|
else:
|
|
645
578
|
raise self.ice()
|
|
646
579
|
|
|
647
|
-
def proc_async_for(self, node: py_ast.AsyncFor) ->
|
|
580
|
+
def proc_async_for(self, node: py_ast.AsyncFor) -> uni.InForStmt:
|
|
648
581
|
"""Process AsyncFor node.
|
|
649
582
|
|
|
650
583
|
class AsyncFor(stmt):
|
|
@@ -657,11 +590,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
657
590
|
target = self.convert(node.target)
|
|
658
591
|
iter = self.convert(node.iter)
|
|
659
592
|
body = [self.convert(i) for i in node.body]
|
|
660
|
-
val_body = [i for i in body if isinstance(i,
|
|
593
|
+
val_body = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
661
594
|
if len(val_body) != len(body):
|
|
662
595
|
raise self.ice("Length mismatch in for body")
|
|
663
596
|
|
|
664
|
-
valid_body =
|
|
597
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
665
598
|
items=val_body,
|
|
666
599
|
delim=Tok.WS,
|
|
667
600
|
kid=val_body,
|
|
@@ -669,11 +602,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
669
602
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
670
603
|
)
|
|
671
604
|
orelse = [self.convert(i) for i in node.orelse]
|
|
672
|
-
val_orelse = [i for i in orelse if isinstance(i,
|
|
605
|
+
val_orelse = [i for i in orelse if isinstance(i, uni.CodeBlockStmt)]
|
|
673
606
|
if len(val_orelse) != len(orelse):
|
|
674
607
|
raise self.ice("Length mismatch in for orelse")
|
|
675
608
|
if orelse:
|
|
676
|
-
valid_orelse =
|
|
609
|
+
valid_orelse = uni.SubNodeList[uni.CodeBlockStmt](
|
|
677
610
|
items=val_orelse,
|
|
678
611
|
delim=Tok.WS,
|
|
679
612
|
kid=orelse,
|
|
@@ -683,12 +616,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
683
616
|
else:
|
|
684
617
|
valid_orelse = None
|
|
685
618
|
fin_orelse = (
|
|
686
|
-
|
|
619
|
+
uni.ElseStmt(body=valid_orelse, kid=[valid_orelse])
|
|
687
620
|
if valid_orelse
|
|
688
621
|
else None
|
|
689
622
|
)
|
|
690
|
-
if isinstance(target,
|
|
691
|
-
return
|
|
623
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
624
|
+
return uni.InForStmt(
|
|
692
625
|
target=target,
|
|
693
626
|
is_async=True,
|
|
694
627
|
collection=iter,
|
|
@@ -703,7 +636,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
703
636
|
else:
|
|
704
637
|
raise self.ice()
|
|
705
638
|
|
|
706
|
-
def proc_while(self, node: py_ast.While) ->
|
|
639
|
+
def proc_while(self, node: py_ast.While) -> uni.WhileStmt:
|
|
707
640
|
"""Process While node.
|
|
708
641
|
|
|
709
642
|
class While(stmt):
|
|
@@ -714,18 +647,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
714
647
|
"""
|
|
715
648
|
test = self.convert(node.test)
|
|
716
649
|
body = [self.convert(stmt) for stmt in node.body]
|
|
717
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
650
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
718
651
|
if len(valid_body) != len(body):
|
|
719
652
|
raise self.ice("Length mismatch in while body")
|
|
720
|
-
fin_body =
|
|
653
|
+
fin_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
721
654
|
items=valid_body,
|
|
722
655
|
delim=Tok.WS,
|
|
723
656
|
kid=valid_body,
|
|
724
657
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
725
658
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
726
659
|
)
|
|
727
|
-
if isinstance(test,
|
|
728
|
-
return
|
|
660
|
+
if isinstance(test, uni.Expr):
|
|
661
|
+
return uni.WhileStmt(
|
|
729
662
|
condition=test,
|
|
730
663
|
body=fin_body,
|
|
731
664
|
kid=[test, fin_body],
|
|
@@ -733,7 +666,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
733
666
|
else:
|
|
734
667
|
raise self.ice()
|
|
735
668
|
|
|
736
|
-
def proc_if(self, node: py_ast.If) ->
|
|
669
|
+
def proc_if(self, node: py_ast.If) -> uni.IfStmt:
|
|
737
670
|
"""Process If node.
|
|
738
671
|
|
|
739
672
|
class If(stmt):
|
|
@@ -744,10 +677,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
744
677
|
"""
|
|
745
678
|
test = self.convert(node.test)
|
|
746
679
|
body = [self.convert(stmt) for stmt in node.body]
|
|
747
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
680
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
748
681
|
if len(valid_body) != len(body):
|
|
749
|
-
self.
|
|
750
|
-
body2 =
|
|
682
|
+
self.log_error("Length mismatch in async for body")
|
|
683
|
+
body2 = uni.SubNodeList[uni.CodeBlockStmt](
|
|
751
684
|
items=valid_body,
|
|
752
685
|
delim=Tok.WS,
|
|
753
686
|
kid=body,
|
|
@@ -757,30 +690,30 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
757
690
|
|
|
758
691
|
orelse = [self.convert(stmt) for stmt in node.orelse]
|
|
759
692
|
valid_orelse = [
|
|
760
|
-
stmt for stmt in orelse if isinstance(stmt, (
|
|
693
|
+
stmt for stmt in orelse if isinstance(stmt, (uni.CodeBlockStmt))
|
|
761
694
|
]
|
|
762
695
|
if valid_orelse:
|
|
763
696
|
first_elm = valid_orelse[0]
|
|
764
|
-
if isinstance(first_elm,
|
|
765
|
-
else_body: Optional[
|
|
697
|
+
if isinstance(first_elm, uni.IfStmt):
|
|
698
|
+
else_body: Optional[uni.ElseIf | uni.ElseStmt] = uni.ElseIf(
|
|
766
699
|
condition=first_elm.condition,
|
|
767
700
|
body=first_elm.body,
|
|
768
701
|
else_body=first_elm.else_body,
|
|
769
702
|
kid=first_elm.kid,
|
|
770
703
|
)
|
|
771
704
|
else:
|
|
772
|
-
orelse2 =
|
|
705
|
+
orelse2 = uni.SubNodeList[uni.CodeBlockStmt](
|
|
773
706
|
items=valid_orelse,
|
|
774
707
|
delim=Tok.WS,
|
|
775
708
|
kid=orelse,
|
|
776
709
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
777
710
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
778
711
|
)
|
|
779
|
-
else_body =
|
|
712
|
+
else_body = uni.ElseStmt(body=orelse2, kid=[orelse2])
|
|
780
713
|
else:
|
|
781
714
|
else_body = None
|
|
782
|
-
if isinstance(test,
|
|
783
|
-
ret =
|
|
715
|
+
if isinstance(test, uni.Expr):
|
|
716
|
+
ret = uni.IfStmt(
|
|
784
717
|
condition=test,
|
|
785
718
|
body=body2,
|
|
786
719
|
else_body=else_body,
|
|
@@ -790,7 +723,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
790
723
|
raise self.ice()
|
|
791
724
|
return ret
|
|
792
725
|
|
|
793
|
-
def proc_with(self, node: py_ast.With) ->
|
|
726
|
+
def proc_with(self, node: py_ast.With) -> uni.WithStmt:
|
|
794
727
|
"""Process With node.
|
|
795
728
|
|
|
796
729
|
class With(stmt):
|
|
@@ -799,28 +732,28 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
799
732
|
body: list[stmt]
|
|
800
733
|
"""
|
|
801
734
|
items = [self.convert(item) for item in node.items]
|
|
802
|
-
valid_items = [item for item in items if isinstance(item,
|
|
735
|
+
valid_items = [item for item in items if isinstance(item, uni.ExprAsItem)]
|
|
803
736
|
if len(valid_items) != len(items):
|
|
804
737
|
raise self.ice("Length mismatch in with items")
|
|
805
|
-
items_sub =
|
|
738
|
+
items_sub = uni.SubNodeList[uni.ExprAsItem](
|
|
806
739
|
items=valid_items, delim=Tok.COMMA, kid=items
|
|
807
740
|
)
|
|
808
741
|
body = [self.convert(stmt) for stmt in node.body]
|
|
809
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
742
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
810
743
|
if len(valid_body) != len(body):
|
|
811
744
|
raise self.ice("Length mismatch in async for body")
|
|
812
|
-
body_sub =
|
|
745
|
+
body_sub = uni.SubNodeList[uni.CodeBlockStmt](
|
|
813
746
|
items=valid_body,
|
|
814
747
|
delim=Tok.WS,
|
|
815
748
|
kid=body,
|
|
816
749
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
817
750
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
818
751
|
)
|
|
819
|
-
return
|
|
752
|
+
return uni.WithStmt(
|
|
820
753
|
is_async=False, exprs=items_sub, body=body_sub, kid=[items_sub, body_sub]
|
|
821
754
|
)
|
|
822
755
|
|
|
823
|
-
def proc_async_with(self, node: py_ast.AsyncWith) ->
|
|
756
|
+
def proc_async_with(self, node: py_ast.AsyncWith) -> uni.WithStmt:
|
|
824
757
|
"""Process AsyncWith node.
|
|
825
758
|
|
|
826
759
|
class AsyncWith(stmt):
|
|
@@ -829,28 +762,28 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
829
762
|
body: list[stmt]
|
|
830
763
|
"""
|
|
831
764
|
items = [self.convert(item) for item in node.items]
|
|
832
|
-
valid_items = [item for item in items if isinstance(item,
|
|
765
|
+
valid_items = [item for item in items if isinstance(item, uni.ExprAsItem)]
|
|
833
766
|
if len(valid_items) != len(items):
|
|
834
767
|
raise self.ice("Length mismatch in with items")
|
|
835
|
-
items_sub =
|
|
768
|
+
items_sub = uni.SubNodeList[uni.ExprAsItem](
|
|
836
769
|
items=valid_items, delim=Tok.COMMA, kid=items
|
|
837
770
|
)
|
|
838
771
|
body = [self.convert(stmt) for stmt in node.body]
|
|
839
|
-
valid_body = [stmt for stmt in body if isinstance(stmt,
|
|
772
|
+
valid_body = [stmt for stmt in body if isinstance(stmt, uni.CodeBlockStmt)]
|
|
840
773
|
if len(valid_body) != len(body):
|
|
841
774
|
raise self.ice("Length mismatch in async for body")
|
|
842
|
-
body_sub =
|
|
775
|
+
body_sub = uni.SubNodeList[uni.CodeBlockStmt](
|
|
843
776
|
items=valid_body,
|
|
844
777
|
delim=Tok.WS,
|
|
845
778
|
kid=body,
|
|
846
779
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
847
780
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
848
781
|
)
|
|
849
|
-
return
|
|
782
|
+
return uni.WithStmt(
|
|
850
783
|
is_async=True, exprs=items_sub, body=body_sub, kid=[items_sub, body_sub]
|
|
851
784
|
)
|
|
852
785
|
|
|
853
|
-
def proc_raise(self, node: py_ast.Raise) ->
|
|
786
|
+
def proc_raise(self, node: py_ast.Raise) -> uni.RaiseStmt:
|
|
854
787
|
"""Process python node.
|
|
855
788
|
|
|
856
789
|
class Raise(stmt):
|
|
@@ -859,28 +792,28 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
859
792
|
"""
|
|
860
793
|
exc = self.convert(node.exc) if node.exc else None
|
|
861
794
|
cause = self.convert(node.cause) if node.cause else None
|
|
862
|
-
kid: list[
|
|
863
|
-
if isinstance(exc,
|
|
795
|
+
kid: list[uni.Expr | uni.Token] = []
|
|
796
|
+
if isinstance(exc, uni.Expr):
|
|
864
797
|
kid = [exc]
|
|
865
|
-
if isinstance(cause,
|
|
798
|
+
if isinstance(cause, uni.Expr):
|
|
866
799
|
kid.append(cause)
|
|
867
800
|
if not (exc and cause):
|
|
868
801
|
kid.append(self.operator(Tok.KW_RAISE, "raise"))
|
|
869
|
-
if (isinstance(cause,
|
|
870
|
-
isinstance(exc,
|
|
802
|
+
if (isinstance(cause, uni.Expr) or cause is None) and (
|
|
803
|
+
isinstance(exc, uni.Expr) or exc is None
|
|
871
804
|
):
|
|
872
805
|
if exc and not node.cause:
|
|
873
|
-
return
|
|
806
|
+
return uni.RaiseStmt(
|
|
874
807
|
cause=exc,
|
|
875
808
|
from_target=None,
|
|
876
809
|
kid=[self.operator(Tok.KW_RAISE, "raise"), exc],
|
|
877
810
|
)
|
|
878
811
|
else:
|
|
879
|
-
return
|
|
812
|
+
return uni.RaiseStmt(cause=cause, from_target=exc, kid=kid)
|
|
880
813
|
else:
|
|
881
814
|
raise self.ice()
|
|
882
815
|
|
|
883
|
-
def proc_assert(self, node: py_ast.Assert) ->
|
|
816
|
+
def proc_assert(self, node: py_ast.Assert) -> uni.AssertStmt:
|
|
884
817
|
"""Process python node.
|
|
885
818
|
|
|
886
819
|
class Assert(stmt):
|
|
@@ -889,8 +822,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
889
822
|
"""
|
|
890
823
|
test = self.convert(node.test)
|
|
891
824
|
msg = self.convert(node.msg) if node.msg else None
|
|
892
|
-
if isinstance(test,
|
|
893
|
-
return
|
|
825
|
+
if isinstance(test, uni.Expr) and (isinstance(msg, uni.Expr) or msg is None):
|
|
826
|
+
return uni.AssertStmt(
|
|
894
827
|
condition=test,
|
|
895
828
|
error_msg=msg,
|
|
896
829
|
kid=[test, msg] if msg else [test],
|
|
@@ -898,7 +831,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
898
831
|
else:
|
|
899
832
|
raise self.ice()
|
|
900
833
|
|
|
901
|
-
def proc_attribute(self, node: py_ast.Attribute) ->
|
|
834
|
+
def proc_attribute(self, node: py_ast.Attribute) -> uni.AtomTrailer:
|
|
902
835
|
"""Proassignment targetscess python node.
|
|
903
836
|
|
|
904
837
|
class Attribute(expr):
|
|
@@ -910,11 +843,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
910
843
|
"""
|
|
911
844
|
value = self.convert(node.value)
|
|
912
845
|
if (
|
|
913
|
-
isinstance(value,
|
|
914
|
-
and isinstance(value.target,
|
|
846
|
+
isinstance(value, uni.FuncCall)
|
|
847
|
+
and isinstance(value.target, uni.Name)
|
|
915
848
|
and value.target.value == "super"
|
|
916
849
|
):
|
|
917
|
-
tok =
|
|
850
|
+
tok = uni.Name(
|
|
918
851
|
orig_src=self.orig_src,
|
|
919
852
|
name=Tok.KW_SUPER,
|
|
920
853
|
value="super",
|
|
@@ -925,9 +858,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
925
858
|
pos_start=0,
|
|
926
859
|
pos_end=0,
|
|
927
860
|
)
|
|
928
|
-
value =
|
|
861
|
+
value = uni.SpecialVarRef(var=tok)
|
|
929
862
|
# exit()
|
|
930
|
-
attribute =
|
|
863
|
+
attribute = uni.Name(
|
|
931
864
|
orig_src=self.orig_src,
|
|
932
865
|
name=Tok.NAME,
|
|
933
866
|
value=(
|
|
@@ -942,8 +875,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
942
875
|
pos_start=0,
|
|
943
876
|
pos_end=0,
|
|
944
877
|
)
|
|
945
|
-
if isinstance(value,
|
|
946
|
-
return
|
|
878
|
+
if isinstance(value, uni.Expr):
|
|
879
|
+
return uni.AtomTrailer(
|
|
947
880
|
target=value,
|
|
948
881
|
right=attribute,
|
|
949
882
|
is_attr=True,
|
|
@@ -953,19 +886,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
953
886
|
else:
|
|
954
887
|
raise self.ice()
|
|
955
888
|
|
|
956
|
-
def proc_await(self, node: py_ast.Await) ->
|
|
889
|
+
def proc_await(self, node: py_ast.Await) -> uni.AwaitExpr:
|
|
957
890
|
"""Process python node.
|
|
958
891
|
|
|
959
892
|
class Await(expr):
|
|
960
893
|
value: expr
|
|
961
894
|
"""
|
|
962
895
|
value = self.convert(node.value)
|
|
963
|
-
if isinstance(value,
|
|
964
|
-
return
|
|
896
|
+
if isinstance(value, uni.Expr):
|
|
897
|
+
return uni.AwaitExpr(target=value, kid=[value])
|
|
965
898
|
else:
|
|
966
899
|
raise self.ice()
|
|
967
900
|
|
|
968
|
-
def proc_bin_op(self, node: py_ast.BinOp) ->
|
|
901
|
+
def proc_bin_op(self, node: py_ast.BinOp) -> uni.AtomUnit:
|
|
969
902
|
"""Process python node.
|
|
970
903
|
|
|
971
904
|
class BinOp(expr):
|
|
@@ -979,17 +912,17 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
979
912
|
op = self.convert(node.op)
|
|
980
913
|
right = self.convert(node.right)
|
|
981
914
|
if (
|
|
982
|
-
isinstance(left,
|
|
983
|
-
and isinstance(op,
|
|
984
|
-
and isinstance(right,
|
|
915
|
+
isinstance(left, uni.Expr)
|
|
916
|
+
and isinstance(op, uni.Token)
|
|
917
|
+
and isinstance(right, uni.Expr)
|
|
985
918
|
):
|
|
986
|
-
value =
|
|
919
|
+
value = uni.BinaryExpr(
|
|
987
920
|
left=left,
|
|
988
921
|
op=op,
|
|
989
922
|
right=right,
|
|
990
923
|
kid=[left, op, right],
|
|
991
924
|
)
|
|
992
|
-
return
|
|
925
|
+
return uni.AtomUnit(
|
|
993
926
|
value=value,
|
|
994
927
|
kid=[
|
|
995
928
|
self.operator(Tok.RPAREN, "("),
|
|
@@ -1000,7 +933,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1000
933
|
else:
|
|
1001
934
|
raise self.ice()
|
|
1002
935
|
|
|
1003
|
-
def proc_unary_op(self, node: py_ast.UnaryOp) ->
|
|
936
|
+
def proc_unary_op(self, node: py_ast.UnaryOp) -> uni.UnaryExpr:
|
|
1004
937
|
"""Process python node.
|
|
1005
938
|
|
|
1006
939
|
class UnaryOp(expr):
|
|
@@ -1009,8 +942,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1009
942
|
"""
|
|
1010
943
|
op = self.convert(node.op)
|
|
1011
944
|
operand = self.convert(node.operand)
|
|
1012
|
-
if isinstance(op,
|
|
1013
|
-
return
|
|
945
|
+
if isinstance(op, uni.Token) and isinstance(operand, uni.Expr):
|
|
946
|
+
return uni.UnaryExpr(
|
|
1014
947
|
op=op,
|
|
1015
948
|
operand=operand,
|
|
1016
949
|
kid=[op, operand],
|
|
@@ -1018,7 +951,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1018
951
|
else:
|
|
1019
952
|
raise self.ice()
|
|
1020
953
|
|
|
1021
|
-
def proc_bool_op(self, node: py_ast.BoolOp) ->
|
|
954
|
+
def proc_bool_op(self, node: py_ast.BoolOp) -> uni.AtomUnit:
|
|
1022
955
|
"""Process python node.
|
|
1023
956
|
|
|
1024
957
|
class BoolOp(expr): a and b and c
|
|
@@ -1027,18 +960,26 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1027
960
|
"""
|
|
1028
961
|
op = self.convert(node.op)
|
|
1029
962
|
values = [self.convert(value) for value in node.values]
|
|
1030
|
-
valid = [value for value in values if isinstance(value,
|
|
1031
|
-
valid_values =
|
|
963
|
+
valid = [value for value in values if isinstance(value, uni.Expr)]
|
|
964
|
+
valid_values = uni.SubNodeList[uni.Expr](
|
|
1032
965
|
items=valid, delim=Tok.COMMA, kid=values
|
|
1033
966
|
)
|
|
1034
|
-
if isinstance(op,
|
|
1035
|
-
|
|
967
|
+
if isinstance(op, uni.Token) and len(valid) == len(values):
|
|
968
|
+
expr = uni.BoolExpr(op=op, values=valid, kid=[op, valid_values])
|
|
969
|
+
return uni.AtomUnit(
|
|
970
|
+
value=expr,
|
|
971
|
+
kid=[
|
|
972
|
+
self.operator(Tok.RPAREN, "("),
|
|
973
|
+
expr,
|
|
974
|
+
self.operator(Tok.LPAREN, ")"),
|
|
975
|
+
],
|
|
976
|
+
)
|
|
1036
977
|
else:
|
|
1037
978
|
raise self.ice()
|
|
1038
979
|
|
|
1039
|
-
def proc_break(self, node: py_ast.Break) ->
|
|
980
|
+
def proc_break(self, node: py_ast.Break) -> uni.CtrlStmt:
|
|
1040
981
|
"""Process python node."""
|
|
1041
|
-
break_tok =
|
|
982
|
+
break_tok = uni.Token(
|
|
1042
983
|
orig_src=self.orig_src,
|
|
1043
984
|
name=Tok.KW_BREAK,
|
|
1044
985
|
value="break",
|
|
@@ -1049,9 +990,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1049
990
|
pos_start=0,
|
|
1050
991
|
pos_end=0,
|
|
1051
992
|
)
|
|
1052
|
-
return
|
|
993
|
+
return uni.CtrlStmt(ctrl=break_tok, kid=[break_tok])
|
|
1053
994
|
|
|
1054
|
-
def proc_call(self, node: py_ast.Call) ->
|
|
995
|
+
def proc_call(self, node: py_ast.Call) -> uni.FuncCall:
|
|
1055
996
|
"""Process python node.
|
|
1056
997
|
|
|
1057
998
|
class Call(expr):
|
|
@@ -1062,24 +1003,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1062
1003
|
keywords: list[keyword]
|
|
1063
1004
|
"""
|
|
1064
1005
|
func = self.convert(node.func)
|
|
1065
|
-
params_in: list[
|
|
1006
|
+
params_in: list[uni.Expr | uni.KWPair] = []
|
|
1066
1007
|
args = [self.convert(arg) for arg in node.args]
|
|
1067
1008
|
keywords = [self.convert(keyword) for keyword in node.keywords]
|
|
1068
1009
|
|
|
1069
1010
|
for i in args:
|
|
1070
|
-
if isinstance(i,
|
|
1011
|
+
if isinstance(i, uni.Expr):
|
|
1071
1012
|
params_in.append(i)
|
|
1072
1013
|
for i in keywords:
|
|
1073
|
-
if isinstance(i,
|
|
1014
|
+
if isinstance(i, uni.KWPair):
|
|
1074
1015
|
params_in.append(i)
|
|
1075
1016
|
if len(params_in) != 0:
|
|
1076
|
-
params_in2 =
|
|
1017
|
+
params_in2 = uni.SubNodeList[uni.Expr | uni.KWPair](
|
|
1077
1018
|
items=params_in, delim=Tok.COMMA, kid=params_in
|
|
1078
1019
|
)
|
|
1079
1020
|
else:
|
|
1080
1021
|
params_in2 = None
|
|
1081
|
-
if isinstance(func,
|
|
1082
|
-
return
|
|
1022
|
+
if isinstance(func, uni.Expr):
|
|
1023
|
+
return uni.FuncCall(
|
|
1083
1024
|
target=func,
|
|
1084
1025
|
params=params_in2,
|
|
1085
1026
|
genai_call=None,
|
|
@@ -1088,7 +1029,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1088
1029
|
else:
|
|
1089
1030
|
raise self.ice()
|
|
1090
1031
|
|
|
1091
|
-
def proc_compare(self, node: py_ast.Compare) ->
|
|
1032
|
+
def proc_compare(self, node: py_ast.Compare) -> uni.AtomUnit:
|
|
1092
1033
|
"""Process python node.
|
|
1093
1034
|
|
|
1094
1035
|
class Compare(expr):
|
|
@@ -1101,28 +1042,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1101
1042
|
left = self.convert(node.left)
|
|
1102
1043
|
comparators = [self.convert(comparator) for comparator in node.comparators]
|
|
1103
1044
|
valid_comparators = [
|
|
1104
|
-
comparator for comparator in comparators if isinstance(comparator,
|
|
1045
|
+
comparator for comparator in comparators if isinstance(comparator, uni.Expr)
|
|
1105
1046
|
]
|
|
1106
|
-
comparators2 =
|
|
1047
|
+
comparators2 = uni.SubNodeList[uni.Expr](
|
|
1107
1048
|
items=valid_comparators, delim=Tok.COMMA, kid=comparators
|
|
1108
1049
|
)
|
|
1109
1050
|
ops = [self.convert(op) for op in node.ops]
|
|
1110
|
-
valid_ops = [op for op in ops if isinstance(op,
|
|
1111
|
-
ops2 =
|
|
1051
|
+
valid_ops = [op for op in ops if isinstance(op, uni.Token)]
|
|
1052
|
+
ops2 = uni.SubNodeList[uni.Token](items=valid_ops, delim=Tok.COMMA, kid=ops)
|
|
1112
1053
|
|
|
1113
1054
|
kids = [left, ops2, comparators2]
|
|
1114
1055
|
if (
|
|
1115
|
-
isinstance(left,
|
|
1056
|
+
isinstance(left, uni.Expr)
|
|
1116
1057
|
and len(ops) == len(valid_ops)
|
|
1117
1058
|
and len(comparators) == len(valid_comparators)
|
|
1118
1059
|
):
|
|
1119
|
-
|
|
1060
|
+
expr = uni.CompareExpr(
|
|
1120
1061
|
left=left, rights=valid_comparators, ops=valid_ops, kid=kids
|
|
1121
1062
|
)
|
|
1063
|
+
return uni.AtomUnit(
|
|
1064
|
+
value=expr,
|
|
1065
|
+
kid=[
|
|
1066
|
+
self.operator(Tok.RPAREN, "("),
|
|
1067
|
+
expr,
|
|
1068
|
+
self.operator(Tok.LPAREN, ")"),
|
|
1069
|
+
],
|
|
1070
|
+
)
|
|
1122
1071
|
else:
|
|
1123
1072
|
raise self.ice()
|
|
1124
1073
|
|
|
1125
|
-
def proc_constant(self, node: py_ast.Constant) ->
|
|
1074
|
+
def proc_constant(self, node: py_ast.Constant) -> uni.Literal:
|
|
1126
1075
|
"""Process python node.
|
|
1127
1076
|
|
|
1128
1077
|
class Constant(expr):
|
|
@@ -1133,12 +1082,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1133
1082
|
n: int | float | complex
|
|
1134
1083
|
"""
|
|
1135
1084
|
type_mapping = {
|
|
1136
|
-
int:
|
|
1137
|
-
float:
|
|
1138
|
-
str:
|
|
1139
|
-
bytes:
|
|
1140
|
-
bool:
|
|
1141
|
-
type(None):
|
|
1085
|
+
int: uni.Int,
|
|
1086
|
+
float: uni.Float,
|
|
1087
|
+
str: uni.String,
|
|
1088
|
+
bytes: uni.String,
|
|
1089
|
+
bool: uni.Bool,
|
|
1090
|
+
type(None): uni.Null,
|
|
1142
1091
|
}
|
|
1143
1092
|
value_type = type(node.value)
|
|
1144
1093
|
if value_type in type_mapping:
|
|
@@ -1167,7 +1116,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1167
1116
|
pos_end=0,
|
|
1168
1117
|
)
|
|
1169
1118
|
elif node.value == Ellipsis:
|
|
1170
|
-
return
|
|
1119
|
+
return uni.Ellipsis(
|
|
1171
1120
|
orig_src=self.orig_src,
|
|
1172
1121
|
name=Tok.ELLIPSIS,
|
|
1173
1122
|
value="...",
|
|
@@ -1181,9 +1130,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1181
1130
|
else:
|
|
1182
1131
|
raise self.ice("Invalid type for constant")
|
|
1183
1132
|
|
|
1184
|
-
def proc_continue(self, node: py_ast.Continue) ->
|
|
1133
|
+
def proc_continue(self, node: py_ast.Continue) -> uni.CtrlStmt:
|
|
1185
1134
|
"""Process python node."""
|
|
1186
|
-
continue_tok =
|
|
1135
|
+
continue_tok = uni.Token(
|
|
1187
1136
|
orig_src=self.orig_src,
|
|
1188
1137
|
name=Tok.KW_CONTINUE,
|
|
1189
1138
|
value="continue",
|
|
@@ -1194,9 +1143,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1194
1143
|
pos_start=0,
|
|
1195
1144
|
pos_end=0,
|
|
1196
1145
|
)
|
|
1197
|
-
return
|
|
1146
|
+
return uni.CtrlStmt(ctrl=continue_tok, kid=[continue_tok])
|
|
1198
1147
|
|
|
1199
|
-
def proc_dict(self, node: py_ast.Dict) ->
|
|
1148
|
+
def proc_dict(self, node: py_ast.Dict) -> uni.DictVal:
|
|
1200
1149
|
"""Process python node.
|
|
1201
1150
|
|
|
1202
1151
|
class Dict(expr):
|
|
@@ -1205,18 +1154,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1205
1154
|
"""
|
|
1206
1155
|
keys = [self.convert(i) if i else None for i in node.keys]
|
|
1207
1156
|
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[
|
|
1157
|
+
valid_keys = [i for i in keys if isinstance(i, uni.Expr) or i is None]
|
|
1158
|
+
valid_values = [i for i in values if isinstance(i, uni.Expr)]
|
|
1159
|
+
kvpair: list[uni.KVPair] = []
|
|
1211
1160
|
for i in range(len(values)):
|
|
1212
1161
|
key_pluck = valid_keys[i]
|
|
1213
|
-
kvp =
|
|
1162
|
+
kvp = uni.KVPair(
|
|
1214
1163
|
key=key_pluck,
|
|
1215
1164
|
value=valid_values[i],
|
|
1216
1165
|
kid=([key_pluck, valid_values[i]] if key_pluck else [valid_values[i]]),
|
|
1217
1166
|
)
|
|
1218
1167
|
kvpair.append(kvp)
|
|
1219
|
-
return
|
|
1168
|
+
return uni.DictVal(
|
|
1220
1169
|
kv_pairs=kvpair,
|
|
1221
1170
|
kid=(
|
|
1222
1171
|
[*kvpair]
|
|
@@ -1225,7 +1174,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1225
1174
|
),
|
|
1226
1175
|
)
|
|
1227
1176
|
|
|
1228
|
-
def proc_dict_comp(self, node: py_ast.DictComp) ->
|
|
1177
|
+
def proc_dict_comp(self, node: py_ast.DictComp) -> uni.DictCompr:
|
|
1229
1178
|
"""Process python node.
|
|
1230
1179
|
|
|
1231
1180
|
class DictComp(expr):
|
|
@@ -1235,21 +1184,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1235
1184
|
"""
|
|
1236
1185
|
key = self.convert(node.key)
|
|
1237
1186
|
value = self.convert(node.value)
|
|
1238
|
-
if isinstance(key,
|
|
1239
|
-
kv_pair =
|
|
1187
|
+
if isinstance(key, uni.Expr) and isinstance(value, uni.Expr):
|
|
1188
|
+
kv_pair = uni.KVPair(key=key, value=value, kid=[key, value])
|
|
1240
1189
|
else:
|
|
1241
1190
|
raise self.ice()
|
|
1242
1191
|
generators = [self.convert(i) for i in node.generators]
|
|
1243
|
-
valid = [i for i in generators if isinstance(i, (
|
|
1192
|
+
valid = [i for i in generators if isinstance(i, (uni.InnerCompr))]
|
|
1244
1193
|
if len(valid) != len(generators):
|
|
1245
1194
|
raise self.ice("Length mismatch in dict compr generators")
|
|
1246
|
-
compr =
|
|
1247
|
-
return
|
|
1195
|
+
compr = uni.SubNodeList[uni.InnerCompr](items=valid, delim=Tok.COMMA, kid=valid)
|
|
1196
|
+
return uni.DictCompr(kv_pair=kv_pair, compr=valid, kid=[kv_pair, compr])
|
|
1248
1197
|
|
|
1249
1198
|
def proc_ellipsis(self, node: py_ast.Ellipsis) -> None:
|
|
1250
1199
|
"""Process python node."""
|
|
1251
1200
|
|
|
1252
|
-
def proc_except_handler(self, node: py_ast.ExceptHandler) ->
|
|
1201
|
+
def proc_except_handler(self, node: py_ast.ExceptHandler) -> uni.Except:
|
|
1253
1202
|
"""Process python node.
|
|
1254
1203
|
|
|
1255
1204
|
class ExceptHandler(excepthandler):
|
|
@@ -1258,9 +1207,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1258
1207
|
body: list[stmt]
|
|
1259
1208
|
"""
|
|
1260
1209
|
type = self.convert(node.type) if node.type else None
|
|
1261
|
-
name:
|
|
1210
|
+
name: uni.Name | None = None
|
|
1262
1211
|
if not type and not node.name:
|
|
1263
|
-
type =
|
|
1212
|
+
type = uni.Name(
|
|
1264
1213
|
orig_src=self.orig_src,
|
|
1265
1214
|
name=Tok.NAME,
|
|
1266
1215
|
value="Exception",
|
|
@@ -1271,7 +1220,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1271
1220
|
pos_start=0,
|
|
1272
1221
|
pos_end=0,
|
|
1273
1222
|
)
|
|
1274
|
-
name =
|
|
1223
|
+
name = uni.Name(
|
|
1275
1224
|
orig_src=self.orig_src,
|
|
1276
1225
|
name=Tok.NAME,
|
|
1277
1226
|
value="e",
|
|
@@ -1283,7 +1232,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1283
1232
|
pos_end=0,
|
|
1284
1233
|
)
|
|
1285
1234
|
else:
|
|
1286
|
-
# type =
|
|
1235
|
+
# type = uni.Name(
|
|
1287
1236
|
# orig_src=self.orig_src,
|
|
1288
1237
|
# name=Tok.NAME,
|
|
1289
1238
|
# value=no,
|
|
@@ -1295,7 +1244,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1295
1244
|
# pos_end=0,
|
|
1296
1245
|
# )
|
|
1297
1246
|
name = (
|
|
1298
|
-
|
|
1247
|
+
uni.Name(
|
|
1299
1248
|
orig_src=self.orig_src,
|
|
1300
1249
|
name=Tok.NAME,
|
|
1301
1250
|
value=node.name,
|
|
@@ -1311,10 +1260,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1311
1260
|
)
|
|
1312
1261
|
|
|
1313
1262
|
body = [self.convert(i) for i in node.body]
|
|
1314
|
-
valid = [i for i in body if isinstance(i, (
|
|
1263
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
1315
1264
|
if len(valid) != len(body):
|
|
1316
1265
|
raise self.ice("Length mismatch in except handler body")
|
|
1317
|
-
valid_body =
|
|
1266
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
1318
1267
|
items=valid,
|
|
1319
1268
|
delim=Tok.WS,
|
|
1320
1269
|
kid=valid,
|
|
@@ -1322,8 +1271,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1322
1271
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
1323
1272
|
)
|
|
1324
1273
|
kid = [item for item in [type, name, valid_body] if item]
|
|
1325
|
-
if isinstance(type,
|
|
1326
|
-
return
|
|
1274
|
+
if isinstance(type, uni.Expr) and (isinstance(name, uni.Name) or not name):
|
|
1275
|
+
return uni.Except(
|
|
1327
1276
|
ex_type=type,
|
|
1328
1277
|
name=name,
|
|
1329
1278
|
body=valid_body,
|
|
@@ -1332,19 +1281,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1332
1281
|
else:
|
|
1333
1282
|
raise self.ice()
|
|
1334
1283
|
|
|
1335
|
-
def proc_expr(self, node: py_ast.Expr) ->
|
|
1284
|
+
def proc_expr(self, node: py_ast.Expr) -> uni.ExprStmt:
|
|
1336
1285
|
"""Process python node.
|
|
1337
1286
|
|
|
1338
1287
|
class Expr(stmt):
|
|
1339
1288
|
value: expr
|
|
1340
1289
|
"""
|
|
1341
1290
|
value = self.convert(node.value)
|
|
1342
|
-
if isinstance(value,
|
|
1343
|
-
return
|
|
1291
|
+
if isinstance(value, uni.Expr):
|
|
1292
|
+
return uni.ExprStmt(expr=value, in_fstring=False, kid=[value])
|
|
1344
1293
|
else:
|
|
1345
1294
|
raise self.ice()
|
|
1346
1295
|
|
|
1347
|
-
def proc_formatted_value(self, node: py_ast.FormattedValue) ->
|
|
1296
|
+
def proc_formatted_value(self, node: py_ast.FormattedValue) -> uni.ExprStmt:
|
|
1348
1297
|
"""Process python node.
|
|
1349
1298
|
|
|
1350
1299
|
class FormattedValue(expr):
|
|
@@ -1355,8 +1304,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1355
1304
|
format_spec: expr | None
|
|
1356
1305
|
"""
|
|
1357
1306
|
value = self.convert(node.value)
|
|
1358
|
-
if isinstance(value,
|
|
1359
|
-
ret =
|
|
1307
|
+
if isinstance(value, uni.Expr):
|
|
1308
|
+
ret = uni.ExprStmt(
|
|
1360
1309
|
expr=value,
|
|
1361
1310
|
in_fstring=True,
|
|
1362
1311
|
kid=[value],
|
|
@@ -1368,7 +1317,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1368
1317
|
def proc_function_type(self, node: py_ast.FunctionType) -> None:
|
|
1369
1318
|
"""Process python node."""
|
|
1370
1319
|
|
|
1371
|
-
def proc_generator_exp(self, node: py_ast.GeneratorExp) ->
|
|
1320
|
+
def proc_generator_exp(self, node: py_ast.GeneratorExp) -> uni.GenCompr:
|
|
1372
1321
|
"""Process python node..
|
|
1373
1322
|
|
|
1374
1323
|
class SetComp(expr):
|
|
@@ -1377,25 +1326,25 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1377
1326
|
"""
|
|
1378
1327
|
elt = self.convert(node.elt)
|
|
1379
1328
|
generators = [self.convert(gen) for gen in node.generators]
|
|
1380
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1329
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
1381
1330
|
if len(generators) != len(valid):
|
|
1382
1331
|
raise self.ice("Length mismatch in list comp generators")
|
|
1383
|
-
compr =
|
|
1384
|
-
if isinstance(elt,
|
|
1385
|
-
return
|
|
1332
|
+
compr = uni.SubNodeList[uni.InnerCompr](items=valid, delim=Tok.COMMA, kid=valid)
|
|
1333
|
+
if isinstance(elt, uni.Expr):
|
|
1334
|
+
return uni.GenCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
1386
1335
|
else:
|
|
1387
1336
|
raise self.ice()
|
|
1388
1337
|
|
|
1389
|
-
def proc_global(self, node: py_ast.Global) ->
|
|
1338
|
+
def proc_global(self, node: py_ast.Global) -> uni.GlobalStmt:
|
|
1390
1339
|
"""Process python node.
|
|
1391
1340
|
|
|
1392
1341
|
class Global(stmt):
|
|
1393
1342
|
names: list[_Identifier]
|
|
1394
1343
|
"""
|
|
1395
|
-
names: list[
|
|
1344
|
+
names: list[uni.NameAtom] = []
|
|
1396
1345
|
for id in node.names:
|
|
1397
1346
|
names.append(
|
|
1398
|
-
|
|
1347
|
+
uni.Name(
|
|
1399
1348
|
orig_src=self.orig_src,
|
|
1400
1349
|
name=Tok.NAME,
|
|
1401
1350
|
value=id,
|
|
@@ -1407,10 +1356,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1407
1356
|
pos_end=0,
|
|
1408
1357
|
)
|
|
1409
1358
|
)
|
|
1410
|
-
target =
|
|
1411
|
-
return
|
|
1359
|
+
target = uni.SubNodeList[uni.NameAtom](items=names, delim=Tok.COMMA, kid=names)
|
|
1360
|
+
return uni.GlobalStmt(target=target, kid=[target])
|
|
1412
1361
|
|
|
1413
|
-
def proc_if_exp(self, node: py_ast.IfExp) ->
|
|
1362
|
+
def proc_if_exp(self, node: py_ast.IfExp) -> uni.IfElseExpr:
|
|
1414
1363
|
"""Process python node.
|
|
1415
1364
|
|
|
1416
1365
|
class IfExp(expr):
|
|
@@ -1422,34 +1371,36 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1422
1371
|
body = self.convert(node.body)
|
|
1423
1372
|
orelse = self.convert(node.orelse)
|
|
1424
1373
|
if (
|
|
1425
|
-
isinstance(test,
|
|
1426
|
-
and isinstance(body,
|
|
1427
|
-
and isinstance(orelse,
|
|
1374
|
+
isinstance(test, uni.Expr)
|
|
1375
|
+
and isinstance(body, uni.Expr)
|
|
1376
|
+
and isinstance(orelse, uni.Expr)
|
|
1428
1377
|
):
|
|
1429
|
-
return
|
|
1378
|
+
return uni.IfElseExpr(
|
|
1430
1379
|
value=body, condition=test, else_value=orelse, kid=[body, test, orelse]
|
|
1431
1380
|
)
|
|
1432
1381
|
else:
|
|
1433
1382
|
raise self.ice()
|
|
1434
1383
|
|
|
1435
|
-
def proc_import(self, node: py_ast.Import) ->
|
|
1384
|
+
def proc_import(self, node: py_ast.Import) -> uni.Import:
|
|
1436
1385
|
"""Process python node.
|
|
1437
1386
|
|
|
1438
1387
|
class Import(stmt):
|
|
1439
1388
|
names: list[alias]
|
|
1440
1389
|
"""
|
|
1441
1390
|
names = [self.convert(name) for name in node.names]
|
|
1442
|
-
valid_names = [name for name in names if isinstance(name,
|
|
1391
|
+
valid_names = [name for name in names if isinstance(name, uni.ExprAsItem)]
|
|
1443
1392
|
if len(valid_names) != len(names):
|
|
1444
|
-
self.
|
|
1393
|
+
self.log_error("Length mismatch in import names")
|
|
1445
1394
|
paths = []
|
|
1446
1395
|
for name in valid_names:
|
|
1447
|
-
if isinstance(name.expr,
|
|
1448
|
-
isinstance(name.alias,
|
|
1396
|
+
if isinstance(name.expr, uni.Name) and (
|
|
1397
|
+
isinstance(name.alias, uni.Name) or name.alias is None
|
|
1449
1398
|
):
|
|
1450
1399
|
paths.append(
|
|
1451
|
-
|
|
1452
|
-
path=[
|
|
1400
|
+
uni.ModulePath(
|
|
1401
|
+
path=uni.SubNodeList[uni.Name](
|
|
1402
|
+
items=[name.expr], delim=Tok.DOT, kid=[name.expr]
|
|
1403
|
+
),
|
|
1453
1404
|
level=0,
|
|
1454
1405
|
alias=name.alias,
|
|
1455
1406
|
kid=[i for i in name.kid if i],
|
|
@@ -1458,29 +1409,16 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1458
1409
|
# Need to unravel atom trailers
|
|
1459
1410
|
else:
|
|
1460
1411
|
raise self.ice()
|
|
1461
|
-
|
|
1462
|
-
|
|
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,
|
|
1412
|
+
items = uni.SubNodeList[uni.ModulePath](items=paths, delim=Tok.COMMA, kid=paths)
|
|
1413
|
+
ret = uni.Import(
|
|
1476
1414
|
from_loc=None,
|
|
1477
1415
|
items=items,
|
|
1478
1416
|
is_absorb=False,
|
|
1479
|
-
kid=[
|
|
1417
|
+
kid=[items],
|
|
1480
1418
|
)
|
|
1481
1419
|
return ret
|
|
1482
1420
|
|
|
1483
|
-
def proc_import_from(self, node: py_ast.ImportFrom) ->
|
|
1421
|
+
def proc_import_from(self, node: py_ast.ImportFrom) -> uni.Import:
|
|
1484
1422
|
"""Process python node.
|
|
1485
1423
|
|
|
1486
1424
|
class ImportFrom(stmt):
|
|
@@ -1488,7 +1426,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1488
1426
|
names: list[alias]
|
|
1489
1427
|
level: int
|
|
1490
1428
|
"""
|
|
1491
|
-
lang =
|
|
1429
|
+
lang = uni.Name(
|
|
1492
1430
|
orig_src=self.orig_src,
|
|
1493
1431
|
name=Tok.NAME,
|
|
1494
1432
|
value="py",
|
|
@@ -1499,11 +1437,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1499
1437
|
pos_start=0,
|
|
1500
1438
|
pos_end=0,
|
|
1501
1439
|
)
|
|
1502
|
-
modpaths: list[
|
|
1440
|
+
modpaths: list[uni.Name] = []
|
|
1503
1441
|
if node.module:
|
|
1504
1442
|
for i in node.module.split("."):
|
|
1505
1443
|
modpaths.append(
|
|
1506
|
-
|
|
1444
|
+
uni.Name(
|
|
1507
1445
|
orig_src=self.orig_src,
|
|
1508
1446
|
name=Tok.NAME,
|
|
1509
1447
|
value=i,
|
|
@@ -1517,22 +1455,27 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1517
1455
|
)
|
|
1518
1456
|
moddots = [self.operator(Tok.DOT, ".") for _ in range(node.level)]
|
|
1519
1457
|
modparts = moddots + modpaths
|
|
1520
|
-
path =
|
|
1521
|
-
path=
|
|
1458
|
+
path = uni.ModulePath(
|
|
1459
|
+
path=(
|
|
1460
|
+
uni.SubNodeList[uni.Name](items=modpaths, delim=Tok.DOT, kid=modpaths)
|
|
1461
|
+
if modpaths
|
|
1462
|
+
else None
|
|
1463
|
+
),
|
|
1522
1464
|
level=node.level,
|
|
1523
1465
|
alias=None,
|
|
1524
1466
|
kid=modparts,
|
|
1525
1467
|
)
|
|
1468
|
+
|
|
1526
1469
|
names = [self.convert(name) for name in node.names]
|
|
1527
1470
|
valid_names = []
|
|
1528
1471
|
for name in names:
|
|
1529
1472
|
if (
|
|
1530
|
-
isinstance(name,
|
|
1531
|
-
and isinstance(name.expr,
|
|
1532
|
-
and (isinstance(name.alias,
|
|
1473
|
+
isinstance(name, uni.ExprAsItem)
|
|
1474
|
+
and isinstance(name.expr, uni.Name)
|
|
1475
|
+
and (isinstance(name.alias, uni.Name) or name.alias is None)
|
|
1533
1476
|
):
|
|
1534
1477
|
valid_names.append(
|
|
1535
|
-
|
|
1478
|
+
uni.ModuleItem(
|
|
1536
1479
|
name=name.expr,
|
|
1537
1480
|
alias=name.alias if name.alias else None,
|
|
1538
1481
|
kid=[i for i in name.kid if i],
|
|
@@ -1541,7 +1484,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1541
1484
|
else:
|
|
1542
1485
|
raise self.ice()
|
|
1543
1486
|
items = (
|
|
1544
|
-
|
|
1487
|
+
uni.SubNodeList[uni.ModuleItem](
|
|
1545
1488
|
items=valid_names, delim=Tok.COMMA, kid=valid_names
|
|
1546
1489
|
)
|
|
1547
1490
|
if valid_names
|
|
@@ -1549,21 +1492,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1549
1492
|
)
|
|
1550
1493
|
if not items:
|
|
1551
1494
|
raise self.ice("No valid names in import from")
|
|
1552
|
-
pytag =
|
|
1495
|
+
pytag = uni.SubTag[uni.Name](tag=lang, kid=[lang])
|
|
1553
1496
|
if len(node.names) == 1 and node.names[0].name == "*":
|
|
1554
|
-
path_in =
|
|
1497
|
+
path_in = uni.SubNodeList[uni.ModulePath](
|
|
1555
1498
|
items=[path], delim=Tok.COMMA, kid=[path]
|
|
1556
1499
|
)
|
|
1557
|
-
ret =
|
|
1558
|
-
hint=pytag,
|
|
1500
|
+
ret = uni.Import(
|
|
1559
1501
|
from_loc=None,
|
|
1560
1502
|
items=path_in,
|
|
1561
1503
|
is_absorb=True,
|
|
1562
1504
|
kid=[pytag, path_in],
|
|
1563
1505
|
)
|
|
1564
1506
|
return ret
|
|
1565
|
-
ret =
|
|
1566
|
-
hint=pytag,
|
|
1507
|
+
ret = uni.Import(
|
|
1567
1508
|
from_loc=path,
|
|
1568
1509
|
items=items,
|
|
1569
1510
|
is_absorb=False,
|
|
@@ -1571,7 +1512,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1571
1512
|
)
|
|
1572
1513
|
return ret
|
|
1573
1514
|
|
|
1574
|
-
def proc_joined_str(self, node: py_ast.JoinedStr) ->
|
|
1515
|
+
def proc_joined_str(self, node: py_ast.JoinedStr) -> uni.FString:
|
|
1575
1516
|
"""Process python node.
|
|
1576
1517
|
|
|
1577
1518
|
class JoinedStr(expr):
|
|
@@ -1581,14 +1522,14 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1581
1522
|
"""
|
|
1582
1523
|
values = [self.convert(value) for value in node.values]
|
|
1583
1524
|
valid = [
|
|
1584
|
-
value for value in values if isinstance(value, (
|
|
1525
|
+
value for value in values if isinstance(value, (uni.String, uni.ExprStmt))
|
|
1585
1526
|
]
|
|
1586
|
-
valid_values =
|
|
1527
|
+
valid_values = uni.SubNodeList[uni.String | uni.ExprStmt](
|
|
1587
1528
|
items=valid, delim=None, kid=valid
|
|
1588
1529
|
)
|
|
1589
|
-
return
|
|
1530
|
+
return uni.FString(parts=valid_values, kid=[valid_values])
|
|
1590
1531
|
|
|
1591
|
-
def proc_lambda(self, node: py_ast.Lambda) ->
|
|
1532
|
+
def proc_lambda(self, node: py_ast.Lambda) -> uni.LambdaExpr:
|
|
1592
1533
|
"""Process python node.
|
|
1593
1534
|
|
|
1594
1535
|
class Lambda(expr):
|
|
@@ -1597,12 +1538,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1597
1538
|
"""
|
|
1598
1539
|
args = self.convert(node.args)
|
|
1599
1540
|
body = self.convert(node.body)
|
|
1600
|
-
if isinstance(args,
|
|
1601
|
-
return
|
|
1541
|
+
if isinstance(args, uni.FuncSignature) and isinstance(body, uni.Expr):
|
|
1542
|
+
return uni.LambdaExpr(signature=args, body=body, kid=[args, body])
|
|
1602
1543
|
else:
|
|
1603
1544
|
raise self.ice()
|
|
1604
1545
|
|
|
1605
|
-
def proc_list(self, node: py_ast.List) ->
|
|
1546
|
+
def proc_list(self, node: py_ast.List) -> uni.ListVal:
|
|
1606
1547
|
"""Process python node.
|
|
1607
1548
|
|
|
1608
1549
|
class List(expr):
|
|
@@ -1610,14 +1551,14 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1610
1551
|
ctx: expr_context
|
|
1611
1552
|
"""
|
|
1612
1553
|
elts = [self.convert(elt) for elt in node.elts]
|
|
1613
|
-
valid_elts = [elt for elt in elts if isinstance(elt,
|
|
1554
|
+
valid_elts = [elt for elt in elts if isinstance(elt, uni.Expr)]
|
|
1614
1555
|
if len(valid_elts) != len(elts):
|
|
1615
1556
|
raise self.ice("Length mismatch in list elements")
|
|
1616
1557
|
l_square = self.operator(Tok.LSQUARE, "[")
|
|
1617
1558
|
r_square = self.operator(Tok.RSQUARE, "]")
|
|
1618
|
-
return
|
|
1559
|
+
return uni.ListVal(
|
|
1619
1560
|
values=(
|
|
1620
|
-
|
|
1561
|
+
uni.SubNodeList[uni.Expr](
|
|
1621
1562
|
items=valid_elts, delim=Tok.COMMA, kid=valid_elts
|
|
1622
1563
|
)
|
|
1623
1564
|
if valid_elts
|
|
@@ -1626,7 +1567,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1626
1567
|
kid=[*valid_elts] if valid_elts else [l_square, r_square],
|
|
1627
1568
|
)
|
|
1628
1569
|
|
|
1629
|
-
def proc_list_comp(self, node: py_ast.ListComp) ->
|
|
1570
|
+
def proc_list_comp(self, node: py_ast.ListComp) -> uni.ListCompr:
|
|
1630
1571
|
"""Process python node.
|
|
1631
1572
|
|
|
1632
1573
|
class ListComp(expr):
|
|
@@ -1635,16 +1576,16 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1635
1576
|
"""
|
|
1636
1577
|
elt = self.convert(node.elt)
|
|
1637
1578
|
generators = [self.convert(gen) for gen in node.generators]
|
|
1638
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1579
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
1639
1580
|
if len(generators) != len(valid):
|
|
1640
1581
|
raise self.ice("Length mismatch in list comp generators")
|
|
1641
|
-
compr =
|
|
1642
|
-
if isinstance(elt,
|
|
1643
|
-
return
|
|
1582
|
+
compr = uni.SubNodeList[uni.InnerCompr](items=valid, delim=Tok.COMMA, kid=valid)
|
|
1583
|
+
if isinstance(elt, uni.Expr):
|
|
1584
|
+
return uni.ListCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
1644
1585
|
else:
|
|
1645
1586
|
raise self.ice()
|
|
1646
1587
|
|
|
1647
|
-
def proc_match(self, node: py_ast.Match) ->
|
|
1588
|
+
def proc_match(self, node: py_ast.Match) -> uni.MatchStmt:
|
|
1648
1589
|
"""Process python node.
|
|
1649
1590
|
|
|
1650
1591
|
class Match(stmt):
|
|
@@ -1653,13 +1594,13 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1653
1594
|
"""
|
|
1654
1595
|
subject = self.convert(node.subject)
|
|
1655
1596
|
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
|
|
1597
|
+
valid = [case for case in cases if isinstance(case, uni.MatchCase)]
|
|
1598
|
+
if isinstance(subject, uni.Expr):
|
|
1599
|
+
return uni.MatchStmt(target=subject, cases=valid, kid=[subject, *valid])
|
|
1659
1600
|
else:
|
|
1660
1601
|
raise self.ice()
|
|
1661
1602
|
|
|
1662
|
-
def proc_match_as(self, node: py_ast.MatchAs) ->
|
|
1603
|
+
def proc_match_as(self, node: py_ast.MatchAs) -> uni.MatchAs | uni.MatchWild:
|
|
1663
1604
|
"""Process python node.
|
|
1664
1605
|
|
|
1665
1606
|
class MatchAs(pattern):
|
|
@@ -1667,7 +1608,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1667
1608
|
name: _Identifier | None
|
|
1668
1609
|
"""
|
|
1669
1610
|
pattern = self.convert(node.pattern) if node.pattern else None
|
|
1670
|
-
name =
|
|
1611
|
+
name = uni.Name(
|
|
1671
1612
|
orig_src=self.orig_src,
|
|
1672
1613
|
name=Tok.NAME,
|
|
1673
1614
|
value=node.name if node.name else "_",
|
|
@@ -1683,16 +1624,20 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1683
1624
|
pos_end=0,
|
|
1684
1625
|
)
|
|
1685
1626
|
|
|
1686
|
-
if
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
)
|
|
1692
|
-
|
|
1693
|
-
|
|
1627
|
+
if (
|
|
1628
|
+
name.value == "_"
|
|
1629
|
+
or pattern is not None
|
|
1630
|
+
and not isinstance(pattern, uni.MatchPattern)
|
|
1631
|
+
):
|
|
1632
|
+
return uni.MatchWild(kid=[name])
|
|
1633
|
+
|
|
1634
|
+
return uni.MatchAs(
|
|
1635
|
+
name=name,
|
|
1636
|
+
pattern=pattern,
|
|
1637
|
+
kid=[name] if pattern is None else [name, pattern],
|
|
1638
|
+
)
|
|
1694
1639
|
|
|
1695
|
-
def proc_match_class(self, node: py_ast.MatchClass) ->
|
|
1640
|
+
def proc_match_class(self, node: py_ast.MatchClass) -> uni.MatchArch:
|
|
1696
1641
|
"""Process python node.
|
|
1697
1642
|
|
|
1698
1643
|
class MatchClass(pattern):
|
|
@@ -1705,9 +1650,9 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1705
1650
|
kid = [cls]
|
|
1706
1651
|
if len(node.patterns) != 0:
|
|
1707
1652
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1708
|
-
valid_patterns = [i for i in patterns if isinstance(i,
|
|
1653
|
+
valid_patterns = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1709
1654
|
if len(patterns) == len(valid_patterns):
|
|
1710
|
-
patterns_sub =
|
|
1655
|
+
patterns_sub = uni.SubNodeList[uni.MatchPattern](
|
|
1711
1656
|
items=valid_patterns, delim=Tok.COMMA, kid=valid_patterns
|
|
1712
1657
|
)
|
|
1713
1658
|
kid.append(patterns_sub)
|
|
@@ -1717,11 +1662,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1717
1662
|
patterns_sub = None
|
|
1718
1663
|
|
|
1719
1664
|
if len(node.kwd_patterns):
|
|
1720
|
-
names: list[
|
|
1721
|
-
kv_pairs: list[
|
|
1665
|
+
names: list[uni.Name] = []
|
|
1666
|
+
kv_pairs: list[uni.MatchKVPair] = []
|
|
1722
1667
|
for kwd_attrs in node.kwd_attrs:
|
|
1723
1668
|
names.append(
|
|
1724
|
-
|
|
1669
|
+
uni.Name(
|
|
1725
1670
|
orig_src=self.orig_src,
|
|
1726
1671
|
name=Tok.NAME,
|
|
1727
1672
|
value=kwd_attrs,
|
|
@@ -1735,30 +1680,30 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1735
1680
|
)
|
|
1736
1681
|
kwd_patterns = [self.convert(i) for i in node.kwd_patterns]
|
|
1737
1682
|
valid_kwd_patterns = [
|
|
1738
|
-
i for i in kwd_patterns if isinstance(i,
|
|
1683
|
+
i for i in kwd_patterns if isinstance(i, uni.MatchPattern)
|
|
1739
1684
|
]
|
|
1740
1685
|
for i in range(len(kwd_patterns)):
|
|
1741
1686
|
kv_pairs.append(
|
|
1742
|
-
|
|
1687
|
+
uni.MatchKVPair(
|
|
1743
1688
|
key=names[i],
|
|
1744
1689
|
value=valid_kwd_patterns[i],
|
|
1745
1690
|
kid=[names[i], valid_kwd_patterns[i]],
|
|
1746
1691
|
)
|
|
1747
1692
|
)
|
|
1748
|
-
kw_patterns =
|
|
1693
|
+
kw_patterns = uni.SubNodeList[uni.MatchKVPair](
|
|
1749
1694
|
items=kv_pairs, delim=Tok.COMMA, kid=kv_pairs
|
|
1750
1695
|
)
|
|
1751
1696
|
kid.append(kw_patterns)
|
|
1752
1697
|
else:
|
|
1753
1698
|
kw_patterns = None
|
|
1754
|
-
if isinstance(cls, (
|
|
1755
|
-
return
|
|
1699
|
+
if isinstance(cls, (uni.NameAtom, uni.AtomTrailer)):
|
|
1700
|
+
return uni.MatchArch(
|
|
1756
1701
|
name=cls, arg_patterns=patterns_sub, kw_patterns=kw_patterns, kid=kid
|
|
1757
1702
|
)
|
|
1758
1703
|
else:
|
|
1759
1704
|
raise self.ice()
|
|
1760
1705
|
|
|
1761
|
-
def proc_match_mapping(self, node: py_ast.MatchMapping) ->
|
|
1706
|
+
def proc_match_mapping(self, node: py_ast.MatchMapping) -> uni.MatchMapping:
|
|
1762
1707
|
"""Process python node.
|
|
1763
1708
|
|
|
1764
1709
|
class MatchMapping(pattern):
|
|
@@ -1766,22 +1711,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1766
1711
|
patterns: list[pattern]
|
|
1767
1712
|
rest: _Identifier | None
|
|
1768
1713
|
"""
|
|
1769
|
-
values: list[
|
|
1714
|
+
values: list[uni.MatchKVPair | uni.MatchStar] = []
|
|
1770
1715
|
keys = [self.convert(i) for i in node.keys]
|
|
1771
1716
|
valid_keys = [
|
|
1772
|
-
i
|
|
1717
|
+
i
|
|
1718
|
+
for i in keys
|
|
1719
|
+
if isinstance(i, (uni.MatchPattern, uni.NameAtom, uni.AtomExpr))
|
|
1773
1720
|
]
|
|
1774
1721
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1775
|
-
valid_patterns = [i for i in patterns if isinstance(i,
|
|
1722
|
+
valid_patterns = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1776
1723
|
for i in range(len(valid_keys)):
|
|
1777
|
-
kv_pair =
|
|
1724
|
+
kv_pair = uni.MatchKVPair(
|
|
1778
1725
|
key=valid_keys[i],
|
|
1779
1726
|
value=valid_patterns[i],
|
|
1780
1727
|
kid=[valid_keys[i], valid_patterns[i]],
|
|
1781
1728
|
)
|
|
1782
1729
|
values.append(kv_pair)
|
|
1783
1730
|
if node.rest:
|
|
1784
|
-
name =
|
|
1731
|
+
name = uni.Name(
|
|
1785
1732
|
orig_src=self.orig_src,
|
|
1786
1733
|
name=Tok.NAME,
|
|
1787
1734
|
value=node.rest,
|
|
@@ -1792,40 +1739,40 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1792
1739
|
pos_start=0,
|
|
1793
1740
|
pos_end=0,
|
|
1794
1741
|
)
|
|
1795
|
-
values.append(
|
|
1796
|
-
return
|
|
1742
|
+
values.append(uni.MatchStar(name=name, is_list=False, kid=[name]))
|
|
1743
|
+
return uni.MatchMapping(values=values, kid=values)
|
|
1797
1744
|
|
|
1798
|
-
def proc_match_or(self, node: py_ast.MatchOr) ->
|
|
1745
|
+
def proc_match_or(self, node: py_ast.MatchOr) -> uni.MatchOr:
|
|
1799
1746
|
"""Process python node.
|
|
1800
1747
|
|
|
1801
1748
|
class MatchOr(pattern):
|
|
1802
1749
|
patterns: list[pattern]
|
|
1803
1750
|
"""
|
|
1804
1751
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1805
|
-
valid = [i for i in patterns if isinstance(i,
|
|
1806
|
-
return
|
|
1752
|
+
valid = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1753
|
+
return uni.MatchOr(patterns=valid, kid=valid)
|
|
1807
1754
|
|
|
1808
|
-
def proc_match_sequence(self, node: py_ast.MatchSequence) ->
|
|
1755
|
+
def proc_match_sequence(self, node: py_ast.MatchSequence) -> uni.MatchSequence:
|
|
1809
1756
|
"""Process python node.
|
|
1810
1757
|
|
|
1811
1758
|
class MatchSequence(pattern):
|
|
1812
1759
|
patterns: list[pattern]
|
|
1813
1760
|
"""
|
|
1814
1761
|
patterns = [self.convert(i) for i in node.patterns]
|
|
1815
|
-
valid = [i for i in patterns if isinstance(i,
|
|
1762
|
+
valid = [i for i in patterns if isinstance(i, uni.MatchPattern)]
|
|
1816
1763
|
if len(patterns) == len(valid):
|
|
1817
|
-
return
|
|
1764
|
+
return uni.MatchSequence(values=valid, kid=valid)
|
|
1818
1765
|
else:
|
|
1819
1766
|
raise self.ice()
|
|
1820
1767
|
|
|
1821
|
-
def proc_match_singleton(self, node: py_ast.MatchSingleton) ->
|
|
1768
|
+
def proc_match_singleton(self, node: py_ast.MatchSingleton) -> uni.MatchSingleton:
|
|
1822
1769
|
"""Process python node.
|
|
1823
1770
|
|
|
1824
1771
|
class MatchSingleton(pattern):
|
|
1825
1772
|
value: Literal[True, False] | None
|
|
1826
1773
|
"""
|
|
1827
1774
|
type = Tok.NULL if node.value is None else Tok.BOOL
|
|
1828
|
-
ret_type =
|
|
1775
|
+
ret_type = uni.Null if node.value is None else uni.Bool
|
|
1829
1776
|
value = ret_type(
|
|
1830
1777
|
orig_src=self.orig_src,
|
|
1831
1778
|
name=type,
|
|
@@ -1837,18 +1784,18 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1837
1784
|
pos_start=0,
|
|
1838
1785
|
pos_end=0,
|
|
1839
1786
|
)
|
|
1840
|
-
if isinstance(value, (
|
|
1841
|
-
return
|
|
1787
|
+
if isinstance(value, (uni.Bool, uni.Null)):
|
|
1788
|
+
return uni.MatchSingleton(value=value, kid=[value])
|
|
1842
1789
|
else:
|
|
1843
1790
|
raise self.ice()
|
|
1844
1791
|
|
|
1845
|
-
def proc_match_star(self, node: py_ast.MatchStar) ->
|
|
1792
|
+
def proc_match_star(self, node: py_ast.MatchStar) -> uni.MatchStar:
|
|
1846
1793
|
"""Process python node.
|
|
1847
1794
|
|
|
1848
1795
|
class MatchStar(pattern):
|
|
1849
1796
|
name: _Identifier | None
|
|
1850
1797
|
"""
|
|
1851
|
-
name =
|
|
1798
|
+
name = uni.Name(
|
|
1852
1799
|
orig_src=self.orig_src,
|
|
1853
1800
|
name=Tok.NAME,
|
|
1854
1801
|
value=node.name if node.name else "_",
|
|
@@ -1859,21 +1806,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1859
1806
|
pos_start=0,
|
|
1860
1807
|
pos_end=0,
|
|
1861
1808
|
)
|
|
1862
|
-
return
|
|
1809
|
+
return uni.MatchStar(name=name, is_list=True, kid=[name])
|
|
1863
1810
|
|
|
1864
|
-
def proc_match_value(self, node: py_ast.MatchValue) ->
|
|
1811
|
+
def proc_match_value(self, node: py_ast.MatchValue) -> uni.MatchValue:
|
|
1865
1812
|
"""Process python node.
|
|
1866
1813
|
|
|
1867
1814
|
class MatchValue(pattern):
|
|
1868
1815
|
value: expr
|
|
1869
1816
|
"""
|
|
1870
1817
|
value = self.convert(node.value)
|
|
1871
|
-
if isinstance(value,
|
|
1872
|
-
return
|
|
1818
|
+
if isinstance(value, uni.Expr):
|
|
1819
|
+
return uni.MatchValue(value=value, kid=[value])
|
|
1873
1820
|
else:
|
|
1874
1821
|
raise self.ice()
|
|
1875
1822
|
|
|
1876
|
-
def proc_name(self, node: py_ast.Name) ->
|
|
1823
|
+
def proc_name(self, node: py_ast.Name) -> uni.Name:
|
|
1877
1824
|
"""Process python node.
|
|
1878
1825
|
|
|
1879
1826
|
class Name(expr):
|
|
@@ -1891,7 +1838,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1891
1838
|
]
|
|
1892
1839
|
|
|
1893
1840
|
value = node.id if node.id not in reserved_keywords else f"<>{node.id}"
|
|
1894
|
-
ret =
|
|
1841
|
+
ret = uni.Name(
|
|
1895
1842
|
orig_src=self.orig_src,
|
|
1896
1843
|
name=Tok.NAME,
|
|
1897
1844
|
value=value,
|
|
@@ -1904,7 +1851,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1904
1851
|
)
|
|
1905
1852
|
return ret
|
|
1906
1853
|
|
|
1907
|
-
def proc_named_expr(self, node: py_ast.NamedExpr) ->
|
|
1854
|
+
def proc_named_expr(self, node: py_ast.NamedExpr) -> uni.AtomUnit:
|
|
1908
1855
|
"""Process python node.
|
|
1909
1856
|
|
|
1910
1857
|
class NamedExpr(expr):
|
|
@@ -1913,17 +1860,26 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1913
1860
|
"""
|
|
1914
1861
|
target = self.convert(node.target)
|
|
1915
1862
|
value = self.convert(node.value)
|
|
1916
|
-
if isinstance(value,
|
|
1917
|
-
|
|
1863
|
+
if isinstance(value, uni.Expr) and isinstance(target, uni.Name):
|
|
1864
|
+
op = self.operator(Tok.WALRUS_EQ, ":=")
|
|
1865
|
+
expr = uni.BinaryExpr(
|
|
1918
1866
|
left=target,
|
|
1919
|
-
op=
|
|
1867
|
+
op=op,
|
|
1920
1868
|
right=value,
|
|
1921
|
-
kid=[target, value],
|
|
1869
|
+
kid=[target, op, value],
|
|
1870
|
+
)
|
|
1871
|
+
return uni.AtomUnit(
|
|
1872
|
+
value=expr,
|
|
1873
|
+
kid=[
|
|
1874
|
+
self.operator(Tok.RPAREN, "("),
|
|
1875
|
+
expr,
|
|
1876
|
+
self.operator(Tok.LPAREN, ")"),
|
|
1877
|
+
],
|
|
1922
1878
|
)
|
|
1923
1879
|
else:
|
|
1924
1880
|
raise self.ice()
|
|
1925
1881
|
|
|
1926
|
-
def proc_nonlocal(self, node: py_ast.Nonlocal) ->
|
|
1882
|
+
def proc_nonlocal(self, node: py_ast.Nonlocal) -> uni.NonLocalStmt:
|
|
1927
1883
|
"""Process python node.
|
|
1928
1884
|
|
|
1929
1885
|
class Nonlocal(stmt):
|
|
@@ -1933,11 +1889,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1933
1889
|
|
|
1934
1890
|
reserved_keywords = [v for _, v in TOKEN_MAP.items()]
|
|
1935
1891
|
|
|
1936
|
-
names: list[
|
|
1892
|
+
names: list[uni.NameAtom] = []
|
|
1937
1893
|
for name in node.names:
|
|
1938
1894
|
value = name if name not in reserved_keywords else f"<>{name}"
|
|
1939
1895
|
names.append(
|
|
1940
|
-
|
|
1896
|
+
uni.Name(
|
|
1941
1897
|
orig_src=self.orig_src,
|
|
1942
1898
|
name=Tok.NAME,
|
|
1943
1899
|
value=value,
|
|
@@ -1949,12 +1905,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1949
1905
|
pos_end=0,
|
|
1950
1906
|
)
|
|
1951
1907
|
)
|
|
1952
|
-
target =
|
|
1953
|
-
return
|
|
1908
|
+
target = uni.SubNodeList[uni.NameAtom](items=names, delim=Tok.COMMA, kid=names)
|
|
1909
|
+
return uni.NonLocalStmt(target=target, kid=names)
|
|
1954
1910
|
|
|
1955
|
-
def proc_pass(self, node: py_ast.Pass) ->
|
|
1911
|
+
def proc_pass(self, node: py_ast.Pass) -> uni.Semi:
|
|
1956
1912
|
"""Process python node."""
|
|
1957
|
-
return
|
|
1913
|
+
return uni.Semi(
|
|
1958
1914
|
orig_src=self.orig_src,
|
|
1959
1915
|
name=Tok.SEMI,
|
|
1960
1916
|
value=";",
|
|
@@ -1966,7 +1922,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1966
1922
|
pos_end=0,
|
|
1967
1923
|
)
|
|
1968
1924
|
|
|
1969
|
-
def proc_set(self, node: py_ast.Set) ->
|
|
1925
|
+
def proc_set(self, node: py_ast.Set) -> uni.SetVal:
|
|
1970
1926
|
"""Process python node.
|
|
1971
1927
|
|
|
1972
1928
|
class Set(expr):
|
|
@@ -1974,21 +1930,21 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1974
1930
|
"""
|
|
1975
1931
|
if len(node.elts) != 0:
|
|
1976
1932
|
elts = [self.convert(i) for i in node.elts]
|
|
1977
|
-
valid = [i for i in elts if isinstance(i, (
|
|
1933
|
+
valid = [i for i in elts if isinstance(i, (uni.Expr))]
|
|
1978
1934
|
if len(valid) != len(elts):
|
|
1979
1935
|
raise self.ice("Length mismatch in set body")
|
|
1980
|
-
valid_elts =
|
|
1936
|
+
valid_elts = uni.SubNodeList[uni.Expr](
|
|
1981
1937
|
items=valid, delim=Tok.COMMA, kid=valid
|
|
1982
1938
|
)
|
|
1983
|
-
kid: list[
|
|
1939
|
+
kid: list[uni.UniNode] = [*valid]
|
|
1984
1940
|
else:
|
|
1985
1941
|
valid_elts = None
|
|
1986
1942
|
l_brace = self.operator(Tok.LBRACE, "{")
|
|
1987
1943
|
r_brace = self.operator(Tok.RBRACE, "}")
|
|
1988
1944
|
kid = [l_brace, r_brace]
|
|
1989
|
-
return
|
|
1945
|
+
return uni.SetVal(values=valid_elts, kid=kid)
|
|
1990
1946
|
|
|
1991
|
-
def proc_set_comp(self, node: py_ast.SetComp) ->
|
|
1947
|
+
def proc_set_comp(self, node: py_ast.SetComp) -> uni.ListCompr:
|
|
1992
1948
|
"""Process python node.
|
|
1993
1949
|
|
|
1994
1950
|
class SetComp(expr):
|
|
@@ -1997,16 +1953,16 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
1997
1953
|
"""
|
|
1998
1954
|
elt = self.convert(node.elt)
|
|
1999
1955
|
generators = [self.convert(gen) for gen in node.generators]
|
|
2000
|
-
valid = [gen for gen in generators if isinstance(gen,
|
|
1956
|
+
valid = [gen for gen in generators if isinstance(gen, uni.InnerCompr)]
|
|
2001
1957
|
if len(generators) != len(valid):
|
|
2002
1958
|
raise self.ice("Length mismatch in list comp generators")
|
|
2003
|
-
compr =
|
|
2004
|
-
if isinstance(elt,
|
|
2005
|
-
return
|
|
1959
|
+
compr = uni.SubNodeList[uni.InnerCompr](items=valid, delim=Tok.COMMA, kid=valid)
|
|
1960
|
+
if isinstance(elt, uni.Expr):
|
|
1961
|
+
return uni.SetCompr(out_expr=elt, compr=valid, kid=[elt, compr])
|
|
2006
1962
|
else:
|
|
2007
1963
|
raise self.ice()
|
|
2008
1964
|
|
|
2009
|
-
def proc_slice(self, node: py_ast.Slice) ->
|
|
1965
|
+
def proc_slice(self, node: py_ast.Slice) -> uni.IndexSlice:
|
|
2010
1966
|
"""Process python node.
|
|
2011
1967
|
|
|
2012
1968
|
class Slice(_Slice):
|
|
@@ -2021,19 +1977,19 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2021
1977
|
if not valid_kid:
|
|
2022
1978
|
valid_kid = [self.operator(Tok.COLON, ":")]
|
|
2023
1979
|
if (
|
|
2024
|
-
(isinstance(lower,
|
|
2025
|
-
and (isinstance(upper,
|
|
2026
|
-
and (isinstance(step,
|
|
1980
|
+
(isinstance(lower, uni.Expr) or lower is None)
|
|
1981
|
+
and (isinstance(upper, uni.Expr) or upper is None)
|
|
1982
|
+
and (isinstance(step, uni.Expr) or step is None)
|
|
2027
1983
|
):
|
|
2028
|
-
return
|
|
2029
|
-
slices=[
|
|
1984
|
+
return uni.IndexSlice(
|
|
1985
|
+
slices=[uni.IndexSlice.Slice(lower, upper, step)],
|
|
2030
1986
|
is_range=True,
|
|
2031
1987
|
kid=valid_kid,
|
|
2032
1988
|
)
|
|
2033
1989
|
else:
|
|
2034
1990
|
raise self.ice()
|
|
2035
1991
|
|
|
2036
|
-
def proc_starred(self, node: py_ast.Starred) ->
|
|
1992
|
+
def proc_starred(self, node: py_ast.Starred) -> uni.UnaryExpr:
|
|
2037
1993
|
"""Process python node.
|
|
2038
1994
|
|
|
2039
1995
|
class Starred(expr):
|
|
@@ -2042,12 +1998,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2042
1998
|
"""
|
|
2043
1999
|
star_tok = self.operator(Tok.STAR_MUL, "*")
|
|
2044
2000
|
value = self.convert(node.value)
|
|
2045
|
-
if isinstance(value,
|
|
2046
|
-
return
|
|
2001
|
+
if isinstance(value, uni.Expr):
|
|
2002
|
+
return uni.UnaryExpr(operand=value, op=star_tok, kid=[value, star_tok])
|
|
2047
2003
|
else:
|
|
2048
2004
|
raise self.ice()
|
|
2049
2005
|
|
|
2050
|
-
def proc_subscript(self, node: py_ast.Subscript) ->
|
|
2006
|
+
def proc_subscript(self, node: py_ast.Subscript) -> uni.AtomTrailer:
|
|
2051
2007
|
"""Process python node.
|
|
2052
2008
|
|
|
2053
2009
|
class Subscript(expr):
|
|
@@ -2057,32 +2013,32 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2057
2013
|
"""
|
|
2058
2014
|
value = self.convert(node.value)
|
|
2059
2015
|
slice = self.convert(node.slice)
|
|
2060
|
-
if not isinstance(slice,
|
|
2061
|
-
slice =
|
|
2062
|
-
slices=[
|
|
2016
|
+
if not isinstance(slice, uni.IndexSlice) and isinstance(slice, uni.Expr):
|
|
2017
|
+
slice = uni.IndexSlice(
|
|
2018
|
+
slices=[uni.IndexSlice.Slice(slice, None, None)],
|
|
2063
2019
|
is_range=False,
|
|
2064
2020
|
kid=[slice],
|
|
2065
2021
|
)
|
|
2066
2022
|
if (
|
|
2067
|
-
not isinstance(slice,
|
|
2068
|
-
and isinstance(slice,
|
|
2023
|
+
not isinstance(slice, uni.IndexSlice)
|
|
2024
|
+
and isinstance(slice, uni.TupleVal)
|
|
2069
2025
|
and slice.values is not None
|
|
2070
2026
|
):
|
|
2071
2027
|
|
|
2072
|
-
slices: list[
|
|
2028
|
+
slices: list[uni.IndexSlice.Slice] = []
|
|
2073
2029
|
for index_slice in slice.values.items:
|
|
2074
|
-
if not isinstance(index_slice,
|
|
2030
|
+
if not isinstance(index_slice, uni.IndexSlice):
|
|
2075
2031
|
raise self.ice()
|
|
2076
2032
|
slices.append(index_slice.slices[0])
|
|
2077
2033
|
|
|
2078
|
-
slice =
|
|
2034
|
+
slice = uni.IndexSlice(
|
|
2079
2035
|
slices=slices,
|
|
2080
2036
|
is_range=True,
|
|
2081
2037
|
kid=[slice],
|
|
2082
2038
|
)
|
|
2083
2039
|
|
|
2084
|
-
if isinstance(value,
|
|
2085
|
-
return
|
|
2040
|
+
if isinstance(value, uni.Expr) and isinstance(slice, uni.IndexSlice):
|
|
2041
|
+
return uni.AtomTrailer(
|
|
2086
2042
|
target=value,
|
|
2087
2043
|
right=slice,
|
|
2088
2044
|
is_attr=False,
|
|
@@ -2092,7 +2048,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2092
2048
|
else:
|
|
2093
2049
|
raise self.ice()
|
|
2094
2050
|
|
|
2095
|
-
def proc_try(self, node: py_ast.Try | py_ast.TryStar) ->
|
|
2051
|
+
def proc_try(self, node: py_ast.Try | py_ast.TryStar) -> uni.TryStmt:
|
|
2096
2052
|
"""Process python node.
|
|
2097
2053
|
|
|
2098
2054
|
class Try(stmt):
|
|
@@ -2102,24 +2058,24 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2102
2058
|
finalbody: list[stmt]
|
|
2103
2059
|
"""
|
|
2104
2060
|
body = [self.convert(i) for i in node.body]
|
|
2105
|
-
valid = [i for i in body if isinstance(i, (
|
|
2061
|
+
valid = [i for i in body if isinstance(i, (uni.CodeBlockStmt))]
|
|
2106
2062
|
if len(valid) != len(body):
|
|
2107
2063
|
raise self.ice("Length mismatch in try body")
|
|
2108
|
-
valid_body =
|
|
2064
|
+
valid_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
2109
2065
|
items=valid,
|
|
2110
2066
|
delim=Tok.WS,
|
|
2111
2067
|
kid=valid,
|
|
2112
2068
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
2113
2069
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
2114
2070
|
)
|
|
2115
|
-
kid: list[
|
|
2071
|
+
kid: list[uni.UniNode] = [valid_body]
|
|
2116
2072
|
|
|
2117
2073
|
if len(node.handlers) != 0:
|
|
2118
2074
|
handlers = [self.convert(i) for i in node.handlers]
|
|
2119
|
-
valid_handlers = [i for i in handlers if isinstance(i, (
|
|
2075
|
+
valid_handlers = [i for i in handlers if isinstance(i, (uni.Except))]
|
|
2120
2076
|
if len(handlers) != len(valid_handlers):
|
|
2121
2077
|
raise self.ice("Length mismatch in try handlers")
|
|
2122
|
-
excepts =
|
|
2078
|
+
excepts = uni.SubNodeList[uni.Except](
|
|
2123
2079
|
items=valid_handlers, delim=Tok.WS, kid=valid_handlers
|
|
2124
2080
|
)
|
|
2125
2081
|
kid.append(excepts)
|
|
@@ -2128,17 +2084,17 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2128
2084
|
|
|
2129
2085
|
if len(node.orelse) != 0:
|
|
2130
2086
|
orelse = [self.convert(i) for i in node.orelse]
|
|
2131
|
-
valid_orelse = [i for i in orelse if isinstance(i, (
|
|
2087
|
+
valid_orelse = [i for i in orelse if isinstance(i, (uni.CodeBlockStmt))]
|
|
2132
2088
|
if len(orelse) != len(valid_orelse):
|
|
2133
2089
|
raise self.ice("Length mismatch in try orelse")
|
|
2134
|
-
else_body =
|
|
2090
|
+
else_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
2135
2091
|
items=valid_orelse,
|
|
2136
2092
|
delim=Tok.WS,
|
|
2137
2093
|
kid=valid_orelse,
|
|
2138
2094
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
2139
2095
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
2140
2096
|
)
|
|
2141
|
-
elsestmt =
|
|
2097
|
+
elsestmt = uni.ElseStmt(body=else_body, kid=[else_body])
|
|
2142
2098
|
kid.append(else_body)
|
|
2143
2099
|
else:
|
|
2144
2100
|
else_body = None
|
|
@@ -2146,23 +2102,23 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2146
2102
|
if len(node.finalbody) != 0:
|
|
2147
2103
|
finalbody = [self.convert(i) for i in node.finalbody]
|
|
2148
2104
|
valid_finalbody = [
|
|
2149
|
-
i for i in finalbody if isinstance(i, (
|
|
2105
|
+
i for i in finalbody if isinstance(i, (uni.CodeBlockStmt))
|
|
2150
2106
|
]
|
|
2151
2107
|
if len(finalbody) != len(valid_finalbody):
|
|
2152
2108
|
raise self.ice("Length mismatch in try finalbody")
|
|
2153
|
-
finally_body =
|
|
2109
|
+
finally_body = uni.SubNodeList[uni.CodeBlockStmt](
|
|
2154
2110
|
items=valid_finalbody,
|
|
2155
2111
|
delim=Tok.WS,
|
|
2156
2112
|
kid=valid_finalbody,
|
|
2157
2113
|
left_enc=self.operator(Tok.LBRACE, "{"),
|
|
2158
2114
|
right_enc=self.operator(Tok.RBRACE, "}"),
|
|
2159
2115
|
)
|
|
2160
|
-
finally_stmt =
|
|
2116
|
+
finally_stmt = uni.FinallyStmt(body=finally_body, kid=[finally_body])
|
|
2161
2117
|
|
|
2162
2118
|
kid.append(finally_stmt)
|
|
2163
2119
|
else:
|
|
2164
2120
|
finally_body = None
|
|
2165
|
-
ret =
|
|
2121
|
+
ret = uni.TryStmt(
|
|
2166
2122
|
body=valid_body,
|
|
2167
2123
|
excepts=excepts,
|
|
2168
2124
|
else_body=elsestmt if else_body else None,
|
|
@@ -2171,7 +2127,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2171
2127
|
)
|
|
2172
2128
|
return ret
|
|
2173
2129
|
|
|
2174
|
-
def proc_try_star(self, node: py_ast.TryStar) ->
|
|
2130
|
+
def proc_try_star(self, node: py_ast.TryStar) -> uni.TryStmt:
|
|
2175
2131
|
"""Process python node.
|
|
2176
2132
|
|
|
2177
2133
|
class Try(stmt):
|
|
@@ -2182,7 +2138,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2182
2138
|
"""
|
|
2183
2139
|
return self.proc_try(node)
|
|
2184
2140
|
|
|
2185
|
-
def proc_tuple(self, node: py_ast.Tuple) ->
|
|
2141
|
+
def proc_tuple(self, node: py_ast.Tuple) -> uni.TupleVal:
|
|
2186
2142
|
"""Process python node.
|
|
2187
2143
|
|
|
2188
2144
|
class Tuple(expr):
|
|
@@ -2191,10 +2147,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2191
2147
|
"""
|
|
2192
2148
|
elts = [self.convert(elt) for elt in node.elts]
|
|
2193
2149
|
if len(node.elts) != 0:
|
|
2194
|
-
valid = [i for i in elts if isinstance(i, (
|
|
2150
|
+
valid = [i for i in elts if isinstance(i, (uni.Expr, uni.KWPair))]
|
|
2195
2151
|
if len(elts) != len(valid):
|
|
2196
2152
|
raise self.ice("Length mismatch in tuple elts")
|
|
2197
|
-
valid_elts =
|
|
2153
|
+
valid_elts = uni.SubNodeList[uni.Expr | uni.KWPair](
|
|
2198
2154
|
items=valid, delim=Tok.COMMA, kid=valid
|
|
2199
2155
|
)
|
|
2200
2156
|
kid = elts
|
|
@@ -2203,40 +2159,40 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2203
2159
|
r_paren = self.operator(Tok.RPAREN, ")")
|
|
2204
2160
|
valid_elts = None
|
|
2205
2161
|
kid = [l_paren, r_paren]
|
|
2206
|
-
return
|
|
2162
|
+
return uni.TupleVal(values=valid_elts, kid=kid)
|
|
2207
2163
|
|
|
2208
|
-
def proc_yield(self, node: py_ast.Yield) ->
|
|
2164
|
+
def proc_yield(self, node: py_ast.Yield) -> uni.YieldExpr:
|
|
2209
2165
|
"""Process python node.
|
|
2210
2166
|
|
|
2211
2167
|
class Yield(expr):
|
|
2212
2168
|
value: expr | None
|
|
2213
2169
|
"""
|
|
2214
2170
|
value = self.convert(node.value) if node.value else None
|
|
2215
|
-
if isinstance(value,
|
|
2216
|
-
return
|
|
2171
|
+
if isinstance(value, uni.Expr):
|
|
2172
|
+
return uni.YieldExpr(expr=value, with_from=False, kid=[value])
|
|
2217
2173
|
elif not value:
|
|
2218
|
-
return
|
|
2174
|
+
return uni.YieldExpr(
|
|
2219
2175
|
expr=None, with_from=False, kid=[self.operator(Tok.KW_YIELD, "yield")]
|
|
2220
2176
|
)
|
|
2221
2177
|
else:
|
|
2222
2178
|
raise self.ice()
|
|
2223
2179
|
|
|
2224
|
-
def proc_yield_from(self, node: py_ast.YieldFrom) ->
|
|
2180
|
+
def proc_yield_from(self, node: py_ast.YieldFrom) -> uni.YieldExpr:
|
|
2225
2181
|
"""Process python node."""
|
|
2226
2182
|
value = self.convert(node.value)
|
|
2227
|
-
if isinstance(value,
|
|
2228
|
-
return
|
|
2183
|
+
if isinstance(value, uni.Expr):
|
|
2184
|
+
return uni.YieldExpr(expr=value, with_from=True, kid=[value])
|
|
2229
2185
|
else:
|
|
2230
2186
|
raise self.ice()
|
|
2231
2187
|
|
|
2232
|
-
def proc_alias(self, node: py_ast.alias) ->
|
|
2188
|
+
def proc_alias(self, node: py_ast.alias) -> uni.ExprAsItem:
|
|
2233
2189
|
"""Process python node.
|
|
2234
2190
|
|
|
2235
2191
|
class alias(AST):
|
|
2236
2192
|
name: _Identifier
|
|
2237
2193
|
asname: _Identifier | None
|
|
2238
2194
|
"""
|
|
2239
|
-
name =
|
|
2195
|
+
name = uni.Name(
|
|
2240
2196
|
orig_src=self.orig_src,
|
|
2241
2197
|
name=Tok.NAME,
|
|
2242
2198
|
value=node.name,
|
|
@@ -2248,7 +2204,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2248
2204
|
pos_end=0,
|
|
2249
2205
|
)
|
|
2250
2206
|
asname = (
|
|
2251
|
-
|
|
2207
|
+
uni.Name(
|
|
2252
2208
|
orig_src=self.orig_src,
|
|
2253
2209
|
name=Tok.NAME,
|
|
2254
2210
|
value=node.asname,
|
|
@@ -2262,11 +2218,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2262
2218
|
if node.asname
|
|
2263
2219
|
else None
|
|
2264
2220
|
)
|
|
2265
|
-
return
|
|
2221
|
+
return uni.ExprAsItem(
|
|
2266
2222
|
expr=name, alias=asname, kid=[name, asname] if asname else [name]
|
|
2267
2223
|
)
|
|
2268
2224
|
|
|
2269
|
-
def proc_arg(self, node: py_ast.arg) ->
|
|
2225
|
+
def proc_arg(self, node: py_ast.arg) -> uni.ParamVar:
|
|
2270
2226
|
"""Process python node.
|
|
2271
2227
|
|
|
2272
2228
|
class arg(AST):
|
|
@@ -2282,7 +2238,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2282
2238
|
]
|
|
2283
2239
|
|
|
2284
2240
|
value = node.arg if node.arg not in reserved_keywords else f"<>{node.arg}"
|
|
2285
|
-
name =
|
|
2241
|
+
name = uni.Name(
|
|
2286
2242
|
orig_src=self.orig_src,
|
|
2287
2243
|
name=Tok.NAME,
|
|
2288
2244
|
value=value,
|
|
@@ -2296,7 +2252,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2296
2252
|
ann_expr = (
|
|
2297
2253
|
self.convert(node.annotation)
|
|
2298
2254
|
if node.annotation
|
|
2299
|
-
else
|
|
2255
|
+
else uni.Name(
|
|
2300
2256
|
orig_src=self.orig_src,
|
|
2301
2257
|
name=Tok.NAME,
|
|
2302
2258
|
value="Any",
|
|
@@ -2308,15 +2264,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2308
2264
|
pos_end=0,
|
|
2309
2265
|
)
|
|
2310
2266
|
)
|
|
2311
|
-
if not isinstance(ann_expr,
|
|
2267
|
+
if not isinstance(ann_expr, uni.Expr):
|
|
2312
2268
|
raise self.ice("Expected annotation to be an expression")
|
|
2313
|
-
annot =
|
|
2314
|
-
paramvar =
|
|
2269
|
+
annot = uni.SubTag[uni.Expr](tag=ann_expr, kid=[ann_expr])
|
|
2270
|
+
paramvar = uni.ParamVar(
|
|
2315
2271
|
name=name, type_tag=annot, unpack=None, value=None, kid=[name, annot]
|
|
2316
2272
|
)
|
|
2317
2273
|
return paramvar
|
|
2318
2274
|
|
|
2319
|
-
def proc_arguments(self, node: py_ast.arguments) ->
|
|
2275
|
+
def proc_arguments(self, node: py_ast.arguments) -> uni.FuncSignature:
|
|
2320
2276
|
"""Process python node.
|
|
2321
2277
|
|
|
2322
2278
|
class arguments(AST):
|
|
@@ -2329,8 +2285,8 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2329
2285
|
"""
|
|
2330
2286
|
args = [self.convert(arg) for arg in node.args]
|
|
2331
2287
|
vararg = self.convert(node.vararg) if node.vararg else None
|
|
2332
|
-
if vararg and isinstance(vararg,
|
|
2333
|
-
vararg.unpack =
|
|
2288
|
+
if vararg and isinstance(vararg, uni.ParamVar):
|
|
2289
|
+
vararg.unpack = uni.Token(
|
|
2334
2290
|
orig_src=self.orig_src,
|
|
2335
2291
|
name=Tok.STAR_MUL,
|
|
2336
2292
|
value="*",
|
|
@@ -2349,14 +2305,14 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2349
2305
|
kwdefault = self.convert(kwd) if kwd else None
|
|
2350
2306
|
if (
|
|
2351
2307
|
kwdefault
|
|
2352
|
-
and isinstance(kwa,
|
|
2353
|
-
and isinstance(kwdefault,
|
|
2308
|
+
and isinstance(kwa, uni.ParamVar)
|
|
2309
|
+
and isinstance(kwdefault, uni.Expr)
|
|
2354
2310
|
):
|
|
2355
2311
|
kwa.value = kwdefault
|
|
2356
2312
|
kwa.add_kids_right([kwa.value])
|
|
2357
2313
|
kwarg = self.convert(node.kwarg) if node.kwarg else None
|
|
2358
|
-
if kwarg and isinstance(kwarg,
|
|
2359
|
-
kwarg.unpack =
|
|
2314
|
+
if kwarg and isinstance(kwarg, uni.ParamVar):
|
|
2315
|
+
kwarg.unpack = uni.Token(
|
|
2360
2316
|
orig_src=self.orig_src,
|
|
2361
2317
|
name=Tok.STAR_POW,
|
|
2362
2318
|
value="**",
|
|
@@ -2371,7 +2327,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2371
2327
|
defaults = [self.convert(expr) for expr in node.defaults]
|
|
2372
2328
|
params = [*args]
|
|
2373
2329
|
for param, default in zip(params[::-1], defaults[::-1]):
|
|
2374
|
-
if isinstance(default,
|
|
2330
|
+
if isinstance(default, uni.Expr) and isinstance(param, uni.ParamVar):
|
|
2375
2331
|
param.value = default
|
|
2376
2332
|
param.add_kids_right([default])
|
|
2377
2333
|
if vararg:
|
|
@@ -2381,12 +2337,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2381
2337
|
params.append(kwarg)
|
|
2382
2338
|
params += defaults
|
|
2383
2339
|
|
|
2384
|
-
valid_params = [param for param in params if isinstance(param,
|
|
2340
|
+
valid_params = [param for param in params if isinstance(param, uni.ParamVar)]
|
|
2385
2341
|
if valid_params:
|
|
2386
|
-
fs_params =
|
|
2342
|
+
fs_params = uni.SubNodeList[uni.ParamVar](
|
|
2387
2343
|
items=valid_params, delim=Tok.COMMA, kid=valid_params
|
|
2388
2344
|
)
|
|
2389
|
-
return
|
|
2345
|
+
return uni.FuncSignature(
|
|
2390
2346
|
params=fs_params,
|
|
2391
2347
|
return_type=None,
|
|
2392
2348
|
kid=[fs_params],
|
|
@@ -2394,15 +2350,15 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2394
2350
|
else:
|
|
2395
2351
|
_lparen = self.operator(Tok.LPAREN, "(")
|
|
2396
2352
|
_rparen = self.operator(Tok.RPAREN, ")")
|
|
2397
|
-
return
|
|
2353
|
+
return uni.FuncSignature(
|
|
2398
2354
|
params=None,
|
|
2399
2355
|
return_type=None,
|
|
2400
2356
|
kid=[_lparen, _rparen],
|
|
2401
2357
|
)
|
|
2402
2358
|
|
|
2403
|
-
def operator(self, tok: Tok, value: str) ->
|
|
2359
|
+
def operator(self, tok: Tok, value: str) -> uni.Token:
|
|
2404
2360
|
"""Create an operator token."""
|
|
2405
|
-
return
|
|
2361
|
+
return uni.Token(
|
|
2406
2362
|
orig_src=self.orig_src,
|
|
2407
2363
|
name=tok,
|
|
2408
2364
|
value=value,
|
|
@@ -2414,123 +2370,123 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2414
2370
|
pos_end=0,
|
|
2415
2371
|
)
|
|
2416
2372
|
|
|
2417
|
-
def proc_and(self, node: py_ast.And) ->
|
|
2373
|
+
def proc_and(self, node: py_ast.And) -> uni.Token:
|
|
2418
2374
|
"""Process python node."""
|
|
2419
2375
|
return self.operator(Tok.KW_AND, "and")
|
|
2420
2376
|
|
|
2421
|
-
def proc_or(self, node: py_ast.Or) ->
|
|
2377
|
+
def proc_or(self, node: py_ast.Or) -> uni.Token:
|
|
2422
2378
|
"""Process python node."""
|
|
2423
2379
|
return self.operator(Tok.KW_OR, "or")
|
|
2424
2380
|
|
|
2425
|
-
def proc_add(self, node: py_ast.Add) ->
|
|
2381
|
+
def proc_add(self, node: py_ast.Add) -> uni.Token:
|
|
2426
2382
|
"""Process python node."""
|
|
2427
2383
|
return self.operator(Tok.PLUS, "+")
|
|
2428
2384
|
|
|
2429
|
-
def proc_bit_and(self, node: py_ast.BitAnd) ->
|
|
2385
|
+
def proc_bit_and(self, node: py_ast.BitAnd) -> uni.Token:
|
|
2430
2386
|
"""Process python node."""
|
|
2431
2387
|
return self.operator(Tok.BW_AND, "&")
|
|
2432
2388
|
|
|
2433
|
-
def proc_bit_or(self, node: py_ast.BitOr) ->
|
|
2389
|
+
def proc_bit_or(self, node: py_ast.BitOr) -> uni.Token:
|
|
2434
2390
|
"""Process python node."""
|
|
2435
2391
|
return self.operator(Tok.BW_OR, "|")
|
|
2436
2392
|
|
|
2437
|
-
def proc_bit_xor(self, node: py_ast.BitXor) ->
|
|
2393
|
+
def proc_bit_xor(self, node: py_ast.BitXor) -> uni.Token:
|
|
2438
2394
|
"""Process python node."""
|
|
2439
2395
|
return self.operator(Tok.BW_XOR, "^")
|
|
2440
2396
|
|
|
2441
|
-
def proc_div(self, node: py_ast.Div) ->
|
|
2397
|
+
def proc_div(self, node: py_ast.Div) -> uni.Token:
|
|
2442
2398
|
"""Process python node."""
|
|
2443
2399
|
return self.operator(Tok.DIV, "/")
|
|
2444
2400
|
|
|
2445
|
-
def proc_floor_div(self, node: py_ast.FloorDiv) ->
|
|
2401
|
+
def proc_floor_div(self, node: py_ast.FloorDiv) -> uni.Token:
|
|
2446
2402
|
"""Process python node."""
|
|
2447
2403
|
return self.operator(Tok.FLOOR_DIV, "//")
|
|
2448
2404
|
|
|
2449
|
-
def proc_l_shift(self, node: py_ast.LShift) ->
|
|
2405
|
+
def proc_l_shift(self, node: py_ast.LShift) -> uni.Token:
|
|
2450
2406
|
"""Process python node."""
|
|
2451
2407
|
return self.operator(Tok.LSHIFT, "<<")
|
|
2452
2408
|
|
|
2453
|
-
def proc_mod(self, node: py_ast.Mod) ->
|
|
2409
|
+
def proc_mod(self, node: py_ast.Mod) -> uni.Token:
|
|
2454
2410
|
"""Process python node."""
|
|
2455
2411
|
return self.operator(Tok.MOD, "%")
|
|
2456
2412
|
|
|
2457
|
-
def proc_mult(self, node: py_ast.Mult) ->
|
|
2413
|
+
def proc_mult(self, node: py_ast.Mult) -> uni.Token:
|
|
2458
2414
|
"""Process python node."""
|
|
2459
2415
|
return self.operator(Tok.STAR_MUL, "*")
|
|
2460
2416
|
|
|
2461
|
-
def proc_mat_mult(self, node: py_ast.MatMult) ->
|
|
2417
|
+
def proc_mat_mult(self, node: py_ast.MatMult) -> uni.Token:
|
|
2462
2418
|
"""Process python node."""
|
|
2463
2419
|
return self.operator(Tok.DECOR_OP, "@")
|
|
2464
2420
|
|
|
2465
|
-
def proc_pow(self, node: py_ast.Pow) ->
|
|
2421
|
+
def proc_pow(self, node: py_ast.Pow) -> uni.Token:
|
|
2466
2422
|
"""Process python node."""
|
|
2467
2423
|
return self.operator(Tok.STAR_POW, "**")
|
|
2468
2424
|
|
|
2469
|
-
def proc_r_shift(self, node: py_ast.RShift) ->
|
|
2425
|
+
def proc_r_shift(self, node: py_ast.RShift) -> uni.Token:
|
|
2470
2426
|
"""Process python node."""
|
|
2471
2427
|
return self.operator(Tok.RSHIFT, ">>")
|
|
2472
2428
|
|
|
2473
|
-
def proc_sub(self, node: py_ast.Sub) ->
|
|
2429
|
+
def proc_sub(self, node: py_ast.Sub) -> uni.Token:
|
|
2474
2430
|
"""Process python node."""
|
|
2475
2431
|
return self.operator(Tok.MINUS, "-")
|
|
2476
2432
|
|
|
2477
|
-
def proc_invert(self, node: py_ast.Invert) ->
|
|
2433
|
+
def proc_invert(self, node: py_ast.Invert) -> uni.Token:
|
|
2478
2434
|
"""Process python node."""
|
|
2479
2435
|
return self.operator(Tok.BW_NOT, "~")
|
|
2480
2436
|
|
|
2481
|
-
def proc_not(self, node: py_ast.Not) ->
|
|
2437
|
+
def proc_not(self, node: py_ast.Not) -> uni.Token:
|
|
2482
2438
|
"""Process python node."""
|
|
2483
2439
|
return self.operator(Tok.NOT, "not")
|
|
2484
2440
|
|
|
2485
|
-
def proc_u_add(self, node: py_ast.UAdd) ->
|
|
2441
|
+
def proc_u_add(self, node: py_ast.UAdd) -> uni.Token:
|
|
2486
2442
|
"""Process python node."""
|
|
2487
2443
|
return self.operator(Tok.PLUS, "+")
|
|
2488
2444
|
|
|
2489
|
-
def proc_u_sub(self, node: py_ast.USub) ->
|
|
2445
|
+
def proc_u_sub(self, node: py_ast.USub) -> uni.Token:
|
|
2490
2446
|
"""Process python node."""
|
|
2491
2447
|
return self.operator(Tok.MINUS, "-")
|
|
2492
2448
|
|
|
2493
|
-
def proc_eq(self, node: py_ast.Eq) ->
|
|
2449
|
+
def proc_eq(self, node: py_ast.Eq) -> uni.Token:
|
|
2494
2450
|
"""Process python node."""
|
|
2495
2451
|
return self.operator(Tok.EE, "==")
|
|
2496
2452
|
|
|
2497
|
-
def proc_gt(self, node: py_ast.Gt) ->
|
|
2453
|
+
def proc_gt(self, node: py_ast.Gt) -> uni.Token:
|
|
2498
2454
|
"""Process python node."""
|
|
2499
2455
|
return self.operator(Tok.GT, ">")
|
|
2500
2456
|
|
|
2501
|
-
def proc_gt_e(self, node: py_ast.GtE) ->
|
|
2457
|
+
def proc_gt_e(self, node: py_ast.GtE) -> uni.Token:
|
|
2502
2458
|
"""Process python node."""
|
|
2503
2459
|
return self.operator(Tok.GTE, ">=")
|
|
2504
2460
|
|
|
2505
|
-
def proc_in(self, node: py_ast.In) ->
|
|
2461
|
+
def proc_in(self, node: py_ast.In) -> uni.Token:
|
|
2506
2462
|
"""Process python node."""
|
|
2507
2463
|
return self.operator(Tok.KW_IN, "in")
|
|
2508
2464
|
|
|
2509
|
-
def proc_is(self, node: py_ast.Is) ->
|
|
2465
|
+
def proc_is(self, node: py_ast.Is) -> uni.Token:
|
|
2510
2466
|
"""Process python node."""
|
|
2511
2467
|
return self.operator(Tok.KW_IS, "is")
|
|
2512
2468
|
|
|
2513
|
-
def proc_is_not(self, node: py_ast.IsNot) ->
|
|
2469
|
+
def proc_is_not(self, node: py_ast.IsNot) -> uni.Token:
|
|
2514
2470
|
"""Process python node."""
|
|
2515
2471
|
return self.operator(Tok.KW_ISN, "is not")
|
|
2516
2472
|
|
|
2517
|
-
def proc_lt(self, node: py_ast.Lt) ->
|
|
2473
|
+
def proc_lt(self, node: py_ast.Lt) -> uni.Token:
|
|
2518
2474
|
"""Process python node."""
|
|
2519
2475
|
return self.operator(Tok.LT, "<")
|
|
2520
2476
|
|
|
2521
|
-
def proc_lt_e(self, node: py_ast.LtE) ->
|
|
2477
|
+
def proc_lt_e(self, node: py_ast.LtE) -> uni.Token:
|
|
2522
2478
|
"""Process python node."""
|
|
2523
2479
|
return self.operator(Tok.LTE, "<=")
|
|
2524
2480
|
|
|
2525
|
-
def proc_not_eq(self, node: py_ast.NotEq) ->
|
|
2481
|
+
def proc_not_eq(self, node: py_ast.NotEq) -> uni.Token:
|
|
2526
2482
|
"""Process python node."""
|
|
2527
2483
|
return self.operator(Tok.NE, "!=")
|
|
2528
2484
|
|
|
2529
|
-
def proc_not_in(self, node: py_ast.NotIn) ->
|
|
2485
|
+
def proc_not_in(self, node: py_ast.NotIn) -> uni.Token:
|
|
2530
2486
|
"""Process python node."""
|
|
2531
2487
|
return self.operator(Tok.KW_NIN, "not in")
|
|
2532
2488
|
|
|
2533
|
-
def proc_comprehension(self, node: py_ast.comprehension) ->
|
|
2489
|
+
def proc_comprehension(self, node: py_ast.comprehension) -> uni.InnerCompr:
|
|
2534
2490
|
"""Process python node.
|
|
2535
2491
|
|
|
2536
2492
|
class comprehension(AST):
|
|
@@ -2543,12 +2499,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2543
2499
|
iter = self.convert(node.iter)
|
|
2544
2500
|
if len(node.ifs) != 0:
|
|
2545
2501
|
ifs_list = [self.convert(ifs) for ifs in node.ifs]
|
|
2546
|
-
valid = [ifs for ifs in ifs_list if isinstance(ifs,
|
|
2502
|
+
valid = [ifs for ifs in ifs_list if isinstance(ifs, uni.Expr)]
|
|
2547
2503
|
else:
|
|
2548
2504
|
valid = None
|
|
2549
2505
|
is_async = node.is_async > 0
|
|
2550
|
-
if isinstance(target,
|
|
2551
|
-
return
|
|
2506
|
+
if isinstance(target, uni.Expr) and isinstance(iter, uni.Expr):
|
|
2507
|
+
return uni.InnerCompr(
|
|
2552
2508
|
is_async=is_async,
|
|
2553
2509
|
target=target,
|
|
2554
2510
|
collection=iter,
|
|
@@ -2558,7 +2514,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2558
2514
|
else:
|
|
2559
2515
|
raise self.ice()
|
|
2560
2516
|
|
|
2561
|
-
def proc_keyword(self, node: py_ast.keyword) ->
|
|
2517
|
+
def proc_keyword(self, node: py_ast.keyword) -> uni.KWPair:
|
|
2562
2518
|
"""Process python node.
|
|
2563
2519
|
|
|
2564
2520
|
class keyword(AST):
|
|
@@ -2567,7 +2523,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2567
2523
|
arg: _Identifier | None
|
|
2568
2524
|
value: expr
|
|
2569
2525
|
"""
|
|
2570
|
-
arg =
|
|
2526
|
+
arg = uni.Name(
|
|
2571
2527
|
orig_src=self.orig_src,
|
|
2572
2528
|
name=Tok.NAME,
|
|
2573
2529
|
value=node.arg if node.arg else "_",
|
|
@@ -2579,12 +2535,12 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2579
2535
|
pos_end=0,
|
|
2580
2536
|
)
|
|
2581
2537
|
value = self.convert(node.value)
|
|
2582
|
-
if isinstance(value,
|
|
2583
|
-
return
|
|
2538
|
+
if isinstance(value, uni.Expr):
|
|
2539
|
+
return uni.KWPair(key=arg, value=value, kid=[arg, value])
|
|
2584
2540
|
else:
|
|
2585
2541
|
raise self.ice()
|
|
2586
2542
|
|
|
2587
|
-
def proc_match_case(self, node: py_ast.match_case) ->
|
|
2543
|
+
def proc_match_case(self, node: py_ast.match_case) -> uni.MatchCase:
|
|
2588
2544
|
"""Process python node.
|
|
2589
2545
|
|
|
2590
2546
|
class match_case(AST):
|
|
@@ -2595,11 +2551,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2595
2551
|
pattern = self.convert(node.pattern)
|
|
2596
2552
|
guard = self.convert(node.guard) if node.guard else None
|
|
2597
2553
|
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,
|
|
2554
|
+
valid = [i for i in body if isinstance(i, uni.CodeBlockStmt)]
|
|
2555
|
+
if isinstance(pattern, uni.MatchPattern) and (
|
|
2556
|
+
isinstance(guard, uni.Expr) or guard is None
|
|
2601
2557
|
):
|
|
2602
|
-
return
|
|
2558
|
+
return uni.MatchCase(
|
|
2603
2559
|
pattern=pattern,
|
|
2604
2560
|
guard=guard,
|
|
2605
2561
|
body=valid,
|
|
@@ -2608,7 +2564,7 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2608
2564
|
else:
|
|
2609
2565
|
raise self.ice()
|
|
2610
2566
|
|
|
2611
|
-
def proc_withitem(self, node: py_ast.withitem) ->
|
|
2567
|
+
def proc_withitem(self, node: py_ast.withitem) -> uni.ExprAsItem:
|
|
2612
2568
|
"""Process python node.
|
|
2613
2569
|
|
|
2614
2570
|
class withitem(AST):
|
|
@@ -2617,10 +2573,10 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2617
2573
|
"""
|
|
2618
2574
|
context_expr = self.convert(node.context_expr)
|
|
2619
2575
|
optional_vars = self.convert(node.optional_vars) if node.optional_vars else None
|
|
2620
|
-
if isinstance(context_expr,
|
|
2621
|
-
isinstance(optional_vars,
|
|
2576
|
+
if isinstance(context_expr, uni.Expr) and (
|
|
2577
|
+
isinstance(optional_vars, uni.Expr) or optional_vars is None
|
|
2622
2578
|
):
|
|
2623
|
-
return
|
|
2579
|
+
return uni.ExprAsItem(
|
|
2624
2580
|
expr=context_expr,
|
|
2625
2581
|
alias=optional_vars if optional_vars else None,
|
|
2626
2582
|
kid=[context_expr, optional_vars] if optional_vars else [context_expr],
|
|
@@ -2640,11 +2596,11 @@ class PyastBuildPass(Pass[ast.PythonModuleAst]):
|
|
|
2640
2596
|
def proc_type_var_tuple(self, node: py_ast.TypeVarTuple) -> None:
|
|
2641
2597
|
"""Process python node."""
|
|
2642
2598
|
|
|
2643
|
-
def convert_to_doc(self, string:
|
|
2599
|
+
def convert_to_doc(self, string: uni.String) -> None:
|
|
2644
2600
|
"""Convert a string to a docstring."""
|
|
2645
2601
|
string.value = f'"""{string.value[1:-1]}"""'
|
|
2646
2602
|
|
|
2647
|
-
def aug_op_map(self, tok_dict: dict, op:
|
|
2603
|
+
def aug_op_map(self, tok_dict: dict, op: uni.Token) -> str:
|
|
2648
2604
|
"""aug_mapper."""
|
|
2649
2605
|
op.value += "="
|
|
2650
2606
|
for _key, value in tok_dict.items():
|