jaclang 0.7.34__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/__init__.py +7 -414
- jaclang/cli/cli.md +5 -5
- jaclang/cli/cli.py +311 -214
- jaclang/cli/cmdreg.py +188 -31
- jaclang/compiler/__init__.py +10 -15
- jaclang/compiler/{codeloc.py → codeinfo.py} +11 -30
- jaclang/compiler/constant.py +10 -33
- jaclang/compiler/jac.lark +61 -92
- jaclang/compiler/larkparse/jac_parser.py +3444 -0
- jaclang/compiler/parser.py +1004 -1223
- jaclang/compiler/passes/__init__.py +2 -2
- jaclang/compiler/passes/main/__init__.py +33 -14
- jaclang/compiler/passes/main/annex_pass.py +85 -0
- jaclang/compiler/passes/main/cfg_build_pass.py +275 -0
- jaclang/compiler/passes/main/def_impl_match_pass.py +146 -102
- jaclang/compiler/passes/main/def_use_pass.py +64 -269
- jaclang/compiler/passes/main/import_pass.py +175 -360
- jaclang/compiler/passes/main/inheritance_pass.py +107 -105
- jaclang/compiler/passes/main/pyast_gen_pass.py +1129 -1600
- jaclang/compiler/passes/main/pyast_load_pass.py +540 -584
- jaclang/compiler/passes/main/pybc_gen_pass.py +38 -35
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +46 -160
- jaclang/compiler/passes/main/sym_tab_build_pass.py +113 -1202
- jaclang/compiler/passes/main/sym_tab_link_pass.py +141 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/access_modifier.jac +10 -9
- jaclang/compiler/passes/main/tests/fixtures/atest.impl.jac +3 -0
- jaclang/compiler/passes/main/tests/fixtures/atest.jac +11 -0
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl/getme.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.jac +3 -3
- jaclang/compiler/passes/main/tests/fixtures/autoimpl.something.else.impl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/base.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/base2.impl.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/base2.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/blip.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/cfg_ability_test.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/cfg_gen.jac +19 -0
- jaclang/compiler/passes/main/tests/fixtures/circular_import.jac +7 -0
- jaclang/compiler/passes/main/tests/fixtures/data_spatial_types.jac +12 -12
- jaclang/compiler/passes/main/tests/fixtures/decls.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defn_decl_mismatch.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/defs_and_uses.jac +6 -6
- jaclang/compiler/passes/main/tests/fixtures/enumerations.jac +13 -0
- jaclang/compiler/passes/main/tests/fixtures/fstrings.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/func.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/func2.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/game1.jac +4 -4
- jaclang/compiler/passes/main/tests/fixtures/impl/defs1.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/defs2.jac +2 -2
- jaclang/compiler/passes/main/tests/fixtures/impl/imps.jac +0 -8
- jaclang/compiler/passes/main/tests/fixtures/impl_grab.impl.jac +5 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/impl_grab.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/incautoimpl.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/main_err.impl.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/main_err.jac +6 -0
- jaclang/compiler/passes/main/tests/fixtures/mod_type_assign.jac +1 -1
- jaclang/compiler/passes/main/tests/fixtures/mtest.impl.jac +6 -0
- jaclang/{tests → compiler/passes/main/tests}/fixtures/mtest.jac +1 -1
- jaclang/{tests → compiler/passes/main/tests}/fixtures/nested_impls.jac +14 -15
- jaclang/compiler/passes/main/tests/fixtures/py_imp_test.jac +7 -7
- jaclang/compiler/passes/main/tests/fixtures/second_err.jac +4 -0
- jaclang/compiler/passes/main/tests/fixtures/str2doc.py +3 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/__init__.py +5 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/actions.jac +23 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/main.jac +14 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/no_dupls.jac +35 -0
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/one.jac +8 -0
- jaclang/compiler/passes/main/tests/fixtures/type_info.jac +4 -4
- jaclang/compiler/passes/main/tests/test_cfg_build_pass.py +99 -0
- jaclang/compiler/passes/main/tests/test_decl_impl_match_pass.py +157 -0
- jaclang/compiler/passes/main/tests/test_def_use_pass.py +4 -6
- jaclang/compiler/passes/main/tests/test_import_pass.py +59 -46
- jaclang/compiler/passes/main/tests/test_pyast_build_pass.py +15 -0
- jaclang/compiler/passes/main/tests/test_pyast_gen_pass.py +25 -34
- jaclang/compiler/passes/main/tests/test_pybc_gen_pass.py +3 -3
- jaclang/compiler/passes/main/tests/test_sub_node_pass.py +8 -7
- jaclang/compiler/passes/main/tests/test_sym_tab_build_pass.py +4 -4
- jaclang/compiler/passes/main/tests/test_sym_tab_link_pass.py +62 -0
- jaclang/compiler/passes/tool/__init__.py +2 -0
- jaclang/compiler/passes/tool/doc_ir.py +179 -0
- jaclang/compiler/passes/tool/doc_ir_gen_pass.py +1210 -0
- jaclang/compiler/passes/tool/fuse_comments_pass.py +90 -70
- jaclang/compiler/passes/tool/jac_formatter_pass.py +122 -2554
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +249 -97
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +94 -97
- jaclang/compiler/passes/tool/tests/fixtures/doc_string.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/access_mod_check.jac +5 -5
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/archetype_test.jac +13 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/decorator_stack.jac +7 -7
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/line_spacing.jac +8 -8
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.dot +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.txt +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/ability_impl_long_comprehension.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/call_with_many_parameters.jac +2 -2
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/simple_walker.jac +3 -3
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/try_block_and_walker_spawn_and_fstrings.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/type_annotation.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac +10 -4
- jaclang/compiler/passes/tool/tests/test_doc_ir_gen_pass.py +29 -0
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +63 -88
- jaclang/compiler/passes/tool/tests/test_unparse_validate.py +27 -28
- jaclang/compiler/passes/transform.py +56 -16
- jaclang/compiler/passes/{ir_pass.py → uni_pass.py} +35 -52
- jaclang/compiler/program.py +205 -0
- jaclang/compiler/tests/fixtures/codegentext.jac +31 -0
- jaclang/compiler/tests/fixtures/fam.jac +10 -10
- jaclang/compiler/tests/fixtures/hello_world.jac +1 -1
- jaclang/compiler/tests/fixtures/staticcheck.jac +2 -2
- jaclang/compiler/tests/test_importer.py +21 -16
- jaclang/compiler/tests/test_parser.py +38 -17
- jaclang/compiler/{absyntree.py → unitree.py} +1120 -1012
- jaclang/langserve/engine.py +183 -171
- jaclang/langserve/sem_manager.py +26 -22
- jaclang/langserve/server.py +6 -15
- jaclang/langserve/tests/fixtures/base_module_structure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_err.jac +6 -6
- jaclang/langserve/tests/fixtures/circle_pure.impl.jac +5 -5
- jaclang/langserve/tests/fixtures/circle_pure.jac +7 -7
- jaclang/langserve/tests/fixtures/circle_pure_err.impl.jac +2 -2
- jaclang/langserve/tests/fixtures/circle_pure_err.jac +7 -7
- jaclang/langserve/tests/fixtures/import_include_statements.jac +6 -6
- jaclang/langserve/tests/fixtures/rename.jac +6 -6
- jaclang/langserve/tests/server_test/test_lang_serve.py +262 -0
- jaclang/langserve/tests/server_test/utils.py +115 -0
- jaclang/langserve/tests/test_sem_tokens.py +2 -2
- jaclang/langserve/tests/test_server.py +41 -23
- jaclang/langserve/utils.jac +438 -0
- jaclang/runtimelib/{architype.py → archetype.py} +85 -61
- jaclang/runtimelib/builtin.py +92 -0
- jaclang/runtimelib/constructs.py +11 -13
- jaclang/runtimelib/importer.py +63 -51
- jaclang/runtimelib/machine.py +1551 -144
- jaclang/runtimelib/memory.py +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/graph_purger.jac +1 -1
- jaclang/{plugin → runtimelib}/tests/fixtures/impl_match.jac +2 -2
- jaclang/runtimelib/tests/fixtures/impl_match_impl.jac +3 -0
- jaclang/{plugin → runtimelib}/tests/fixtures/other_root_access.jac +7 -7
- jaclang/{plugin → runtimelib}/tests/fixtures/savable_object.jac +3 -5
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_node_connection.jac +6 -6
- jaclang/{plugin → runtimelib}/tests/fixtures/simple_persistent.jac +1 -1
- jaclang/runtimelib/tests/test_features.py +72 -0
- jaclang/{plugin → runtimelib}/tests/test_jaseci.py +6 -5
- jaclang/runtimelib/utils.py +31 -63
- jaclang/settings.py +1 -6
- jaclang/tests/fixtures/{abc.jac → abc_check.jac} +6 -6
- jaclang/tests/fixtures/arch_rel_import_creation.jac +4 -4
- jaclang/tests/fixtures/async_ability.jac +18 -0
- jaclang/tests/fixtures/async_walker.jac +23 -0
- jaclang/tests/fixtures/baddy.jac +1 -1
- jaclang/tests/fixtures/base_class1.jac +2 -2
- jaclang/tests/fixtures/base_class2.jac +2 -2
- jaclang/tests/fixtures/base_class_complex_expr.jac +3 -3
- jaclang/tests/fixtures/builtin_dotgen.jac +1 -1
- jaclang/tests/fixtures/builtin_dotgen_json.jac +21 -0
- jaclang/tests/fixtures/byllmissue.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs.jac +1 -1
- jaclang/tests/fixtures/chandra_bugs2.jac +1 -1
- jaclang/tests/fixtures/cls_method.jac +6 -6
- jaclang/tests/fixtures/concurrency.jac +39 -0
- jaclang/tests/fixtures/connect_traverse_syntax.jac +18 -0
- jaclang/tests/fixtures/create_dynamic_archetype.jac +35 -0
- jaclang/tests/fixtures/decl_defn_param_name.jac +4 -4
- jaclang/tests/fixtures/deep/deeper/__init__.jac +1 -0
- jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac +2 -3
- jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac +3 -3
- jaclang/tests/fixtures/deep/deeper/snd_lev.jac +2 -2
- jaclang/tests/fixtures/deep/mycode.jac +1 -1
- jaclang/tests/fixtures/deep/one_lev.jac +3 -4
- jaclang/tests/fixtures/deep/one_lev_dup.jac +2 -2
- jaclang/tests/fixtures/deep_convert.jac +1 -1
- jaclang/tests/fixtures/deep_import.jac +2 -2
- jaclang/tests/fixtures/deep_import_interp.jac +8 -0
- jaclang/tests/fixtures/deep_import_mods.jac +3 -3
- jaclang/tests/fixtures/deferred_field.jac +1 -1
- jaclang/tests/fixtures/del_clean.jac +7 -0
- jaclang/tests/fixtures/disconn.jac +2 -2
- jaclang/tests/fixtures/dynamic_archetype.jac +34 -0
- jaclang/tests/fixtures/edge_node_walk.jac +12 -12
- jaclang/tests/fixtures/edge_ops.jac +7 -7
- jaclang/tests/fixtures/edges_walk.jac +10 -10
- jaclang/tests/fixtures/edgetypeissue.jac +1 -1
- jaclang/tests/fixtures/enum_inside_archtype.jac +4 -4
- jaclang/tests/fixtures/err.impl.jac +1 -1
- jaclang/tests/fixtures/err.jac +2 -2
- jaclang/tests/fixtures/err_runtime.jac +2 -2
- jaclang/tests/fixtures/foo.jac +7 -7
- jaclang/tests/fixtures/game1.jac +4 -4
- jaclang/tests/fixtures/gendot_bubble_sort.jac +4 -4
- jaclang/tests/fixtures/glob_multivar_statement.jac +1 -1
- jaclang/tests/fixtures/guess_game.jac +5 -5
- jaclang/tests/fixtures/has_goodness.jac +1 -1
- jaclang/tests/fixtures/hash_init_check.jac +3 -3
- jaclang/tests/fixtures/hello.jac +1 -1
- jaclang/tests/fixtures/ignore.jac +3 -3
- jaclang/tests/fixtures/ignore_dup.jac +3 -3
- jaclang/tests/fixtures/impl_match_confused.impl.jac +1 -1
- jaclang/tests/fixtures/import.jac +9 -9
- jaclang/tests/fixtures/import_all.jac +1 -1
- jaclang/tests/fixtures/index_slice.jac +1 -1
- jaclang/tests/fixtures/inherit_check.jac +3 -3
- jaclang/tests/fixtures/jac_from_py.py +4 -0
- jaclang/tests/fixtures/jacsamp.jac +1 -1
- jaclang/tests/fixtures/jactest_main.jac +1 -1
- jaclang/tests/fixtures/jp_importer.jac +7 -8
- jaclang/tests/fixtures/jp_importer_auto.jac +3 -3
- jaclang/tests/fixtures/lambda.jac +2 -2
- jaclang/tests/fixtures/needs_import.jac +6 -6
- jaclang/tests/fixtures/needs_import_1.jac +1 -1
- jaclang/tests/fixtures/needs_import_2.jac +1 -1
- jaclang/tests/fixtures/needs_import_3.jac +1 -1
- jaclang/tests/fixtures/needs_import_dup.jac +6 -6
- jaclang/tests/fixtures/node_del.jac +60 -0
- jaclang/tests/fixtures/nosigself.jac +3 -3
- jaclang/tests/fixtures/py2jac.py +30 -0
- jaclang/tests/fixtures/py_bool_expr.py +7 -0
- jaclang/tests/fixtures/py_namedexpr.py +7 -0
- jaclang/tests/fixtures/pyfunc_3.py +0 -2
- jaclang/tests/fixtures/random_check.jac +5 -5
- jaclang/tests/fixtures/simple_archs.jac +2 -2
- jaclang/tests/fixtures/simple_walk.jac +52 -0
- jaclang/tests/fixtures/slice_vals.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep.jac +3 -3
- jaclang/tests/fixtures/sub_abil_sep_multilev.jac +3 -3
- jaclang/tests/fixtures/trailing_comma.jac +4 -4
- jaclang/tests/fixtures/type_info.jac +5 -5
- jaclang/{compiler/passes/main/tests → tests}/fixtures/uninitialized_hasvars.jac +1 -1
- jaclang/tests/fixtures/visit_order.jac +4 -4
- jaclang/tests/fixtures/walker_override.jac +2 -2
- jaclang/tests/fixtures/walker_update.jac +5 -5
- jaclang/tests/fixtures/with_context.jac +4 -4
- jaclang/tests/test_bugs.py +2 -2
- jaclang/tests/test_cli.py +118 -223
- jaclang/tests/test_language.py +466 -473
- jaclang/tests/test_man_code.py +2 -2
- jaclang/tests/test_reference.py +4 -4
- jaclang/tests/test_settings.py +16 -16
- jaclang/tests/test_typecheck.py +555 -0
- jaclang/utils/__init__.py +4 -0
- jaclang/utils/helpers.py +12 -27
- jaclang/utils/lang_tools.py +84 -74
- jaclang/utils/module_resolver.py +69 -0
- jaclang/utils/test.py +8 -5
- jaclang/utils/tests/test_lang_tools.py +38 -13
- jaclang/utils/treeprinter.py +177 -40
- jaclang/vendor/__init__.py +1 -2
- jaclang/vendor/attr/__init__.py +14 -44
- jaclang/vendor/attr/__init__.pyi +155 -321
- jaclang/vendor/attr/_cmp.py +25 -15
- jaclang/vendor/attr/_cmp.pyi +7 -7
- jaclang/vendor/attr/_compat.py +15 -8
- jaclang/vendor/attr/_config.py +1 -1
- jaclang/vendor/attr/_funcs.py +148 -163
- jaclang/vendor/attr/_make.py +859 -855
- jaclang/vendor/attr/_next_gen.py +426 -32
- jaclang/vendor/attr/converters.py +67 -49
- jaclang/vendor/attr/converters.pyi +13 -7
- jaclang/vendor/attr/filters.py +17 -11
- jaclang/vendor/attr/filters.pyi +3 -3
- jaclang/vendor/attr/setters.py +11 -5
- jaclang/vendor/attr/setters.pyi +2 -1
- jaclang/vendor/attr/validators.py +191 -162
- jaclang/vendor/attr/validators.pyi +25 -27
- jaclang/vendor/attrs/__init__.py +9 -5
- jaclang/vendor/attrs/__init__.pyi +225 -29
- jaclang/vendor/attrs-25.3.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/METADATA +83 -53
- jaclang/vendor/attrs-25.3.0.dist-info/RECORD +56 -0
- jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/WHEEL +1 -1
- jaclang/vendor/bin/dmypy +8 -0
- jaclang/vendor/bin/mypy +8 -0
- jaclang/vendor/bin/mypyc +8 -0
- jaclang/vendor/bin/stubgen +8 -0
- jaclang/vendor/bin/stubtest +8 -0
- jaclang/vendor/cattr/gen.py +2 -2
- jaclang/vendor/cattr/preconf/bson.py +1 -0
- jaclang/vendor/cattr/preconf/json.py +1 -0
- jaclang/vendor/cattr/preconf/msgpack.py +1 -0
- jaclang/vendor/cattr/preconf/orjson.py +1 -0
- jaclang/vendor/cattr/preconf/pyyaml.py +1 -0
- jaclang/vendor/cattr/preconf/tomlkit.py +1 -0
- jaclang/vendor/cattr/preconf/ujson.py +1 -0
- jaclang/vendor/cattrs/__init__.py +21 -21
- jaclang/vendor/cattrs/_compat.py +176 -62
- jaclang/vendor/cattrs/_generics.py +5 -3
- jaclang/vendor/cattrs/cols.py +289 -0
- jaclang/vendor/cattrs/converters.py +505 -187
- jaclang/vendor/cattrs/disambiguators.py +118 -45
- jaclang/vendor/cattrs/dispatch.py +66 -36
- jaclang/vendor/cattrs/fns.py +6 -1
- jaclang/vendor/cattrs/gen/__init__.py +365 -202
- jaclang/vendor/cattrs/gen/_generics.py +41 -5
- jaclang/vendor/cattrs/gen/_lc.py +3 -2
- jaclang/vendor/cattrs/gen/_shared.py +39 -32
- jaclang/vendor/cattrs/gen/typeddicts.py +75 -88
- jaclang/vendor/cattrs/preconf/__init__.py +20 -0
- jaclang/vendor/cattrs/preconf/bson.py +7 -8
- jaclang/vendor/cattrs/preconf/cbor2.py +3 -0
- jaclang/vendor/cattrs/preconf/json.py +8 -4
- jaclang/vendor/cattrs/preconf/msgpack.py +3 -0
- jaclang/vendor/cattrs/preconf/msgspec.py +185 -0
- jaclang/vendor/cattrs/preconf/orjson.py +20 -7
- jaclang/vendor/cattrs/preconf/pyyaml.py +15 -3
- jaclang/vendor/cattrs/preconf/tomlkit.py +3 -1
- jaclang/vendor/cattrs/preconf/ujson.py +3 -0
- jaclang/vendor/cattrs/strategies/__init__.py +1 -0
- jaclang/vendor/cattrs/strategies/_class_methods.py +1 -1
- jaclang/vendor/cattrs/strategies/_subclasses.py +43 -29
- jaclang/vendor/cattrs/strategies/_unions.py +47 -24
- jaclang/vendor/cattrs/v.py +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/INSTALLER +1 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/METADATA +161 -0
- jaclang/vendor/cattrs-24.1.3.dist-info/RECORD +96 -0
- jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/WHEEL +1 -1
- jaclang/vendor/lark/__init__.py +38 -38
- jaclang/vendor/lark/__pyinstaller/__init__.py +6 -6
- jaclang/vendor/lark/__pyinstaller/hook-lark.py +14 -14
- jaclang/vendor/lark/ast_utils.py +59 -59
- jaclang/vendor/lark/common.py +86 -89
- jaclang/vendor/lark/exceptions.py +292 -292
- jaclang/vendor/lark/grammar.py +130 -130
- jaclang/vendor/lark/grammars/common.lark +59 -59
- jaclang/vendor/lark/grammars/lark.lark +62 -62
- jaclang/vendor/lark/grammars/python.lark +302 -302
- jaclang/vendor/lark/grammars/unicode.lark +7 -7
- jaclang/vendor/lark/indenter.py +143 -112
- jaclang/vendor/lark/lark.py +658 -661
- jaclang/vendor/lark/lexer.py +678 -678
- jaclang/vendor/lark/load_grammar.py +1428 -1428
- jaclang/vendor/lark/parse_tree_builder.py +391 -391
- jaclang/vendor/lark/parser_frontends.py +257 -257
- jaclang/vendor/lark/parsers/cyk.py +340 -340
- jaclang/vendor/lark/parsers/earley.py +317 -308
- jaclang/vendor/lark/parsers/earley_common.py +42 -42
- jaclang/vendor/lark/parsers/earley_forest.py +802 -810
- jaclang/vendor/lark/parsers/grammar_analysis.py +203 -203
- jaclang/vendor/lark/parsers/lalr_analysis.py +332 -332
- jaclang/vendor/lark/parsers/lalr_interactive_parser.py +158 -157
- jaclang/vendor/lark/parsers/lalr_parser.py +122 -122
- jaclang/vendor/lark/parsers/lalr_parser_state.py +110 -110
- jaclang/vendor/lark/parsers/xearley.py +165 -165
- jaclang/vendor/lark/reconstruct.py +107 -107
- jaclang/vendor/lark/tools/__init__.py +70 -71
- jaclang/vendor/lark/tools/nearley.py +202 -202
- jaclang/vendor/lark/tools/serialize.py +32 -32
- jaclang/vendor/lark/tools/standalone.py +196 -196
- jaclang/vendor/lark/tree.py +267 -272
- jaclang/vendor/lark/tree_matcher.py +186 -186
- jaclang/vendor/lark/utils.py +346 -361
- jaclang/vendor/lark/visitors.py +596 -593
- jaclang/vendor/lark-1.2.2.dist-info/INSTALLER +1 -0
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/METADATA +48 -47
- jaclang/vendor/lark-1.2.2.dist-info/RECORD +83 -0
- jaclang/vendor/{mypy_extensions-1.0.0.dist-info → lark-1.2.2.dist-info}/WHEEL +1 -1
- jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info/licenses}/LICENSE +18 -18
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/METADATA +2 -1
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/RECORD +17 -10
- jaclang/vendor/lsprotocol-2023.0.1.dist-info/WHEEL +1 -1
- jaclang/vendor/pluggy/_version.py +7 -2
- jaclang/vendor/pluggy-1.5.0.dist-info/INSTALLER +1 -0
- jaclang/vendor/pluggy-1.5.0.dist-info/METADATA +6 -5
- jaclang/vendor/pluggy-1.5.0.dist-info/RECORD +24 -14
- jaclang/vendor/pluggy-1.5.0.dist-info/WHEEL +1 -1
- jaclang/vendor/pygls-1.3.1.dist-info/INSTALLER +1 -0
- jaclang/vendor/pygls-1.3.1.dist-info/METADATA +2 -2
- jaclang/vendor/pygls-1.3.1.dist-info/RECORD +45 -24
- jaclang/vendor/pygls-1.3.1.dist-info/WHEEL +1 -1
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/METADATA +4 -4
- jaclang-0.8.0.dist-info/RECORD +552 -0
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/WHEEL +1 -1
- jaclang/compiler/.gitignore +0 -1
- jaclang/compiler/compile.py +0 -119
- jaclang/compiler/passes/main/access_modifier_pass.py +0 -130
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +0 -656
- jaclang/compiler/passes/main/py_collect_dep_pass.py +0 -78
- jaclang/compiler/passes/main/pyout_pass.py +0 -86
- jaclang/compiler/passes/main/registry_pass.py +0 -156
- jaclang/compiler/passes/main/schedules.py +0 -47
- jaclang/compiler/passes/main/sub_node_tab_pass.py +0 -36
- jaclang/compiler/passes/main/tests/fixtures/registry.jac +0 -36
- jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py +0 -114
- jaclang/compiler/passes/main/tests/test_registry_pass.py +0 -31
- jaclang/compiler/passes/main/tests/test_type_check_pass.py +0 -91
- jaclang/compiler/passes/main/tests/test_typeinfo_pass.py +0 -29
- jaclang/compiler/passes/main/type_check_pass.py +0 -128
- jaclang/compiler/passes/tool/schedules.py +0 -18
- jaclang/compiler/passes/tool/tests/fixtures/genai/essay_review.jac +0 -36
- jaclang/compiler/passes/tool/tests/fixtures/genai/expert_answer.jac +0 -17
- jaclang/compiler/passes/tool/tests/fixtures/genai/joke_gen.jac +0 -32
- jaclang/compiler/passes/tool/tests/fixtures/genai/odd_word_out.jac +0 -27
- jaclang/compiler/passes/tool/tests/fixtures/genai/personality_finder.jac +0 -35
- jaclang/compiler/passes/tool/tests/fixtures/genai/text_to_type.jac +0 -25
- jaclang/compiler/passes/tool/tests/fixtures/genai/translator.jac +0 -13
- jaclang/compiler/passes/tool/tests/fixtures/genai/wikipedia.jac +0 -63
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/architype_test.jac +0 -13
- jaclang/compiler/passes/utils/mypy_ast_build.py +0 -940
- jaclang/compiler/py_info.py +0 -22
- jaclang/compiler/semtable.py +0 -159
- jaclang/compiler/symtable.py +0 -297
- jaclang/langserve/utils.py +0 -458
- jaclang/plugin/__init__.py +0 -7
- jaclang/plugin/builtin.py +0 -57
- jaclang/plugin/default.py +0 -1443
- jaclang/plugin/feature.py +0 -574
- jaclang/plugin/plugin.md +0 -471
- jaclang/plugin/spec.py +0 -536
- jaclang/plugin/tests/fixtures/impl_match_impl.jac +0 -3
- jaclang/plugin/tests/test_features.py +0 -56
- jaclang/runtimelib/context.py +0 -191
- jaclang/tests/fixtures/create_dynamic_architype.jac +0 -35
- jaclang/tests/fixtures/dynamic_architype.jac +0 -34
- jaclang/tests/fixtures/impl_grab.impl.jac +0 -5
- jaclang/tests/fixtures/mtest.impl.jac +0 -6
- jaclang/tests/fixtures/registry.jac +0 -58
- jaclang/tests/fixtures/semstr.jac +0 -30
- jaclang/tests/main.jac +0 -2
- jaclang/utils/profiler.py +0 -62
- jaclang/vendor/attrs-23.2.0.dist-info/RECORD +0 -35
- jaclang/vendor/cattrs-23.2.3.dist-info/METADATA +0 -221
- jaclang/vendor/cattrs-23.2.3.dist-info/RECORD +0 -48
- jaclang/vendor/lark-1.1.9.dist-info/RECORD +0 -46
- jaclang/vendor/lark-1.1.9.dist-info/WHEEL +0 -5
- jaclang/vendor/mypy/__init__.py +0 -1
- jaclang/vendor/mypy/__main__.py +0 -37
- jaclang/vendor/mypy/api.py +0 -94
- jaclang/vendor/mypy/applytype.py +0 -172
- jaclang/vendor/mypy/argmap.py +0 -268
- jaclang/vendor/mypy/binder.py +0 -538
- jaclang/vendor/mypy/bogus_type.py +0 -27
- jaclang/vendor/mypy/build.py +0 -3562
- jaclang/vendor/mypy/checker.py +0 -8445
- jaclang/vendor/mypy/checkexpr.py +0 -6623
- jaclang/vendor/mypy/checkmember.py +0 -1363
- jaclang/vendor/mypy/checkpattern.py +0 -801
- jaclang/vendor/mypy/checkstrformat.py +0 -1109
- jaclang/vendor/mypy/config_parser.py +0 -670
- jaclang/vendor/mypy/constant_fold.py +0 -187
- jaclang/vendor/mypy/constraints.py +0 -1636
- jaclang/vendor/mypy/copytype.py +0 -133
- jaclang/vendor/mypy/defaults.py +0 -46
- jaclang/vendor/mypy/dmypy/__main__.py +0 -6
- jaclang/vendor/mypy/dmypy/client.py +0 -749
- jaclang/vendor/mypy/dmypy_os.py +0 -42
- jaclang/vendor/mypy/dmypy_server.py +0 -1107
- jaclang/vendor/mypy/dmypy_util.py +0 -117
- jaclang/vendor/mypy/erasetype.py +0 -278
- jaclang/vendor/mypy/errorcodes.py +0 -291
- jaclang/vendor/mypy/errors.py +0 -1280
- jaclang/vendor/mypy/evalexpr.py +0 -205
- jaclang/vendor/mypy/expandtype.py +0 -524
- jaclang/vendor/mypy/exprtotype.py +0 -209
- jaclang/vendor/mypy/fastparse.py +0 -2147
- jaclang/vendor/mypy/find_sources.py +0 -243
- jaclang/vendor/mypy/fixup.py +0 -428
- jaclang/vendor/mypy/freetree.py +0 -23
- jaclang/vendor/mypy/fscache.py +0 -309
- jaclang/vendor/mypy/fswatcher.py +0 -106
- jaclang/vendor/mypy/gclogger.py +0 -47
- jaclang/vendor/mypy/git.py +0 -34
- jaclang/vendor/mypy/graph_utils.py +0 -112
- jaclang/vendor/mypy/indirection.py +0 -121
- jaclang/vendor/mypy/infer.py +0 -75
- jaclang/vendor/mypy/inspections.py +0 -627
- jaclang/vendor/mypy/ipc.py +0 -310
- jaclang/vendor/mypy/join.py +0 -871
- jaclang/vendor/mypy/literals.py +0 -306
- jaclang/vendor/mypy/lookup.py +0 -61
- jaclang/vendor/mypy/main.py +0 -1574
- jaclang/vendor/mypy/maptype.py +0 -106
- jaclang/vendor/mypy/meet.py +0 -1140
- jaclang/vendor/mypy/memprofile.py +0 -121
- jaclang/vendor/mypy/message_registry.py +0 -329
- jaclang/vendor/mypy/messages.py +0 -3186
- jaclang/vendor/mypy/metastore.py +0 -225
- jaclang/vendor/mypy/mixedtraverser.py +0 -112
- jaclang/vendor/mypy/modulefinder.py +0 -875
- jaclang/vendor/mypy/moduleinspect.py +0 -184
- jaclang/vendor/mypy/mro.py +0 -62
- jaclang/vendor/mypy/nodes.py +0 -4115
- jaclang/vendor/mypy/operators.py +0 -126
- jaclang/vendor/mypy/options.py +0 -556
- jaclang/vendor/mypy/parse.py +0 -30
- jaclang/vendor/mypy/partially_defined.py +0 -675
- jaclang/vendor/mypy/patterns.py +0 -150
- jaclang/vendor/mypy/plugin.py +0 -901
- jaclang/vendor/mypy/plugins/attrs.py +0 -1166
- jaclang/vendor/mypy/plugins/common.py +0 -440
- jaclang/vendor/mypy/plugins/ctypes.py +0 -245
- jaclang/vendor/mypy/plugins/dataclasses.py +0 -1108
- jaclang/vendor/mypy/plugins/default.py +0 -531
- jaclang/vendor/mypy/plugins/enums.py +0 -259
- jaclang/vendor/mypy/plugins/functools.py +0 -104
- jaclang/vendor/mypy/plugins/proper_plugin.py +0 -175
- jaclang/vendor/mypy/plugins/singledispatch.py +0 -224
- jaclang/vendor/mypy/py.typed +0 -1
- jaclang/vendor/mypy/pyinfo.py +0 -78
- jaclang/vendor/mypy/reachability.py +0 -362
- jaclang/vendor/mypy/refinfo.py +0 -92
- jaclang/vendor/mypy/renaming.py +0 -568
- jaclang/vendor/mypy/report.py +0 -924
- jaclang/vendor/mypy/scope.py +0 -125
- jaclang/vendor/mypy/semanal.py +0 -7187
- jaclang/vendor/mypy/semanal_classprop.py +0 -187
- jaclang/vendor/mypy/semanal_enum.py +0 -253
- jaclang/vendor/mypy/semanal_infer.py +0 -128
- jaclang/vendor/mypy/semanal_main.py +0 -511
- jaclang/vendor/mypy/semanal_namedtuple.py +0 -670
- jaclang/vendor/mypy/semanal_newtype.py +0 -273
- jaclang/vendor/mypy/semanal_pass1.py +0 -156
- jaclang/vendor/mypy/semanal_shared.py +0 -490
- jaclang/vendor/mypy/semanal_typeargs.py +0 -265
- jaclang/vendor/mypy/semanal_typeddict.py +0 -575
- jaclang/vendor/mypy/server/astdiff.py +0 -518
- jaclang/vendor/mypy/server/astmerge.py +0 -562
- jaclang/vendor/mypy/server/aststrip.py +0 -281
- jaclang/vendor/mypy/server/deps.py +0 -1137
- jaclang/vendor/mypy/server/mergecheck.py +0 -83
- jaclang/vendor/mypy/server/objgraph.py +0 -101
- jaclang/vendor/mypy/server/subexpr.py +0 -198
- jaclang/vendor/mypy/server/target.py +0 -11
- jaclang/vendor/mypy/server/trigger.py +0 -26
- jaclang/vendor/mypy/server/update.py +0 -1339
- jaclang/vendor/mypy/sharedparse.py +0 -112
- jaclang/vendor/mypy/solve.py +0 -562
- jaclang/vendor/mypy/split_namespace.py +0 -35
- jaclang/vendor/mypy/state.py +0 -28
- jaclang/vendor/mypy/stats.py +0 -489
- jaclang/vendor/mypy/strconv.py +0 -641
- jaclang/vendor/mypy/stubdoc.py +0 -491
- jaclang/vendor/mypy/stubgen.py +0 -1886
- jaclang/vendor/mypy/stubgenc.py +0 -993
- jaclang/vendor/mypy/stubinfo.py +0 -173
- jaclang/vendor/mypy/stubtest.py +0 -2079
- jaclang/vendor/mypy/stubutil.py +0 -834
- jaclang/vendor/mypy/subtypes.py +0 -1980
- jaclang/vendor/mypy/suggestions.py +0 -1046
- jaclang/vendor/mypy/test/config.py +0 -28
- jaclang/vendor/mypy/test/data.py +0 -821
- jaclang/vendor/mypy/test/helpers.py +0 -476
- jaclang/vendor/mypy/test/meta/_pytest.py +0 -72
- jaclang/vendor/mypy/test/meta/test_diff_helper.py +0 -47
- jaclang/vendor/mypy/test/meta/test_parse_data.py +0 -73
- jaclang/vendor/mypy/test/meta/test_update_data.py +0 -135
- jaclang/vendor/mypy/test/test_find_sources.py +0 -376
- jaclang/vendor/mypy/test/test_ref_info.py +0 -45
- jaclang/vendor/mypy/test/testapi.py +0 -45
- jaclang/vendor/mypy/test/testargs.py +0 -77
- jaclang/vendor/mypy/test/testcheck.py +0 -322
- jaclang/vendor/mypy/test/testcmdline.py +0 -152
- jaclang/vendor/mypy/test/testconstraints.py +0 -134
- jaclang/vendor/mypy/test/testdaemon.py +0 -132
- jaclang/vendor/mypy/test/testdeps.py +0 -77
- jaclang/vendor/mypy/test/testdiff.py +0 -67
- jaclang/vendor/mypy/test/testerrorstream.py +0 -46
- jaclang/vendor/mypy/test/testfinegrained.py +0 -438
- jaclang/vendor/mypy/test/testfinegrainedcache.py +0 -18
- jaclang/vendor/mypy/test/testformatter.py +0 -85
- jaclang/vendor/mypy/test/testfscache.py +0 -101
- jaclang/vendor/mypy/test/testgraph.py +0 -83
- jaclang/vendor/mypy/test/testinfer.py +0 -373
- jaclang/vendor/mypy/test/testipc.py +0 -119
- jaclang/vendor/mypy/test/testmerge.py +0 -238
- jaclang/vendor/mypy/test/testmodulefinder.py +0 -278
- jaclang/vendor/mypy/test/testmypyc.py +0 -14
- jaclang/vendor/mypy/test/testparse.py +0 -107
- jaclang/vendor/mypy/test/testpep561.py +0 -211
- jaclang/vendor/mypy/test/testpythoneval.py +0 -117
- jaclang/vendor/mypy/test/testreports.py +0 -55
- jaclang/vendor/mypy/test/testsemanal.py +0 -209
- jaclang/vendor/mypy/test/testsolve.py +0 -285
- jaclang/vendor/mypy/test/teststubgen.py +0 -1412
- jaclang/vendor/mypy/test/teststubinfo.py +0 -12
- jaclang/vendor/mypy/test/teststubtest.py +0 -2492
- jaclang/vendor/mypy/test/testsubtypes.py +0 -303
- jaclang/vendor/mypy/test/testtransform.py +0 -64
- jaclang/vendor/mypy/test/testtypegen.py +0 -83
- jaclang/vendor/mypy/test/testtypes.py +0 -1551
- jaclang/vendor/mypy/test/testutil.py +0 -111
- jaclang/vendor/mypy/test/typefixture.py +0 -415
- jaclang/vendor/mypy/test/update_data.py +0 -87
- jaclang/vendor/mypy/test/visitors.py +0 -63
- jaclang/vendor/mypy/traverser.py +0 -961
- jaclang/vendor/mypy/treetransform.py +0 -800
- jaclang/vendor/mypy/tvar_scope.py +0 -169
- jaclang/vendor/mypy/type_visitor.py +0 -564
- jaclang/vendor/mypy/typeanal.py +0 -2596
- jaclang/vendor/mypy/typeops.py +0 -1082
- jaclang/vendor/mypy/types.py +0 -3708
- jaclang/vendor/mypy/types_utils.py +0 -166
- jaclang/vendor/mypy/typeshed/LICENSE +0 -237
- jaclang/vendor/mypy/typeshed/stdlib/VERSIONS +0 -309
- jaclang/vendor/mypy/typeshed/stdlib/__future__.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/__main__.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/_ast.pyi +0 -591
- jaclang/vendor/mypy/typeshed/stdlib/_bisect.pyi +0 -84
- jaclang/vendor/mypy/typeshed/stdlib/_bootlocale.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/_codecs.pyi +0 -133
- jaclang/vendor/mypy/typeshed/stdlib/_collections_abc.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/_compat_pickle.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/_compression.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/_csv.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/_ctypes.pyi +0 -207
- jaclang/vendor/mypy/typeshed/stdlib/_curses.pyi +0 -566
- jaclang/vendor/mypy/typeshed/stdlib/_decimal.pyi +0 -281
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_thread.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_dummy_threading.pyi +0 -164
- jaclang/vendor/mypy/typeshed/stdlib/_heapq.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/_imp.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/_json.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/_locale.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/_lsprof.pyi +0 -35
- jaclang/vendor/mypy/typeshed/stdlib/_markupbase.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_msi.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/_operator.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/_osx_support.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/_posixsubprocess.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/_py_abc.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/_pydecimal.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/_random.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/_sitebuiltins.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/_socket.pyi +0 -803
- jaclang/vendor/mypy/typeshed/stdlib/_stat.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/_thread.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/_threading_local.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_tkinter.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/_tracemalloc.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/__init__.pyi +0 -347
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/_typeshed/xml.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/_warnings.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/_weakref.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/_weakrefset.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/_winapi.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/abc.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/aifc.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/antigravity.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/argparse.pyi +0 -595
- jaclang/vendor/mypy/typeshed/stdlib/array.pyi +0 -92
- jaclang/vendor/mypy/typeshed/stdlib/ast.pyi +0 -277
- jaclang/vendor/mypy/typeshed/stdlib/asynchat.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/__init__.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_events.pyi +0 -440
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_futures.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/constants.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/coroutines.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/events.pyi +0 -580
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/exceptions.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/futures.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/locks.pyi +0 -121
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/log.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/mixins.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +0 -64
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/protocols.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/queues.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/runners.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/selector_events.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/sslproto.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/staggered.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/streams.pyi +0 -153
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/subprocess.pyi +0 -229
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/tasks.pyi +0 -497
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/threads.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/timeouts.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/transports.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/trsock.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/unix_events.pyi +0 -196
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_events.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/asyncore.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/atexit.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/audioop.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/base64.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/bdb.pyi +0 -102
- jaclang/vendor/mypy/typeshed/stdlib/binascii.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/binhex.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/bisect.pyi +0 -4
- jaclang/vendor/mypy/typeshed/stdlib/builtins.pyi +0 -1936
- jaclang/vendor/mypy/typeshed/stdlib/bz2.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/cProfile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/calendar.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/cgi.pyi +0 -118
- jaclang/vendor/mypy/typeshed/stdlib/cgitb.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/chunk.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/cmath.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/cmd.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/code.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/codecs.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/codeop.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/collections/__init__.pyi +0 -485
- jaclang/vendor/mypy/typeshed/stdlib/collections/abc.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/colorsys.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/compileall.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +0 -126
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/process.pyi +0 -233
- jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/configparser.pyi +0 -313
- jaclang/vendor/mypy/typeshed/stdlib/contextlib.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/contextvars.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/copy.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/copyreg.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/crypt.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/csv.pyi +0 -147
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/__init__.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/_endian.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/util.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/ctypes/wintypes.pyi +0 -298
- jaclang/vendor/mypy/typeshed/stdlib/curses/__init__.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/ascii.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/curses/has_key.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/curses/panel.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/curses/textpad.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/dataclasses.pyi +0 -315
- jaclang/vendor/mypy/typeshed/stdlib/datetime.pyi +0 -295
- jaclang/vendor/mypy/typeshed/stdlib/dbm/__init__.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/dbm/dumb.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/dbm/gnu.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/dbm/ndbm.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/decimal.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/difflib.pyi +0 -140
- jaclang/vendor/mypy/typeshed/stdlib/dis.pyi +0 -144
- jaclang/vendor/mypy/typeshed/stdlib/distutils/__init__.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/distutils/archive_util.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/ccompiler.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cmd.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +0 -45
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_py.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/check.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/clean.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/config.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_data.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/register.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/sdist.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/distutils/command/upload.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/config.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/distutils/core.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/distutils/debug.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dep_util.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dir_util.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/distutils/dist.pyi +0 -146
- jaclang/vendor/mypy/typeshed/stdlib/distutils/errors.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/distutils/extension.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/distutils/file_util.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/distutils/filelist.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/distutils/log.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/spawn.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/distutils/sysconfig.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/distutils/text_file.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +0 -3
- jaclang/vendor/mypy/typeshed/stdlib/distutils/util.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/distutils/version.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/doctest.pyi +0 -248
- jaclang/vendor/mypy/typeshed/stdlib/dummy_threading.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/email/__init__.pyi +0 -29
- jaclang/vendor/mypy/typeshed/stdlib/email/_header_value_parser.pyi +0 -392
- jaclang/vendor/mypy/typeshed/stdlib/email/_policybase.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/email/base64mime.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/email/charset.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/email/contentmanager.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/email/encoders.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/errors.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/email/feedparser.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/email/generator.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/email/header.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/email/headerregistry.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/email/iterators.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/email/message.pyi +0 -165
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/application.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/audio.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/base.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/image.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/message.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/multipart.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +0 -5
- jaclang/vendor/mypy/typeshed/stdlib/email/mime/text.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/email/parser.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/email/policy.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/email/quoprimime.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/email/utils.pyi +0 -70
- jaclang/vendor/mypy/typeshed/stdlib/encodings/__init__.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/ensurepip/__init__.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/enum.pyi +0 -320
- jaclang/vendor/mypy/typeshed/stdlib/errno.pyi +0 -222
- jaclang/vendor/mypy/typeshed/stdlib/faulthandler.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/fcntl.pyi +0 -127
- jaclang/vendor/mypy/typeshed/stdlib/filecmp.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/fileinput.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/fnmatch.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/formatter.pyi +0 -88
- jaclang/vendor/mypy/typeshed/stdlib/fractions.pyi +0 -150
- jaclang/vendor/mypy/typeshed/stdlib/ftplib.pyi +0 -178
- jaclang/vendor/mypy/typeshed/stdlib/functools.pyi +0 -213
- jaclang/vendor/mypy/typeshed/stdlib/gc.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/genericpath.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/getopt.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/getpass.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/gettext.pyi +0 -169
- jaclang/vendor/mypy/typeshed/stdlib/glob.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/graphlib.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/grp.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/gzip.pyi +0 -160
- jaclang/vendor/mypy/typeshed/stdlib/hashlib.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/heapq.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/hmac.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stdlib/html/__init__.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/entities.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/html/parser.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/http/__init__.pyi +0 -105
- jaclang/vendor/mypy/typeshed/stdlib/http/client.pyi +0 -259
- jaclang/vendor/mypy/typeshed/stdlib/http/cookiejar.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/http/cookies.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/http/server.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/imaplib.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/imghdr.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/imp.pyi +0 -62
- jaclang/vendor/mypy/typeshed/stdlib/importlib/__init__.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/importlib/_abc.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/importlib/abc.pyi +0 -172
- jaclang/vendor/mypy/typeshed/stdlib/importlib/machinery.pyi +0 -179
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +0 -285
- jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/importlib/readers.pyi +0 -68
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/abc.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/readers.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/simple.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/importlib/simple.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/importlib/util.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/inspect.pyi +0 -632
- jaclang/vendor/mypy/typeshed/stdlib/io.pyi +0 -238
- jaclang/vendor/mypy/typeshed/stdlib/ipaddress.pyi +0 -208
- jaclang/vendor/mypy/typeshed/stdlib/itertools.pyi +0 -273
- jaclang/vendor/mypy/typeshed/stdlib/json/__init__.pyi +0 -61
- jaclang/vendor/mypy/typeshed/stdlib/json/decoder.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/json/encoder.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/json/tool.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/keyword.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +0 -6
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +0 -17
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +0 -12
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/main.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +0 -96
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pygram.pyi +0 -114
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pytree.pyi +0 -117
- jaclang/vendor/mypy/typeshed/stdlib/lib2to3/refactor.pyi +0 -82
- jaclang/vendor/mypy/typeshed/stdlib/linecache.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/locale.pyi +0 -152
- jaclang/vendor/mypy/typeshed/stdlib/logging/__init__.pyi +0 -658
- jaclang/vendor/mypy/typeshed/stdlib/logging/config.pyi +0 -134
- jaclang/vendor/mypy/typeshed/stdlib/logging/handlers.pyi +0 -275
- jaclang/vendor/mypy/typeshed/stdlib/lzma.pyi +0 -197
- jaclang/vendor/mypy/typeshed/stdlib/mailbox.pyi +0 -256
- jaclang/vendor/mypy/typeshed/stdlib/mailcap.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/marshal.pyi +0 -33
- jaclang/vendor/mypy/typeshed/stdlib/math.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/mimetypes.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/mmap.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/modulefinder.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/msilib/__init__.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/msilib/schema.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/msilib/sequence.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/msilib/text.pyi +0 -7
- jaclang/vendor/mypy/typeshed/stdlib/msvcrt.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/connection.pyi +0 -75
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/context.pyi +0 -189
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +0 -77
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/heap.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/managers.pyi +0 -212
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/pool.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/process.pyi +0 -39
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/queues.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +0 -90
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +0 -18
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +0 -40
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +0 -107
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/util.pyi +0 -98
- jaclang/vendor/mypy/typeshed/stdlib/netrc.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/nis.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/nntplib.pyi +0 -125
- jaclang/vendor/mypy/typeshed/stdlib/nt.pyi +0 -111
- jaclang/vendor/mypy/typeshed/stdlib/ntpath.pyi +0 -119
- jaclang/vendor/mypy/typeshed/stdlib/nturl2path.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/numbers.pyi +0 -209
- jaclang/vendor/mypy/typeshed/stdlib/opcode.pyi +0 -59
- jaclang/vendor/mypy/typeshed/stdlib/operator.pyi +0 -110
- jaclang/vendor/mypy/typeshed/stdlib/optparse.pyi +0 -255
- jaclang/vendor/mypy/typeshed/stdlib/os/__init__.pyi +0 -1157
- jaclang/vendor/mypy/typeshed/stdlib/os/path.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/ossaudiodev.pyi +0 -131
- jaclang/vendor/mypy/typeshed/stdlib/parser.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/pathlib.pyi +0 -232
- jaclang/vendor/mypy/typeshed/stdlib/pdb.pyi +0 -181
- jaclang/vendor/mypy/typeshed/stdlib/pickle.pyi +0 -271
- jaclang/vendor/mypy/typeshed/stdlib/pickletools.pyi +0 -167
- jaclang/vendor/mypy/typeshed/stdlib/pipes.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/pkgutil.pyi +0 -53
- jaclang/vendor/mypy/typeshed/stdlib/platform.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/plistlib.pyi +0 -113
- jaclang/vendor/mypy/typeshed/stdlib/poplib.pyi +0 -71
- jaclang/vendor/mypy/typeshed/stdlib/posix.pyi +0 -361
- jaclang/vendor/mypy/typeshed/stdlib/posixpath.pyi +0 -161
- jaclang/vendor/mypy/typeshed/stdlib/pprint.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/profile.pyi +0 -31
- jaclang/vendor/mypy/typeshed/stdlib/pstats.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/pty.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/pwd.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/py_compile.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/pyclbr.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/pydoc.pyi +0 -261
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/topics.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/__init__.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/errors.pyi +0 -49
- jaclang/vendor/mypy/typeshed/stdlib/pyexpat/model.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/queue.pyi +0 -66
- jaclang/vendor/mypy/typeshed/stdlib/quopri.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/random.pyi +0 -138
- jaclang/vendor/mypy/typeshed/stdlib/re.pyi +0 -290
- jaclang/vendor/mypy/typeshed/stdlib/readline.pyi +0 -36
- jaclang/vendor/mypy/typeshed/stdlib/reprlib.pyi +0 -65
- jaclang/vendor/mypy/typeshed/stdlib/resource.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/rlcompleter.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/runpy.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/sched.pyi +0 -42
- jaclang/vendor/mypy/typeshed/stdlib/secrets.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/select.pyi +0 -155
- jaclang/vendor/mypy/typeshed/stdlib/selectors.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/shelve.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/shlex.pyi +0 -63
- jaclang/vendor/mypy/typeshed/stdlib/shutil.pyi +0 -185
- jaclang/vendor/mypy/typeshed/stdlib/signal.pyi +0 -188
- jaclang/vendor/mypy/typeshed/stdlib/site.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/smtpd.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/smtplib.pyi +0 -204
- jaclang/vendor/mypy/typeshed/stdlib/sndhdr.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/socket.pyi +0 -825
- jaclang/vendor/mypy/typeshed/stdlib/socketserver.pyi +0 -168
- jaclang/vendor/mypy/typeshed/stdlib/spwd.pyi +0 -41
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +0 -551
- jaclang/vendor/mypy/typeshed/stdlib/sre_compile.pyi +0 -11
- jaclang/vendor/mypy/typeshed/stdlib/sre_constants.pyi +0 -130
- jaclang/vendor/mypy/typeshed/stdlib/sre_parse.pyi +0 -104
- jaclang/vendor/mypy/typeshed/stdlib/ssl.pyi +0 -537
- jaclang/vendor/mypy/typeshed/stdlib/stat.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/statistics.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/string.pyi +0 -83
- jaclang/vendor/mypy/typeshed/stdlib/stringprep.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/struct.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/subprocess.pyi +0 -2615
- jaclang/vendor/mypy/typeshed/stdlib/sunau.pyi +0 -86
- jaclang/vendor/mypy/typeshed/stdlib/symbol.pyi +0 -93
- jaclang/vendor/mypy/typeshed/stdlib/symtable.pyi +0 -58
- jaclang/vendor/mypy/typeshed/stdlib/sys/__init__.pyi +0 -373
- jaclang/vendor/mypy/typeshed/stdlib/sys/_monitoring.pyi +0 -52
- jaclang/vendor/mypy/typeshed/stdlib/sysconfig.pyi +0 -48
- jaclang/vendor/mypy/typeshed/stdlib/syslog.pyi +0 -46
- jaclang/vendor/mypy/typeshed/stdlib/tabnanny.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tarfile.pyi +0 -441
- jaclang/vendor/mypy/typeshed/stdlib/telnetlib.pyi +0 -122
- jaclang/vendor/mypy/typeshed/stdlib/tempfile.pyi +0 -477
- jaclang/vendor/mypy/typeshed/stdlib/termios.pyi +0 -267
- jaclang/vendor/mypy/typeshed/stdlib/textwrap.pyi +0 -103
- jaclang/vendor/mypy/typeshed/stdlib/this.pyi +0 -2
- jaclang/vendor/mypy/typeshed/stdlib/threading.pyi +0 -187
- jaclang/vendor/mypy/typeshed/stdlib/time.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/timeit.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/__init__.pyi +0 -3654
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/commondialog.pyi +0 -14
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/constants.pyi +0 -80
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dialog.pyi +0 -16
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/dnd.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/filedialog.pyi +0 -151
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/font.pyi +0 -116
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/messagebox.pyi +0 -44
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +0 -9
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +0 -54
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/tix.pyi +0 -299
- jaclang/vendor/mypy/typeshed/stdlib/tkinter/ttk.pyi +0 -1204
- jaclang/vendor/mypy/typeshed/stdlib/token.pyi +0 -159
- jaclang/vendor/mypy/typeshed/stdlib/tokenize.pyi +0 -177
- jaclang/vendor/mypy/typeshed/stdlib/tomllib.pyi +0 -10
- jaclang/vendor/mypy/typeshed/stdlib/trace.pyi +0 -79
- jaclang/vendor/mypy/typeshed/stdlib/traceback.pyi +0 -262
- jaclang/vendor/mypy/typeshed/stdlib/tracemalloc.pyi +0 -124
- jaclang/vendor/mypy/typeshed/stdlib/tty.pyi +0 -30
- jaclang/vendor/mypy/typeshed/stdlib/turtle.pyi +0 -713
- jaclang/vendor/mypy/typeshed/stdlib/types.pyi +0 -614
- jaclang/vendor/mypy/typeshed/stdlib/typing.pyi +0 -976
- jaclang/vendor/mypy/typeshed/stdlib/typing_extensions.pyi +0 -509
- jaclang/vendor/mypy/typeshed/stdlib/unicodedata.pyi +0 -73
- jaclang/vendor/mypy/typeshed/stdlib/unittest/__init__.pyi +0 -67
- jaclang/vendor/mypy/typeshed/stdlib/unittest/_log.pyi +0 -27
- jaclang/vendor/mypy/typeshed/stdlib/unittest/async_case.pyi +0 -21
- jaclang/vendor/mypy/typeshed/stdlib/unittest/case.pyi +0 -342
- jaclang/vendor/mypy/typeshed/stdlib/unittest/loader.pyi +0 -51
- jaclang/vendor/mypy/typeshed/stdlib/unittest/main.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/unittest/mock.pyi +0 -430
- jaclang/vendor/mypy/typeshed/stdlib/unittest/result.pyi +0 -47
- jaclang/vendor/mypy/typeshed/stdlib/unittest/runner.pyi +0 -72
- jaclang/vendor/mypy/typeshed/stdlib/unittest/signals.pyi +0 -15
- jaclang/vendor/mypy/typeshed/stdlib/unittest/suite.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/unittest/util.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/urllib/error.pyi +0 -23
- jaclang/vendor/mypy/typeshed/stdlib/urllib/parse.pyi +0 -210
- jaclang/vendor/mypy/typeshed/stdlib/urllib/request.pyi +0 -400
- jaclang/vendor/mypy/typeshed/stdlib/urllib/response.pyi +0 -43
- jaclang/vendor/mypy/typeshed/stdlib/urllib/robotparser.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/uu.pyi +0 -13
- jaclang/vendor/mypy/typeshed/stdlib/uuid.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/warnings.pyi +0 -112
- jaclang/vendor/mypy/typeshed/stdlib/wave.pyi +0 -85
- jaclang/vendor/mypy/typeshed/stdlib/weakref.pyi +0 -149
- jaclang/vendor/mypy/typeshed/stdlib/webbrowser.pyi +0 -74
- jaclang/vendor/mypy/typeshed/stdlib/winreg.pyi +0 -132
- jaclang/vendor/mypy/typeshed/stdlib/winsound.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/handlers.pyi +0 -91
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/headers.pyi +0 -26
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +0 -37
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/types.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/util.pyi +0 -24
- jaclang/vendor/mypy/typeshed/stdlib/wsgiref/validate.pyi +0 -50
- jaclang/vendor/mypy/typeshed/stdlib/xdrlib.pyi +0 -57
- jaclang/vendor/mypy/typeshed/stdlib/xml/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/__init__.pyi +0 -69
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/domreg.pyi +0 -8
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +0 -100
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minidom.pyi +0 -404
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +0 -94
- jaclang/vendor/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +0 -108
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +0 -28
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +0 -34
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +0 -327
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +0 -1
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/__init__.pyi +0 -25
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +0 -19
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/handler.pyi +0 -55
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +0 -60
- jaclang/vendor/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +0 -87
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/client.pyi +0 -296
- jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/server.pyi +0 -143
- jaclang/vendor/mypy/typeshed/stdlib/xxlimited.pyi +0 -22
- jaclang/vendor/mypy/typeshed/stdlib/zipapp.pyi +0 -20
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/__init__.pyi +0 -306
- jaclang/vendor/mypy/typeshed/stdlib/zipfile/_path.pyi +0 -95
- jaclang/vendor/mypy/typeshed/stdlib/zipimport.pyi +0 -32
- jaclang/vendor/mypy/typeshed/stdlib/zlib.pyi +0 -56
- jaclang/vendor/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +0 -38
- jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +0 -218
- jaclang/vendor/mypy/typestate.py +0 -323
- jaclang/vendor/mypy/typetraverser.py +0 -148
- jaclang/vendor/mypy/typevars.py +0 -93
- jaclang/vendor/mypy/typevartuples.py +0 -32
- jaclang/vendor/mypy/util.py +0 -869
- jaclang/vendor/mypy/version.py +0 -1
- jaclang/vendor/mypy/visitor.py +0 -621
- jaclang/vendor/mypy/xml/mypy-html.css +0 -104
- jaclang/vendor/mypy/xml/mypy-html.xslt +0 -81
- jaclang/vendor/mypy/xml/mypy-txt.xslt +0 -100
- jaclang/vendor/mypy/xml/mypy.xsd +0 -50
- jaclang/vendor/mypy-1.10.0.dist-info/LICENSE +0 -229
- jaclang/vendor/mypy-1.10.0.dist-info/METADATA +0 -48
- jaclang/vendor/mypy-1.10.0.dist-info/RECORD +0 -1241
- jaclang/vendor/mypy-1.10.0.dist-info/WHEEL +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/entry_points.txt +0 -6
- jaclang/vendor/mypy-1.10.0.dist-info/top_level.txt +0 -3
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/LICENSE +0 -27
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/METADATA +0 -29
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/RECORD +0 -6
- jaclang/vendor/mypy_extensions-1.0.0.dist-info/top_level.txt +0 -1
- jaclang/vendor/mypy_extensions.py +0 -213
- jaclang/vendor/mypyc/README.md +0 -133
- jaclang/vendor/mypyc/__init__.py +0 -0
- jaclang/vendor/mypyc/__main__.py +0 -57
- jaclang/vendor/mypyc/analysis/__init__.py +0 -0
- jaclang/vendor/mypyc/analysis/attrdefined.py +0 -436
- jaclang/vendor/mypyc/analysis/blockfreq.py +0 -32
- jaclang/vendor/mypyc/analysis/dataflow.py +0 -628
- jaclang/vendor/mypyc/analysis/ircheck.py +0 -433
- jaclang/vendor/mypyc/analysis/selfleaks.py +0 -211
- jaclang/vendor/mypyc/build.py +0 -616
- jaclang/vendor/mypyc/codegen/__init__.py +0 -0
- jaclang/vendor/mypyc/codegen/cstring.py +0 -54
- jaclang/vendor/mypyc/codegen/emit.py +0 -1193
- jaclang/vendor/mypyc/codegen/emitclass.py +0 -1060
- jaclang/vendor/mypyc/codegen/emitfunc.py +0 -852
- jaclang/vendor/mypyc/codegen/emitmodule.py +0 -1136
- jaclang/vendor/mypyc/codegen/emitwrapper.py +0 -979
- jaclang/vendor/mypyc/codegen/literals.py +0 -302
- jaclang/vendor/mypyc/common.py +0 -136
- jaclang/vendor/mypyc/crash.py +0 -31
- jaclang/vendor/mypyc/doc/Makefile +0 -20
- jaclang/vendor/mypyc/doc/bool_operations.rst +0 -27
- jaclang/vendor/mypyc/doc/compilation_units.rst +0 -20
- jaclang/vendor/mypyc/doc/conf.py +0 -59
- jaclang/vendor/mypyc/doc/cpython-timings.md +0 -25
- jaclang/vendor/mypyc/doc/dev-intro.md +0 -548
- jaclang/vendor/mypyc/doc/dict_operations.rst +0 -59
- jaclang/vendor/mypyc/doc/differences_from_python.rst +0 -332
- jaclang/vendor/mypyc/doc/float_operations.rst +0 -50
- jaclang/vendor/mypyc/doc/future.md +0 -42
- jaclang/vendor/mypyc/doc/getting_started.rst +0 -240
- jaclang/vendor/mypyc/doc/index.rst +0 -61
- jaclang/vendor/mypyc/doc/int_operations.rst +0 -162
- jaclang/vendor/mypyc/doc/introduction.rst +0 -150
- jaclang/vendor/mypyc/doc/list_operations.rst +0 -65
- jaclang/vendor/mypyc/doc/make.bat +0 -35
- jaclang/vendor/mypyc/doc/native_classes.rst +0 -206
- jaclang/vendor/mypyc/doc/native_operations.rst +0 -55
- jaclang/vendor/mypyc/doc/performance_tips_and_tricks.rst +0 -244
- jaclang/vendor/mypyc/doc/set_operations.rst +0 -47
- jaclang/vendor/mypyc/doc/str_operations.rst +0 -35
- jaclang/vendor/mypyc/doc/tuple_operations.rst +0 -33
- jaclang/vendor/mypyc/doc/using_type_annotations.rst +0 -398
- jaclang/vendor/mypyc/errors.py +0 -29
- jaclang/vendor/mypyc/external/googletest/LICENSE +0 -28
- jaclang/vendor/mypyc/external/googletest/README.md +0 -280
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-death-test.h +0 -294
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-message.h +0 -250
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h +0 -1444
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +0 -510
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-printers.h +0 -993
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-spi.h +0 -232
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-test-part.h +0 -179
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-typed-test.h +0 -263
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest.h +0 -2236
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_pred_impl.h +0 -358
- jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_prod.h +0 -58
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +0 -69
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest.h +0 -41
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -319
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +0 -206
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-internal.h +0 -1238
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5146
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -286
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +0 -731
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +0 -93
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port.h +0 -2560
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-string.h +0 -167
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +0 -3331
- jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -297
- jaclang/vendor/mypyc/external/googletest/make/Makefile +0 -61
- jaclang/vendor/mypyc/external/googletest/src/gtest-all.cc +0 -48
- jaclang/vendor/mypyc/external/googletest/src/gtest-death-test.cc +0 -1342
- jaclang/vendor/mypyc/external/googletest/src/gtest-filepath.cc +0 -387
- jaclang/vendor/mypyc/external/googletest/src/gtest-internal-inl.h +0 -1183
- jaclang/vendor/mypyc/external/googletest/src/gtest-port.cc +0 -1259
- jaclang/vendor/mypyc/external/googletest/src/gtest-printers.cc +0 -373
- jaclang/vendor/mypyc/external/googletest/src/gtest-test-part.cc +0 -110
- jaclang/vendor/mypyc/external/googletest/src/gtest-typed-test.cc +0 -118
- jaclang/vendor/mypyc/external/googletest/src/gtest.cc +0 -5388
- jaclang/vendor/mypyc/external/googletest/src/gtest_main.cc +0 -38
- jaclang/vendor/mypyc/ir/__init__.py +0 -0
- jaclang/vendor/mypyc/ir/class_ir.py +0 -499
- jaclang/vendor/mypyc/ir/func_ir.py +0 -370
- jaclang/vendor/mypyc/ir/module_ir.py +0 -88
- jaclang/vendor/mypyc/ir/ops.py +0 -1727
- jaclang/vendor/mypyc/ir/pprint.py +0 -516
- jaclang/vendor/mypyc/ir/rtypes.py +0 -1038
- jaclang/vendor/mypyc/irbuild/__init__.py +0 -0
- jaclang/vendor/mypyc/irbuild/ast_helpers.py +0 -123
- jaclang/vendor/mypyc/irbuild/builder.py +0 -1394
- jaclang/vendor/mypyc/irbuild/callable_class.py +0 -173
- jaclang/vendor/mypyc/irbuild/classdef.py +0 -850
- jaclang/vendor/mypyc/irbuild/constant_fold.py +0 -95
- jaclang/vendor/mypyc/irbuild/context.py +0 -186
- jaclang/vendor/mypyc/irbuild/env_class.py +0 -223
- jaclang/vendor/mypyc/irbuild/expression.py +0 -1070
- jaclang/vendor/mypyc/irbuild/for_helpers.py +0 -1075
- jaclang/vendor/mypyc/irbuild/format_str_tokenizer.py +0 -250
- jaclang/vendor/mypyc/irbuild/function.py +0 -1088
- jaclang/vendor/mypyc/irbuild/generator.py +0 -346
- jaclang/vendor/mypyc/irbuild/ll_builder.py +0 -2389
- jaclang/vendor/mypyc/irbuild/main.py +0 -153
- jaclang/vendor/mypyc/irbuild/mapper.py +0 -221
- jaclang/vendor/mypyc/irbuild/match.py +0 -355
- jaclang/vendor/mypyc/irbuild/nonlocalcontrol.py +0 -197
- jaclang/vendor/mypyc/irbuild/prebuildvisitor.py +0 -203
- jaclang/vendor/mypyc/irbuild/prepare.py +0 -609
- jaclang/vendor/mypyc/irbuild/specialize.py +0 -822
- jaclang/vendor/mypyc/irbuild/statement.py +0 -1017
- jaclang/vendor/mypyc/irbuild/targets.py +0 -57
- jaclang/vendor/mypyc/irbuild/util.py +0 -189
- jaclang/vendor/mypyc/irbuild/visitor.py +0 -401
- jaclang/vendor/mypyc/irbuild/vtable.py +0 -82
- jaclang/vendor/mypyc/lib-rt/CPy.h +0 -638
- jaclang/vendor/mypyc/lib-rt/bytes_ops.c +0 -143
- jaclang/vendor/mypyc/lib-rt/dict_ops.c +0 -446
- jaclang/vendor/mypyc/lib-rt/exc_ops.c +0 -259
- jaclang/vendor/mypyc/lib-rt/float_ops.c +0 -192
- jaclang/vendor/mypyc/lib-rt/generic_ops.c +0 -64
- jaclang/vendor/mypyc/lib-rt/getargs.c +0 -450
- jaclang/vendor/mypyc/lib-rt/getargsfast.c +0 -569
- jaclang/vendor/mypyc/lib-rt/init.c +0 -13
- jaclang/vendor/mypyc/lib-rt/int_ops.c +0 -803
- jaclang/vendor/mypyc/lib-rt/list_ops.c +0 -335
- jaclang/vendor/mypyc/lib-rt/misc_ops.c +0 -942
- jaclang/vendor/mypyc/lib-rt/module_shim.tmpl +0 -18
- jaclang/vendor/mypyc/lib-rt/mypyc_util.h +0 -118
- jaclang/vendor/mypyc/lib-rt/pythoncapi_compat.h +0 -497
- jaclang/vendor/mypyc/lib-rt/pythonsupport.h +0 -533
- jaclang/vendor/mypyc/lib-rt/set_ops.c +0 -17
- jaclang/vendor/mypyc/lib-rt/setup.py +0 -70
- jaclang/vendor/mypyc/lib-rt/str_ops.c +0 -241
- jaclang/vendor/mypyc/lib-rt/test_capi.cc +0 -585
- jaclang/vendor/mypyc/lib-rt/tuple_ops.c +0 -61
- jaclang/vendor/mypyc/lower/__init__.py +0 -0
- jaclang/vendor/mypyc/lower/int_ops.py +0 -113
- jaclang/vendor/mypyc/lower/list_ops.py +0 -45
- jaclang/vendor/mypyc/lower/misc_ops.py +0 -12
- jaclang/vendor/mypyc/lower/registry.py +0 -26
- jaclang/vendor/mypyc/namegen.py +0 -115
- jaclang/vendor/mypyc/options.py +0 -32
- jaclang/vendor/mypyc/primitives/__init__.py +0 -0
- jaclang/vendor/mypyc/primitives/bytes_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/dict_ops.py +0 -325
- jaclang/vendor/mypyc/primitives/exc_ops.py +0 -101
- jaclang/vendor/mypyc/primitives/float_ops.py +0 -168
- jaclang/vendor/mypyc/primitives/generic_ops.py +0 -384
- jaclang/vendor/mypyc/primitives/int_ops.py +0 -303
- jaclang/vendor/mypyc/primitives/list_ops.py +0 -310
- jaclang/vendor/mypyc/primitives/misc_ops.py +0 -267
- jaclang/vendor/mypyc/primitives/registry.py +0 -360
- jaclang/vendor/mypyc/primitives/set_ops.py +0 -121
- jaclang/vendor/mypyc/primitives/str_ops.py +0 -229
- jaclang/vendor/mypyc/primitives/tuple_ops.py +0 -83
- jaclang/vendor/mypyc/rt_subtype.py +0 -77
- jaclang/vendor/mypyc/sametype.py +0 -83
- jaclang/vendor/mypyc/subtype.py +0 -88
- jaclang/vendor/mypyc/test/__init__.py +0 -0
- jaclang/vendor/mypyc/test/config.py +0 -13
- jaclang/vendor/mypyc/test/test_alwaysdefined.py +0 -46
- jaclang/vendor/mypyc/test/test_analysis.py +0 -77
- jaclang/vendor/mypyc/test/test_cheader.py +0 -53
- jaclang/vendor/mypyc/test/test_commandline.py +0 -82
- jaclang/vendor/mypyc/test/test_emit.py +0 -69
- jaclang/vendor/mypyc/test/test_emitclass.py +0 -35
- jaclang/vendor/mypyc/test/test_emitfunc.py +0 -928
- jaclang/vendor/mypyc/test/test_emitwrapper.py +0 -60
- jaclang/vendor/mypyc/test/test_exceptions.py +0 -56
- jaclang/vendor/mypyc/test/test_external.py +0 -49
- jaclang/vendor/mypyc/test/test_irbuild.py +0 -87
- jaclang/vendor/mypyc/test/test_ircheck.py +0 -199
- jaclang/vendor/mypyc/test/test_literals.py +0 -90
- jaclang/vendor/mypyc/test/test_lowering.py +0 -56
- jaclang/vendor/mypyc/test/test_namegen.py +0 -48
- jaclang/vendor/mypyc/test/test_optimizations.py +0 -68
- jaclang/vendor/mypyc/test/test_pprint.py +0 -42
- jaclang/vendor/mypyc/test/test_rarray.py +0 -48
- jaclang/vendor/mypyc/test/test_refcount.py +0 -59
- jaclang/vendor/mypyc/test/test_run.py +0 -426
- jaclang/vendor/mypyc/test/test_serialization.py +0 -108
- jaclang/vendor/mypyc/test/test_struct.py +0 -112
- jaclang/vendor/mypyc/test/test_tuplename.py +0 -33
- jaclang/vendor/mypyc/test/test_typeops.py +0 -97
- jaclang/vendor/mypyc/test/testutil.py +0 -283
- jaclang/vendor/mypyc/test-data/alwaysdefined.test +0 -732
- jaclang/vendor/mypyc/test-data/analysis.test +0 -470
- jaclang/vendor/mypyc/test-data/commandline.test +0 -245
- jaclang/vendor/mypyc/test-data/driver/driver.py +0 -48
- jaclang/vendor/mypyc/test-data/exceptions-freq.test +0 -125
- jaclang/vendor/mypyc/test-data/exceptions.test +0 -699
- jaclang/vendor/mypyc/test-data/fixtures/ir.py +0 -373
- jaclang/vendor/mypyc/test-data/fixtures/testutil.py +0 -103
- jaclang/vendor/mypyc/test-data/fixtures/typing-full.pyi +0 -169
- jaclang/vendor/mypyc/test-data/irbuild-any.test +0 -236
- jaclang/vendor/mypyc/test-data/irbuild-basic.test +0 -3399
- jaclang/vendor/mypyc/test-data/irbuild-bool.test +0 -424
- jaclang/vendor/mypyc/test-data/irbuild-bytes.test +0 -181
- jaclang/vendor/mypyc/test-data/irbuild-classes.test +0 -1302
- jaclang/vendor/mypyc/test-data/irbuild-constant-fold.test +0 -480
- jaclang/vendor/mypyc/test-data/irbuild-dict.test +0 -584
- jaclang/vendor/mypyc/test-data/irbuild-dunders.test +0 -215
- jaclang/vendor/mypyc/test-data/irbuild-float.test +0 -497
- jaclang/vendor/mypyc/test-data/irbuild-generics.test +0 -150
- jaclang/vendor/mypyc/test-data/irbuild-glue-methods.test +0 -437
- jaclang/vendor/mypyc/test-data/irbuild-i16.test +0 -526
- jaclang/vendor/mypyc/test-data/irbuild-i32.test +0 -598
- jaclang/vendor/mypyc/test-data/irbuild-i64.test +0 -2144
- jaclang/vendor/mypyc/test-data/irbuild-int.test +0 -194
- jaclang/vendor/mypyc/test-data/irbuild-isinstance.test +0 -109
- jaclang/vendor/mypyc/test-data/irbuild-lists.test +0 -513
- jaclang/vendor/mypyc/test-data/irbuild-match.test +0 -1717
- jaclang/vendor/mypyc/test-data/irbuild-math.test +0 -64
- jaclang/vendor/mypyc/test-data/irbuild-nested.test +0 -807
- jaclang/vendor/mypyc/test-data/irbuild-optional.test +0 -536
- jaclang/vendor/mypyc/test-data/irbuild-set.test +0 -806
- jaclang/vendor/mypyc/test-data/irbuild-singledispatch.test +0 -257
- jaclang/vendor/mypyc/test-data/irbuild-statements.test +0 -1060
- jaclang/vendor/mypyc/test-data/irbuild-str.test +0 -312
- jaclang/vendor/mypyc/test-data/irbuild-strip-asserts.test +0 -12
- jaclang/vendor/mypyc/test-data/irbuild-try.test +0 -523
- jaclang/vendor/mypyc/test-data/irbuild-tuple.test +0 -386
- jaclang/vendor/mypyc/test-data/irbuild-u8.test +0 -543
- jaclang/vendor/mypyc/test-data/irbuild-unreachable.test +0 -241
- jaclang/vendor/mypyc/test-data/irbuild-vectorcall.test +0 -153
- jaclang/vendor/mypyc/test-data/lowering-int.test +0 -377
- jaclang/vendor/mypyc/test-data/lowering-list.test +0 -33
- jaclang/vendor/mypyc/test-data/opt-copy-propagation.test +0 -400
- jaclang/vendor/mypyc/test-data/opt-flag-elimination.test +0 -296
- jaclang/vendor/mypyc/test-data/refcount.test +0 -1482
- jaclang/vendor/mypyc/test-data/run-async.test +0 -173
- jaclang/vendor/mypyc/test-data/run-attrs.test +0 -318
- jaclang/vendor/mypyc/test-data/run-bench.test +0 -196
- jaclang/vendor/mypyc/test-data/run-bools.test +0 -229
- jaclang/vendor/mypyc/test-data/run-bytes.test +0 -302
- jaclang/vendor/mypyc/test-data/run-classes.test +0 -2505
- jaclang/vendor/mypyc/test-data/run-dicts.test +0 -334
- jaclang/vendor/mypyc/test-data/run-dunders.test +0 -945
- jaclang/vendor/mypyc/test-data/run-exceptions.test +0 -448
- jaclang/vendor/mypyc/test-data/run-floats.test +0 -516
- jaclang/vendor/mypyc/test-data/run-functions.test +0 -1310
- jaclang/vendor/mypyc/test-data/run-generators.test +0 -682
- jaclang/vendor/mypyc/test-data/run-i16.test +0 -338
- jaclang/vendor/mypyc/test-data/run-i32.test +0 -336
- jaclang/vendor/mypyc/test-data/run-i64.test +0 -1519
- jaclang/vendor/mypyc/test-data/run-imports.test +0 -265
- jaclang/vendor/mypyc/test-data/run-integers.test +0 -540
- jaclang/vendor/mypyc/test-data/run-lists.test +0 -411
- jaclang/vendor/mypyc/test-data/run-loops.test +0 -485
- jaclang/vendor/mypyc/test-data/run-match.test +0 -283
- jaclang/vendor/mypyc/test-data/run-math.test +0 -106
- jaclang/vendor/mypyc/test-data/run-misc.test +0 -1170
- jaclang/vendor/mypyc/test-data/run-multimodule.test +0 -887
- jaclang/vendor/mypyc/test-data/run-mypy-sim.test +0 -138
- jaclang/vendor/mypyc/test-data/run-primitives.test +0 -375
- jaclang/vendor/mypyc/test-data/run-python37.test +0 -159
- jaclang/vendor/mypyc/test-data/run-python38.test +0 -88
- jaclang/vendor/mypyc/test-data/run-sets.test +0 -150
- jaclang/vendor/mypyc/test-data/run-singledispatch.test +0 -698
- jaclang/vendor/mypyc/test-data/run-strings.test +0 -641
- jaclang/vendor/mypyc/test-data/run-traits.test +0 -411
- jaclang/vendor/mypyc/test-data/run-tuples.test +0 -258
- jaclang/vendor/mypyc/test-data/run-u8.test +0 -303
- jaclang/vendor/mypyc/transform/__init__.py +0 -0
- jaclang/vendor/mypyc/transform/copy_propagation.py +0 -94
- jaclang/vendor/mypyc/transform/exceptions.py +0 -182
- jaclang/vendor/mypyc/transform/flag_elimination.py +0 -108
- jaclang/vendor/mypyc/transform/ir_transform.py +0 -368
- jaclang/vendor/mypyc/transform/lower.py +0 -33
- jaclang/vendor/mypyc/transform/refcount.py +0 -294
- jaclang/vendor/mypyc/transform/uninit.py +0 -190
- jaclang/vendor/typing_extensions-4.12.2.dist-info/LICENSE +0 -279
- jaclang/vendor/typing_extensions-4.12.2.dist-info/METADATA +0 -67
- jaclang/vendor/typing_extensions-4.12.2.dist-info/RECORD +0 -5
- jaclang/vendor/typing_extensions-4.12.2.dist-info/WHEEL +0 -4
- jaclang/vendor/typing_extensions.py +0 -3641
- jaclang-0.7.34.dist-info/RECORD +0 -1563
- /jaclang/{vendor/mypy/dmypy → compiler/larkparse}/__init__.py +0 -0
- /jaclang/{tests → compiler/passes/main/tests}/fixtures/access_checker.jac +0 -0
- /jaclang/{vendor/mypy/plugins/__init__.py → langserve/tests/fixtures/deep_check_crash.jac} +0 -0
- /jaclang/{vendor/mypy/server/__init__.py → langserve/tests/server_test/code_test.py} +0 -0
- /jaclang/{plugin → runtimelib}/tests/__init__.py +0 -0
- /jaclang/{plugin → runtimelib}/tests/fixtures/traversing_save.jac +0 -0
- /jaclang/{vendor/mypy/test → tests}/__init__.py +0 -0
- /jaclang/{vendor/mypy/test/meta → tests/fixtures}/__init__.py +0 -0
- /jaclang/tests/fixtures/{architype_def_bug.jac → archetype_def_bug.jac} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/concurrent/__init__.pyi → attrs-25.3.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{attrs-23.2.0.dist-info → attrs-25.3.0.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/__init__.pyi → cattrs-24.1.3.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{cattrs-23.2.3.dist-info → cattrs-24.1.3.dist-info}/licenses/LICENSE +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi → lark-1.2.2.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/entry_points.txt +0 -0
- /jaclang/vendor/{lark-1.1.9.dist-info → lark-1.2.2.dist-info}/top_level.txt +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/email/mime/__init__.pyi → lsprotocol-2023.0.1.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/lsprotocol-2023.0.1.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/__init__.pyi → pluggy-1.5.0.dist-info/REQUESTED} +0 -0
- /jaclang/vendor/pluggy-1.5.0.dist-info/{LICENSE → licenses/LICENSE} +0 -0
- /jaclang/vendor/{mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi → pygls-1.3.1.dist-info/REQUESTED} +0 -0
- {jaclang-0.7.34.dist-info → jaclang-0.8.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Python AST Generation Pass for the Jac compiler.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
This pass transforms the Jac AST into equivalent Python AST by:
|
|
4
|
+
|
|
5
|
+
1. Traversing the Jac AST and generating corresponding Python AST nodes
|
|
6
|
+
2. Handling all Jac language constructs and translating them to Python equivalents:
|
|
7
|
+
- Classes, functions, and methods
|
|
8
|
+
- Control flow statements (if/else, loops, try/except)
|
|
9
|
+
- Data structures (lists, dictionaries, sets)
|
|
10
|
+
- Special Jac features (walkers, abilities, archetypes)
|
|
11
|
+
- Data spatial operations (node/edge connections)
|
|
12
|
+
|
|
13
|
+
3. Managing imports and dependencies between modules
|
|
14
|
+
4. Preserving source location information for error reporting
|
|
15
|
+
5. Generating appropriate Python code for Jac-specific constructs
|
|
16
|
+
|
|
17
|
+
The output of this pass is a complete Python AST representation that can be
|
|
18
|
+
compiled to Python bytecode or serialized to Python source code.
|
|
5
19
|
"""
|
|
6
20
|
|
|
7
21
|
import ast as ast3
|
|
22
|
+
import copy
|
|
8
23
|
import textwrap
|
|
9
24
|
from dataclasses import dataclass
|
|
10
|
-
from typing import Optional, Sequence, TypeVar, cast
|
|
25
|
+
from typing import List, Optional, Sequence, TypeVar, Union, cast
|
|
11
26
|
|
|
12
|
-
import jaclang.compiler.
|
|
27
|
+
import jaclang.compiler.unitree as uni
|
|
13
28
|
from jaclang.compiler.constant import Constants as Con, EdgeDir, Tokens as Tok
|
|
14
|
-
from jaclang.compiler.passes import
|
|
29
|
+
from jaclang.compiler.passes import UniPass
|
|
15
30
|
from jaclang.settings import settings
|
|
16
31
|
|
|
17
32
|
T = TypeVar("T", bound=ast3.AST)
|
|
18
33
|
|
|
19
34
|
|
|
20
|
-
class PyastGenPass(
|
|
35
|
+
class PyastGenPass(UniPass):
|
|
21
36
|
"""Jac blue transpilation to python pass."""
|
|
22
37
|
|
|
23
|
-
# TODO: This should live in utils and perhaps a test added using it
|
|
24
|
-
# @staticmethod
|
|
25
|
-
# def node_compilable_test(node: ast3.AST) -> None:
|
|
26
|
-
# """Convert any AST node to a compilable module node."""
|
|
27
|
-
# if isinstance(node, ast3.Module):
|
|
28
|
-
# pass
|
|
29
|
-
# elif isinstance(node, (ast3.Expr, ast3.stmt)):
|
|
30
|
-
# node = ast3.Module(body=[node], type_ignores=[])
|
|
31
|
-
# elif isinstance(node, list) and all(isinstance(n, ast3.stmt) for n in node):
|
|
32
|
-
# node = ast3.Module(body=node, type_ignores=[])
|
|
33
|
-
# else:
|
|
34
|
-
# node = ast3.Module(body=[], type_ignores=[])
|
|
35
|
-
# try:
|
|
36
|
-
# compile(node, "<ast>", "exec")
|
|
37
|
-
# except TypeError as e:
|
|
38
|
-
# print(ast3.dump(node, indent=2))
|
|
39
|
-
# raise e
|
|
40
|
-
# except Exception:
|
|
41
|
-
# pass
|
|
42
|
-
|
|
43
38
|
def before_pass(self) -> None:
|
|
44
|
-
|
|
39
|
+
for i in self.ir_in.impl_mod + self.ir_in.test_mod:
|
|
40
|
+
PyastGenPass(ir_in=i, prog=self.prog)
|
|
45
41
|
self.debuginfo: dict[str, list[str]] = {"jac_mods": []}
|
|
46
42
|
self.already_added: list[str] = []
|
|
47
43
|
self.preamble: list[ast3.AST] = [
|
|
@@ -51,57 +47,52 @@ class PyastGenPass(Pass):
|
|
|
51
47
|
names=[self.sync(ast3.alias(name="annotations", asname=None))],
|
|
52
48
|
level=0,
|
|
53
49
|
),
|
|
54
|
-
jac_node=self.
|
|
50
|
+
jac_node=self.ir_out,
|
|
55
51
|
),
|
|
56
52
|
(
|
|
57
53
|
self.sync(
|
|
58
54
|
ast3.ImportFrom(
|
|
59
|
-
module="jaclang",
|
|
60
|
-
names=[self.sync(ast3.alias(name="*", asname=None))],
|
|
61
|
-
level=0,
|
|
62
|
-
),
|
|
63
|
-
jac_node=self.ir,
|
|
64
|
-
)
|
|
65
|
-
if settings.pyout_jaclib_import_all
|
|
66
|
-
else self.sync(
|
|
67
|
-
ast3.Import(
|
|
55
|
+
module="jaclang.runtimelib.builtin",
|
|
68
56
|
names=[
|
|
69
57
|
self.sync(
|
|
70
58
|
ast3.alias(
|
|
71
|
-
name="
|
|
59
|
+
name="*",
|
|
60
|
+
asname=None,
|
|
72
61
|
)
|
|
73
62
|
)
|
|
74
|
-
]
|
|
63
|
+
],
|
|
64
|
+
level=0,
|
|
75
65
|
),
|
|
76
|
-
jac_node=self.
|
|
66
|
+
jac_node=self.ir_out,
|
|
77
67
|
)
|
|
78
68
|
),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
from jaclang.plugin.builtin import __all__ as jac_builtin_funcs
|
|
82
|
-
|
|
83
|
-
if not settings.pyout_jaclib_import_all:
|
|
84
|
-
self.preamble += [
|
|
69
|
+
(
|
|
85
70
|
self.sync(
|
|
86
71
|
ast3.ImportFrom(
|
|
87
72
|
module="jaclang",
|
|
88
73
|
names=[
|
|
89
|
-
self.sync(
|
|
90
|
-
|
|
74
|
+
self.sync(
|
|
75
|
+
ast3.alias(
|
|
76
|
+
name="JacMachineInterface",
|
|
77
|
+
asname=settings.pyout_jaclib_alias,
|
|
78
|
+
)
|
|
79
|
+
),
|
|
91
80
|
],
|
|
92
81
|
level=0,
|
|
93
|
-
)
|
|
82
|
+
),
|
|
83
|
+
jac_node=self.ir_out,
|
|
94
84
|
)
|
|
95
|
-
|
|
85
|
+
),
|
|
86
|
+
]
|
|
96
87
|
|
|
97
|
-
def enter_node(self, node:
|
|
88
|
+
def enter_node(self, node: uni.UniNode) -> None:
|
|
98
89
|
"""Enter node."""
|
|
99
90
|
if node.gen.py_ast:
|
|
100
91
|
self.prune()
|
|
101
92
|
return
|
|
102
93
|
super().enter_node(node)
|
|
103
94
|
|
|
104
|
-
def exit_node(self, node:
|
|
95
|
+
def exit_node(self, node: uni.UniNode) -> None:
|
|
105
96
|
"""Exit node."""
|
|
106
97
|
super().exit_node(node)
|
|
107
98
|
# for i in node.gen.py_ast: # Internal validation
|
|
@@ -113,8 +104,6 @@ class PyastGenPass(Pass):
|
|
|
113
104
|
|
|
114
105
|
def jaclib_obj(self, obj_name: str) -> ast3.Name | ast3.Attribute:
|
|
115
106
|
"""Return the object from jaclib as ast node based on the import config."""
|
|
116
|
-
if settings.pyout_jaclib_import_all:
|
|
117
|
-
return self.sync(ast3.Name(id=obj_name, ctx=ast3.Load()))
|
|
118
107
|
return self.sync(
|
|
119
108
|
ast3.Attribute(
|
|
120
109
|
value=self.sync(
|
|
@@ -135,11 +124,11 @@ class PyastGenPass(Pass):
|
|
|
135
124
|
names=[
|
|
136
125
|
self.sync(
|
|
137
126
|
ast3.alias(name="typing"),
|
|
138
|
-
jac_node=self.
|
|
127
|
+
jac_node=self.ir_out,
|
|
139
128
|
),
|
|
140
129
|
]
|
|
141
130
|
),
|
|
142
|
-
jac_node=self.
|
|
131
|
+
jac_node=self.ir_out,
|
|
143
132
|
)
|
|
144
133
|
)
|
|
145
134
|
self.already_added.append(self.needs_typing.__name__)
|
|
@@ -158,13 +147,30 @@ class PyastGenPass(Pass):
|
|
|
158
147
|
],
|
|
159
148
|
level=0,
|
|
160
149
|
),
|
|
161
|
-
jac_node=self.
|
|
150
|
+
jac_node=self.ir_out,
|
|
162
151
|
)
|
|
163
152
|
)
|
|
164
153
|
self.already_added.append(self.needs_enum.__name__)
|
|
165
154
|
|
|
155
|
+
def needs_future(self) -> None:
|
|
156
|
+
"""Check if enum is needed."""
|
|
157
|
+
if self.needs_future.__name__ in self.already_added:
|
|
158
|
+
return
|
|
159
|
+
self.preamble.append(
|
|
160
|
+
self.sync(
|
|
161
|
+
ast3.ImportFrom(
|
|
162
|
+
module="concurrent.futures",
|
|
163
|
+
names=[
|
|
164
|
+
self.sync(ast3.alias(name="Future", asname=None)),
|
|
165
|
+
],
|
|
166
|
+
level=0,
|
|
167
|
+
),
|
|
168
|
+
jac_node=self.ir_out,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
self.already_added.append(self.needs_future.__name__)
|
|
172
|
+
|
|
166
173
|
def flatten(self, body: list[T | list[T] | None]) -> list[T]:
|
|
167
|
-
"""Flatten ast list."""
|
|
168
174
|
new_body = []
|
|
169
175
|
for i in body:
|
|
170
176
|
if isinstance(i, list):
|
|
@@ -174,22 +180,25 @@ class PyastGenPass(Pass):
|
|
|
174
180
|
return new_body
|
|
175
181
|
|
|
176
182
|
def sync(
|
|
177
|
-
self, py_node: T, jac_node: Optional[
|
|
183
|
+
self, py_node: T, jac_node: Optional[uni.UniNode] = None, deep: bool = False
|
|
178
184
|
) -> T:
|
|
179
185
|
"""Sync ast locations."""
|
|
180
186
|
if not jac_node:
|
|
181
187
|
jac_node = self.cur_node
|
|
182
188
|
for i in ast3.walk(py_node) if deep else [py_node]:
|
|
189
|
+
# TODO:here we are type ignore to hack the mypy bcz
|
|
190
|
+
# python AST dosen't have lineno, col_offset, end_lineno, end_col_offset attributes.
|
|
191
|
+
# we need to discuss with @marsninja
|
|
183
192
|
if isinstance(i, ast3.AST):
|
|
184
|
-
i.lineno = jac_node.loc.first_line
|
|
185
|
-
i.col_offset = jac_node.loc.col_start
|
|
186
|
-
i.end_lineno = (
|
|
193
|
+
i.lineno = jac_node.loc.first_line # type:ignore[attr-defined]
|
|
194
|
+
i.col_offset = jac_node.loc.col_start # type:ignore[attr-defined]
|
|
195
|
+
i.end_lineno = ( # type:ignore[attr-defined]
|
|
187
196
|
jac_node.loc.last_line
|
|
188
197
|
if jac_node.loc.last_line
|
|
189
198
|
and (jac_node.loc.last_line > jac_node.loc.first_line)
|
|
190
199
|
else jac_node.loc.first_line
|
|
191
200
|
)
|
|
192
|
-
i.end_col_offset = (
|
|
201
|
+
i.end_col_offset = ( # type:ignore[attr-defined]
|
|
193
202
|
jac_node.loc.col_end
|
|
194
203
|
if jac_node.loc.col_end
|
|
195
204
|
and (jac_node.loc.col_end > jac_node.loc.col_start)
|
|
@@ -216,44 +225,49 @@ class PyastGenPass(Pass):
|
|
|
216
225
|
def resolve_stmt_block(
|
|
217
226
|
self,
|
|
218
227
|
node: (
|
|
219
|
-
|
|
220
|
-
|
|
|
221
|
-
|
|
|
228
|
+
uni.SubNodeList[uni.CodeBlockStmt]
|
|
229
|
+
| uni.SubNodeList[uni.ArchBlockStmt]
|
|
230
|
+
| uni.SubNodeList[uni.EnumBlockStmt]
|
|
222
231
|
| None
|
|
223
232
|
),
|
|
224
|
-
doc: Optional[
|
|
233
|
+
doc: Optional[uni.String] = None,
|
|
225
234
|
) -> list[ast3.AST]:
|
|
226
235
|
"""Unwind codeblock."""
|
|
227
236
|
valid_stmts = (
|
|
228
|
-
[i for i in node.items if not isinstance(i,
|
|
237
|
+
[i for i in node.items if not isinstance(i, uni.Semi)] if node else []
|
|
229
238
|
)
|
|
230
239
|
ret: list[ast3.AST] = (
|
|
231
240
|
[self.sync(ast3.Pass(), node)]
|
|
232
|
-
if isinstance(node,
|
|
241
|
+
if isinstance(node, uni.SubNodeList) and not valid_stmts
|
|
233
242
|
else (
|
|
234
243
|
self.flatten(
|
|
235
244
|
[
|
|
236
245
|
x.gen.py_ast
|
|
237
246
|
for x in valid_stmts
|
|
238
|
-
if not isinstance(x,
|
|
247
|
+
if not isinstance(x, uni.ImplDef)
|
|
239
248
|
]
|
|
240
249
|
)
|
|
241
|
-
if node
|
|
250
|
+
if node
|
|
242
251
|
else []
|
|
243
252
|
)
|
|
244
253
|
)
|
|
245
254
|
if doc:
|
|
246
|
-
ret = [
|
|
255
|
+
ret = [
|
|
256
|
+
self.sync(
|
|
257
|
+
ast3.Expr(value=cast(ast3.expr, doc.gen.py_ast[0])), jac_node=doc
|
|
258
|
+
),
|
|
259
|
+
*ret,
|
|
260
|
+
]
|
|
247
261
|
return ret
|
|
248
262
|
|
|
249
|
-
def sync_many(self, py_nodes: list[T], jac_node:
|
|
263
|
+
def sync_many(self, py_nodes: list[T], jac_node: uni.UniNode) -> list[T]:
|
|
250
264
|
"""Sync ast locations."""
|
|
251
265
|
for py_node in py_nodes:
|
|
252
266
|
self.sync(py_node, jac_node)
|
|
253
267
|
return py_nodes
|
|
254
268
|
|
|
255
269
|
def list_to_attrib(
|
|
256
|
-
self, attribute_list: list[str], sync_node_list: Sequence[
|
|
270
|
+
self, attribute_list: list[str], sync_node_list: Sequence[uni.UniNode]
|
|
257
271
|
) -> ast3.AST:
|
|
258
272
|
"""Convert list to attribute."""
|
|
259
273
|
attr_node: ast3.Name | ast3.Attribute = self.sync(
|
|
@@ -270,31 +284,15 @@ class PyastGenPass(Pass):
|
|
|
270
284
|
)
|
|
271
285
|
return attr_node
|
|
272
286
|
|
|
273
|
-
def exit_sub_tag(self, node:
|
|
274
|
-
"""Sub objects.
|
|
275
|
-
|
|
276
|
-
tag: T,
|
|
277
|
-
"""
|
|
287
|
+
def exit_sub_tag(self, node: uni.SubTag[uni.T]) -> None:
|
|
278
288
|
node.gen.py_ast = node.tag.gen.py_ast
|
|
279
289
|
|
|
280
|
-
def exit_sub_node_list(self, node:
|
|
281
|
-
"""Sub objects.
|
|
282
|
-
|
|
283
|
-
items: Sequence[T],
|
|
284
|
-
"""
|
|
290
|
+
def exit_sub_node_list(self, node: uni.SubNodeList[uni.T]) -> None:
|
|
285
291
|
node.gen.py_ast = self.flatten([i.gen.py_ast for i in node.items])
|
|
286
292
|
|
|
287
|
-
def exit_module(self, node:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
name: str,
|
|
291
|
-
source: JacSource,
|
|
292
|
-
doc: Optional[String],
|
|
293
|
-
body: Sequence[ElementStmt],
|
|
294
|
-
is_imported: bool,
|
|
295
|
-
"""
|
|
296
|
-
clean_body = [i for i in node.body if not isinstance(i, ast.AstImplOnlyNode)]
|
|
297
|
-
pre_body: list[ast.AstNode] = []
|
|
293
|
+
def exit_module(self, node: uni.Module) -> None:
|
|
294
|
+
clean_body = [i for i in node.body if not isinstance(i, uni.ImplDef)]
|
|
295
|
+
pre_body: list[uni.UniNode] = []
|
|
298
296
|
for pbody in node.impl_mod:
|
|
299
297
|
pre_body = [*pre_body, *pbody.body]
|
|
300
298
|
pre_body = [*pre_body, *clean_body]
|
|
@@ -302,7 +300,10 @@ class PyastGenPass(Pass):
|
|
|
302
300
|
pre_body = [*pre_body, *pbody.body]
|
|
303
301
|
body = (
|
|
304
302
|
[
|
|
305
|
-
self.sync(
|
|
303
|
+
self.sync(
|
|
304
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
305
|
+
jac_node=node.doc,
|
|
306
|
+
),
|
|
306
307
|
*self.preamble,
|
|
307
308
|
*[x.gen.py_ast for x in pre_body],
|
|
308
309
|
]
|
|
@@ -325,16 +326,12 @@ class PyastGenPass(Pass):
|
|
|
325
326
|
]
|
|
326
327
|
node.gen.py = ast3.unparse(node.gen.py_ast[0])
|
|
327
328
|
|
|
328
|
-
def exit_global_vars(self, node:
|
|
329
|
-
"""Sub objects.
|
|
330
|
-
|
|
331
|
-
access: Optional[SubTag[Token]],
|
|
332
|
-
assignments: SubNodeList[Assignment],
|
|
333
|
-
is_frozen: bool,
|
|
334
|
-
doc: Optional[String],
|
|
335
|
-
"""
|
|
329
|
+
def exit_global_vars(self, node: uni.GlobalVars) -> None:
|
|
336
330
|
if node.doc:
|
|
337
|
-
doc = self.sync(
|
|
331
|
+
doc = self.sync(
|
|
332
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
333
|
+
jac_node=node.doc,
|
|
334
|
+
)
|
|
338
335
|
if isinstance(doc, ast3.AST) and isinstance(
|
|
339
336
|
node.assignments.gen.py_ast, list
|
|
340
337
|
):
|
|
@@ -344,13 +341,7 @@ class PyastGenPass(Pass):
|
|
|
344
341
|
else:
|
|
345
342
|
node.gen.py_ast = node.assignments.gen.py_ast
|
|
346
343
|
|
|
347
|
-
def exit_test(self, node:
|
|
348
|
-
"""Sub objects.
|
|
349
|
-
|
|
350
|
-
name: Name | Token,
|
|
351
|
-
body: SubNodeList[CodeBlockStmt],
|
|
352
|
-
doc: Optional[String],
|
|
353
|
-
"""
|
|
344
|
+
def exit_test(self, node: uni.Test) -> None:
|
|
354
345
|
test_name = node.name.sym_name
|
|
355
346
|
func = self.sync(
|
|
356
347
|
ast3.FunctionDef(
|
|
@@ -365,29 +356,26 @@ class PyastGenPass(Pass):
|
|
|
365
356
|
],
|
|
366
357
|
kwonlyargs=[],
|
|
367
358
|
vararg=None,
|
|
368
|
-
|
|
359
|
+
kwarg=None,
|
|
369
360
|
kw_defaults=[],
|
|
370
361
|
defaults=[],
|
|
371
362
|
)
|
|
372
363
|
),
|
|
373
|
-
body=
|
|
364
|
+
body=[
|
|
365
|
+
cast(ast3.stmt, stmt)
|
|
366
|
+
for stmt in self.resolve_stmt_block(node.body, doc=node.doc)
|
|
367
|
+
],
|
|
374
368
|
decorator_list=[self.jaclib_obj("jac_test")],
|
|
375
369
|
returns=self.sync(ast3.Constant(value=None)),
|
|
376
370
|
type_comment=None,
|
|
377
371
|
type_params=[],
|
|
378
372
|
),
|
|
379
373
|
)
|
|
380
|
-
if node.loc.mod_path
|
|
374
|
+
if node.loc.mod_path.endswith(".test.jac"):
|
|
381
375
|
func.decorator_list.append(
|
|
382
376
|
self.sync(
|
|
383
377
|
ast3.Call(
|
|
384
|
-
func=self.
|
|
385
|
-
ast3.Attribute(
|
|
386
|
-
value=self.jaclib_obj("Jac"),
|
|
387
|
-
attr="impl_patch_filename",
|
|
388
|
-
ctx=ast3.Load(),
|
|
389
|
-
)
|
|
390
|
-
),
|
|
378
|
+
func=self.jaclib_obj("impl_patch_filename"),
|
|
391
379
|
args=[],
|
|
392
380
|
keywords=[
|
|
393
381
|
self.sync(
|
|
@@ -404,13 +392,7 @@ class PyastGenPass(Pass):
|
|
|
404
392
|
)
|
|
405
393
|
node.gen.py_ast = [func]
|
|
406
394
|
|
|
407
|
-
def exit_module_code(self, node:
|
|
408
|
-
"""Sub objects.
|
|
409
|
-
|
|
410
|
-
name: Optional[SubTag[Name]],
|
|
411
|
-
body: SubNodeList[CodeBlockStmt],
|
|
412
|
-
doc: Optional[String],
|
|
413
|
-
"""
|
|
395
|
+
def exit_module_code(self, node: uni.ModuleCode) -> None:
|
|
414
396
|
node.gen.py_ast = self.resolve_stmt_block(node.body, doc=node.doc)
|
|
415
397
|
if node.name:
|
|
416
398
|
node.gen.py_ast = [
|
|
@@ -423,26 +405,22 @@ class PyastGenPass(Pass):
|
|
|
423
405
|
),
|
|
424
406
|
ops=[self.sync(ast3.Eq())],
|
|
425
407
|
comparators=[
|
|
426
|
-
self.sync(
|
|
427
|
-
ast3.Constant(value=node.name.tag.sym_name)
|
|
428
|
-
)
|
|
408
|
+
self.sync(ast3.Constant(value=node.name.sym_name))
|
|
429
409
|
],
|
|
430
410
|
)
|
|
431
411
|
),
|
|
432
|
-
body=node.gen.py_ast,
|
|
412
|
+
body=[cast(ast3.stmt, i) for i in node.gen.py_ast],
|
|
433
413
|
orelse=[],
|
|
434
414
|
)
|
|
435
415
|
)
|
|
436
416
|
]
|
|
437
417
|
|
|
438
|
-
def exit_py_inline_code(self, node:
|
|
439
|
-
"""Sub objects.
|
|
440
|
-
|
|
441
|
-
code: Token,
|
|
442
|
-
doc: Optional[String],
|
|
443
|
-
"""
|
|
418
|
+
def exit_py_inline_code(self, node: uni.PyInlineCode) -> None:
|
|
444
419
|
if node.doc:
|
|
445
|
-
doc = self.sync(
|
|
420
|
+
doc = self.sync(
|
|
421
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
422
|
+
jac_node=node.doc,
|
|
423
|
+
)
|
|
446
424
|
if isinstance(doc, ast3.AST):
|
|
447
425
|
node.gen.py_ast = self.pyinline_sync(
|
|
448
426
|
[doc, *ast3.parse(node.code.value).body]
|
|
@@ -455,37 +433,36 @@ class PyastGenPass(Pass):
|
|
|
455
433
|
[*ast3.parse(textwrap.dedent(node.code.value)).body]
|
|
456
434
|
)
|
|
457
435
|
|
|
458
|
-
def exit_import(self, node:
|
|
459
|
-
"""Sub objects.
|
|
460
|
-
|
|
461
|
-
hint: SubTag[Name],
|
|
462
|
-
paths: list[ModulePath],
|
|
463
|
-
alias: Optional[Name],
|
|
464
|
-
items: Optional[SubNodeList[ModuleItem]],
|
|
465
|
-
is_absorb: bool,
|
|
466
|
-
doc: Optional[String],
|
|
467
|
-
sub_module: Optional[Module],
|
|
468
|
-
"""
|
|
436
|
+
def exit_import(self, node: uni.Import) -> None:
|
|
469
437
|
path_alias: dict[str, Optional[str]] = (
|
|
470
438
|
{node.from_loc.dot_path_str: None} if node.from_loc else {}
|
|
471
439
|
)
|
|
472
440
|
imp_from = {}
|
|
473
441
|
if node.items:
|
|
474
442
|
for item in node.items.items:
|
|
475
|
-
if isinstance(item,
|
|
443
|
+
if isinstance(item, uni.ModuleItem):
|
|
476
444
|
imp_from[item.name.sym_name] = (
|
|
477
445
|
item.alias.sym_name if item.alias else None
|
|
478
446
|
)
|
|
479
|
-
elif isinstance(item,
|
|
447
|
+
elif isinstance(item, uni.ModulePath):
|
|
480
448
|
path_alias[item.dot_path_str] = (
|
|
481
449
|
item.alias.sym_name if item.alias else None
|
|
482
450
|
)
|
|
483
451
|
|
|
484
|
-
|
|
485
|
-
|
|
452
|
+
item_names: list[ast3.expr] = []
|
|
453
|
+
item_keys: list[ast3.Constant] = []
|
|
454
|
+
item_values: list[ast3.Constant] = []
|
|
486
455
|
for k, v in imp_from.items():
|
|
487
456
|
item_keys.append(self.sync(ast3.Constant(value=k)))
|
|
488
457
|
item_values.append(self.sync(ast3.Constant(value=v)))
|
|
458
|
+
item_names.append(
|
|
459
|
+
self.sync(
|
|
460
|
+
ast3.Name(
|
|
461
|
+
id=v or k,
|
|
462
|
+
ctx=ast3.Store(),
|
|
463
|
+
)
|
|
464
|
+
)
|
|
465
|
+
)
|
|
489
466
|
path_named_value: str
|
|
490
467
|
py_nodes: list[ast3.AST] = []
|
|
491
468
|
typecheck_nodes: list[ast3.AST] = []
|
|
@@ -493,7 +470,10 @@ class PyastGenPass(Pass):
|
|
|
493
470
|
|
|
494
471
|
if node.doc:
|
|
495
472
|
py_nodes.append(
|
|
496
|
-
self.sync(
|
|
473
|
+
self.sync(
|
|
474
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
475
|
+
jac_node=node.doc,
|
|
476
|
+
)
|
|
497
477
|
)
|
|
498
478
|
|
|
499
479
|
for path, alias in path_alias.items():
|
|
@@ -505,6 +485,50 @@ class PyastGenPass(Pass):
|
|
|
505
485
|
# target_named_value += i if i else "."
|
|
506
486
|
# if i:
|
|
507
487
|
# break
|
|
488
|
+
|
|
489
|
+
args = [
|
|
490
|
+
self.sync(
|
|
491
|
+
ast3.Constant(value=path),
|
|
492
|
+
),
|
|
493
|
+
self.sync(
|
|
494
|
+
ast3.Name(
|
|
495
|
+
id="__file__",
|
|
496
|
+
ctx=ast3.Load(),
|
|
497
|
+
)
|
|
498
|
+
),
|
|
499
|
+
]
|
|
500
|
+
keywords = []
|
|
501
|
+
|
|
502
|
+
if node.is_absorb:
|
|
503
|
+
args.append(self.sync(ast3.Constant(value=node.is_absorb)))
|
|
504
|
+
|
|
505
|
+
if alias is not None:
|
|
506
|
+
keywords.append(
|
|
507
|
+
self.sync(
|
|
508
|
+
ast3.keyword(
|
|
509
|
+
arg="mdl_alias",
|
|
510
|
+
value=self.sync(
|
|
511
|
+
ast3.Constant(value=alias),
|
|
512
|
+
),
|
|
513
|
+
)
|
|
514
|
+
)
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
if item_keys and item_values:
|
|
518
|
+
keywords.append(
|
|
519
|
+
self.sync(
|
|
520
|
+
ast3.keyword(
|
|
521
|
+
arg="items",
|
|
522
|
+
value=self.sync(
|
|
523
|
+
ast3.Dict(
|
|
524
|
+
keys=cast(list[ast3.expr | None], item_keys),
|
|
525
|
+
values=cast(list[ast3.expr], item_values),
|
|
526
|
+
),
|
|
527
|
+
),
|
|
528
|
+
)
|
|
529
|
+
)
|
|
530
|
+
)
|
|
531
|
+
|
|
508
532
|
runtime_nodes.append(
|
|
509
533
|
self.sync(
|
|
510
534
|
ast3.Assign(
|
|
@@ -513,7 +537,8 @@ class PyastGenPass(Pass):
|
|
|
513
537
|
self.sync(
|
|
514
538
|
ast3.Tuple(
|
|
515
539
|
elts=(
|
|
516
|
-
|
|
540
|
+
item_names
|
|
541
|
+
or [
|
|
517
542
|
self.sync(
|
|
518
543
|
ast3.Name(
|
|
519
544
|
id=path_named_value,
|
|
@@ -521,21 +546,6 @@ class PyastGenPass(Pass):
|
|
|
521
546
|
)
|
|
522
547
|
)
|
|
523
548
|
]
|
|
524
|
-
if not len(item_keys)
|
|
525
|
-
else []
|
|
526
|
-
+ [
|
|
527
|
-
self.sync(
|
|
528
|
-
ast3.Name(
|
|
529
|
-
id=(
|
|
530
|
-
v.value
|
|
531
|
-
if v.value
|
|
532
|
-
else k.value
|
|
533
|
-
),
|
|
534
|
-
ctx=ast3.Store(),
|
|
535
|
-
)
|
|
536
|
-
)
|
|
537
|
-
for k, v in zip(item_keys, item_values)
|
|
538
|
-
]
|
|
539
549
|
),
|
|
540
550
|
ctx=ast3.Store(),
|
|
541
551
|
)
|
|
@@ -544,65 +554,9 @@ class PyastGenPass(Pass):
|
|
|
544
554
|
),
|
|
545
555
|
value=self.sync(
|
|
546
556
|
ast3.Call(
|
|
547
|
-
func=self.jaclib_obj("
|
|
548
|
-
args=
|
|
549
|
-
|
|
550
|
-
]
|
|
551
|
-
+ (
|
|
552
|
-
[
|
|
553
|
-
self.sync(
|
|
554
|
-
ast3.Constant(value="py"),
|
|
555
|
-
node.hint,
|
|
556
|
-
)
|
|
557
|
-
]
|
|
558
|
-
if node.is_py
|
|
559
|
-
else []
|
|
560
|
-
),
|
|
561
|
-
keywords=(
|
|
562
|
-
[
|
|
563
|
-
self.sync(
|
|
564
|
-
ast3.keyword(
|
|
565
|
-
arg="absorb",
|
|
566
|
-
value=self.sync(
|
|
567
|
-
ast3.Constant(value=node.is_absorb),
|
|
568
|
-
),
|
|
569
|
-
)
|
|
570
|
-
),
|
|
571
|
-
]
|
|
572
|
-
if node.is_absorb
|
|
573
|
-
else []
|
|
574
|
-
)
|
|
575
|
-
+ (
|
|
576
|
-
[
|
|
577
|
-
self.sync(
|
|
578
|
-
ast3.keyword(
|
|
579
|
-
arg="alias",
|
|
580
|
-
value=self.sync(
|
|
581
|
-
ast3.Constant(value=alias),
|
|
582
|
-
),
|
|
583
|
-
)
|
|
584
|
-
),
|
|
585
|
-
]
|
|
586
|
-
if alias
|
|
587
|
-
else []
|
|
588
|
-
)
|
|
589
|
-
+ (
|
|
590
|
-
[
|
|
591
|
-
self.sync(
|
|
592
|
-
ast3.keyword(
|
|
593
|
-
arg="items",
|
|
594
|
-
value=self.sync(
|
|
595
|
-
ast3.Dict(
|
|
596
|
-
keys=item_keys,
|
|
597
|
-
values=item_values,
|
|
598
|
-
),
|
|
599
|
-
),
|
|
600
|
-
)
|
|
601
|
-
),
|
|
602
|
-
]
|
|
603
|
-
if len(item_keys)
|
|
604
|
-
else []
|
|
605
|
-
),
|
|
557
|
+
func=self.jaclib_obj("py_jac_import"),
|
|
558
|
+
args=args,
|
|
559
|
+
keywords=keywords,
|
|
606
560
|
)
|
|
607
561
|
),
|
|
608
562
|
),
|
|
@@ -757,7 +711,7 @@ class PyastGenPass(Pass):
|
|
|
757
711
|
)
|
|
758
712
|
if node.is_absorb:
|
|
759
713
|
source = node.items.items[0]
|
|
760
|
-
if not isinstance(source,
|
|
714
|
+
if not isinstance(source, uni.ModulePath):
|
|
761
715
|
raise self.ice()
|
|
762
716
|
typecheck_nodes.append(
|
|
763
717
|
self.sync(
|
|
@@ -770,7 +724,13 @@ class PyastGenPass(Pass):
|
|
|
770
724
|
)
|
|
771
725
|
)
|
|
772
726
|
elif not node.from_loc:
|
|
773
|
-
typecheck_nodes.append(
|
|
727
|
+
typecheck_nodes.append(
|
|
728
|
+
self.sync(
|
|
729
|
+
ast3.Import(
|
|
730
|
+
names=[cast(ast3.alias, x) for x in node.items.gen.py_ast]
|
|
731
|
+
)
|
|
732
|
+
)
|
|
733
|
+
)
|
|
774
734
|
else:
|
|
775
735
|
typecheck_nodes.append(
|
|
776
736
|
self.sync(
|
|
@@ -780,36 +740,23 @@ class PyastGenPass(Pass):
|
|
|
780
740
|
if node.from_loc
|
|
781
741
|
else None
|
|
782
742
|
),
|
|
783
|
-
names=node.items.gen.py_ast,
|
|
743
|
+
names=[cast(ast3.alias, i) for i in node.items.gen.py_ast],
|
|
784
744
|
level=0,
|
|
785
745
|
)
|
|
786
746
|
)
|
|
787
747
|
)
|
|
788
|
-
self.needs_typing()
|
|
789
748
|
py_nodes.append(
|
|
790
749
|
self.sync(
|
|
791
750
|
ast3.If(
|
|
792
|
-
test=self.
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
attr="TYPE_CHECKING",
|
|
796
|
-
ctx=ast3.Load(),
|
|
797
|
-
)
|
|
798
|
-
),
|
|
799
|
-
body=typecheck_nodes,
|
|
800
|
-
orelse=runtime_nodes,
|
|
751
|
+
test=self.jaclib_obj("TYPE_CHECKING"),
|
|
752
|
+
body=[cast(ast3.stmt, node) for node in typecheck_nodes],
|
|
753
|
+
orelse=[cast(ast3.stmt, node) for node in runtime_nodes],
|
|
801
754
|
)
|
|
802
755
|
)
|
|
803
756
|
)
|
|
804
757
|
node.gen.py_ast = py_nodes
|
|
805
758
|
|
|
806
|
-
def exit_module_path(self, node:
|
|
807
|
-
"""Sub objects.
|
|
808
|
-
|
|
809
|
-
path: Sequence[Token],
|
|
810
|
-
alias: Optional[Name],
|
|
811
|
-
path_str: str,
|
|
812
|
-
"""
|
|
759
|
+
def exit_module_path(self, node: uni.ModulePath) -> None:
|
|
813
760
|
node.gen.py_ast = [
|
|
814
761
|
self.sync(
|
|
815
762
|
ast3.alias(
|
|
@@ -819,12 +766,7 @@ class PyastGenPass(Pass):
|
|
|
819
766
|
)
|
|
820
767
|
]
|
|
821
768
|
|
|
822
|
-
def exit_module_item(self, node:
|
|
823
|
-
"""Sub objects.
|
|
824
|
-
|
|
825
|
-
name: Name,
|
|
826
|
-
alias: Optional[Name],
|
|
827
|
-
"""
|
|
769
|
+
def exit_module_item(self, node: uni.ModuleItem) -> None:
|
|
828
770
|
node.gen.py_ast = [
|
|
829
771
|
self.sync(
|
|
830
772
|
ast3.alias(
|
|
@@ -834,97 +776,75 @@ class PyastGenPass(Pass):
|
|
|
834
776
|
)
|
|
835
777
|
]
|
|
836
778
|
|
|
837
|
-
def
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
name: Name,
|
|
841
|
-
arch_type: Token,
|
|
842
|
-
access: Optional[SubTag[Token]],
|
|
843
|
-
base_classes: Optional[SubNodeList[AtomType]],
|
|
844
|
-
body: Optional[SubNodeList[ArchBlockStmt] | ArchDef],
|
|
845
|
-
doc: Optional[String],
|
|
846
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
847
|
-
"""
|
|
848
|
-
if isinstance(node.body, ast.AstImplOnlyNode):
|
|
779
|
+
def enter_archetype(self, node: uni.Archetype) -> None:
|
|
780
|
+
if isinstance(node.body, uni.ImplDef):
|
|
849
781
|
self.traverse(node.body)
|
|
850
782
|
|
|
851
|
-
def
|
|
852
|
-
"""Sub objects.
|
|
853
|
-
|
|
854
|
-
name: Name,
|
|
855
|
-
arch_type: Token,
|
|
856
|
-
access: Optional[SubTag[Token]],
|
|
857
|
-
base_classes: Optional[SubNodeList[AtomType]],
|
|
858
|
-
body: Optional[SubNodeList[ArchBlockStmt] | ArchDef],
|
|
859
|
-
doc: Optional[String],
|
|
860
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
861
|
-
"""
|
|
783
|
+
def exit_archetype(self, node: uni.Archetype) -> None:
|
|
862
784
|
body = self.resolve_stmt_block(
|
|
863
|
-
|
|
785
|
+
(
|
|
786
|
+
node.body.body
|
|
787
|
+
if isinstance(node.body, uni.ImplDef)
|
|
788
|
+
and isinstance(node.body.body, uni.SubNodeList)
|
|
789
|
+
else node.body if isinstance(node.body, uni.SubNodeList) else None
|
|
790
|
+
),
|
|
864
791
|
doc=node.doc,
|
|
865
792
|
)
|
|
793
|
+
|
|
794
|
+
if node.is_async:
|
|
795
|
+
body.insert(
|
|
796
|
+
0,
|
|
797
|
+
self.sync(
|
|
798
|
+
ast3.Assign(
|
|
799
|
+
targets=[
|
|
800
|
+
self.sync(ast3.Name(id="__jac_async__", ctx=ast3.Store()))
|
|
801
|
+
],
|
|
802
|
+
value=self.sync(ast3.Constant(value=node.is_async)),
|
|
803
|
+
)
|
|
804
|
+
),
|
|
805
|
+
)
|
|
806
|
+
|
|
866
807
|
decorators = (
|
|
867
808
|
node.decorators.gen.py_ast
|
|
868
|
-
if isinstance(node.decorators,
|
|
809
|
+
if isinstance(node.decorators, uni.SubNodeList)
|
|
869
810
|
else []
|
|
870
811
|
)
|
|
871
812
|
|
|
872
813
|
base_classes = node.base_classes.gen.py_ast if node.base_classes else []
|
|
873
814
|
if node.arch_type.name != Tok.KW_CLASS:
|
|
874
815
|
base_classes.append(self.jaclib_obj(node.arch_type.value.capitalize()))
|
|
816
|
+
|
|
875
817
|
node.gen.py_ast = [
|
|
876
818
|
self.sync(
|
|
877
819
|
ast3.ClassDef(
|
|
878
820
|
name=node.name.sym_name,
|
|
879
|
-
bases=base_classes,
|
|
821
|
+
bases=[cast(ast3.expr, i) for i in base_classes],
|
|
880
822
|
keywords=[],
|
|
881
|
-
body=body,
|
|
882
|
-
decorator_list=decorators,
|
|
823
|
+
body=[cast(ast3.stmt, i) for i in body],
|
|
824
|
+
decorator_list=[cast(ast3.expr, i) for i in decorators],
|
|
883
825
|
type_params=[],
|
|
884
826
|
)
|
|
885
827
|
)
|
|
886
828
|
]
|
|
887
829
|
|
|
888
|
-
def
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
target: ArchRefChain,
|
|
892
|
-
body: SubNodeList[ArchBlockStmt],
|
|
893
|
-
doc: Optional[String],
|
|
894
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
895
|
-
"""
|
|
896
|
-
|
|
897
|
-
def enter_enum(self, node: ast.Enum) -> None:
|
|
898
|
-
"""Sub objects.
|
|
899
|
-
|
|
900
|
-
name: Name,
|
|
901
|
-
access: Optional[SubTag[Token]],
|
|
902
|
-
base_classes: Optional[SubNodeList[AtomType]],
|
|
903
|
-
body: Optional[SubNodeList[EnumBlockStmt] | EnumDef],
|
|
904
|
-
doc: Optional[String],
|
|
905
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
906
|
-
"""
|
|
907
|
-
if isinstance(node.body, ast.AstImplOnlyNode):
|
|
830
|
+
def enter_enum(self, node: uni.Enum) -> None:
|
|
831
|
+
if isinstance(node.body, uni.ImplDef):
|
|
908
832
|
self.traverse(node.body)
|
|
909
833
|
|
|
910
|
-
def exit_enum(self, node:
|
|
911
|
-
"""Sub objects.
|
|
912
|
-
|
|
913
|
-
name: Name,
|
|
914
|
-
access: Optional[SubTag[Token]],
|
|
915
|
-
base_classes: Optional[Optional[SubNodeList[AtomType]]],
|
|
916
|
-
body: Optional[SubNodeList[EnumBlockStmt] | EnumDef],
|
|
917
|
-
doc: Optional[String],
|
|
918
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
919
|
-
"""
|
|
834
|
+
def exit_enum(self, node: uni.Enum) -> None:
|
|
920
835
|
self.needs_enum()
|
|
921
836
|
body = self.resolve_stmt_block(
|
|
922
|
-
|
|
837
|
+
(
|
|
838
|
+
node.body.body
|
|
839
|
+
if isinstance(node.body, uni.ImplDef)
|
|
840
|
+
and isinstance(node.body.body, uni.SubNodeList)
|
|
841
|
+
else node.body if isinstance(node.body, uni.SubNodeList) else None
|
|
842
|
+
),
|
|
923
843
|
doc=node.doc,
|
|
924
844
|
)
|
|
925
845
|
decorators = (
|
|
926
846
|
node.decorators.gen.py_ast
|
|
927
|
-
if isinstance(node.decorators,
|
|
847
|
+
if isinstance(node.decorators, uni.SubNodeList)
|
|
928
848
|
else []
|
|
929
849
|
)
|
|
930
850
|
base_classes = node.base_classes.gen.py_ast if node.base_classes else []
|
|
@@ -936,70 +856,38 @@ class PyastGenPass(Pass):
|
|
|
936
856
|
self.sync(
|
|
937
857
|
ast3.ClassDef(
|
|
938
858
|
name=node.name.sym_name,
|
|
939
|
-
bases=base_classes,
|
|
859
|
+
bases=[cast(ast3.expr, i) for i in base_classes],
|
|
940
860
|
keywords=[],
|
|
941
|
-
body=body,
|
|
942
|
-
decorator_list=decorators,
|
|
861
|
+
body=[cast(ast3.stmt, i) for i in body],
|
|
862
|
+
decorator_list=[cast(ast3.expr, i) for i in decorators],
|
|
943
863
|
type_params=[],
|
|
944
864
|
)
|
|
945
865
|
)
|
|
946
866
|
]
|
|
947
867
|
|
|
948
|
-
def
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
target: ArchRefChain,
|
|
952
|
-
body: SubNodeList[EnumBlockStmt],
|
|
953
|
-
doc: Optional[String],
|
|
954
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
955
|
-
"""
|
|
956
|
-
|
|
957
|
-
def enter_ability(self, node: ast.Ability) -> None:
|
|
958
|
-
"""Sub objects.
|
|
959
|
-
|
|
960
|
-
name_ref: NameType,
|
|
961
|
-
is_func: bool,
|
|
962
|
-
is_async: bool,
|
|
963
|
-
is_static: bool,
|
|
964
|
-
is_abstract: bool,
|
|
965
|
-
access: Optional[SubTag[Token]],
|
|
966
|
-
signature: Optional[FuncSignature | ExprType | EventSignature],
|
|
967
|
-
body: Optional[SubNodeList[CodeBlockStmt] | AbilityDef | FuncCall],
|
|
968
|
-
doc: Optional[String],
|
|
969
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
970
|
-
"""
|
|
971
|
-
if isinstance(node.body, ast.AstImplOnlyNode):
|
|
868
|
+
def enter_ability(self, node: uni.Ability) -> None:
|
|
869
|
+
if isinstance(node.body, uni.ImplDef):
|
|
972
870
|
self.traverse(node.body)
|
|
973
871
|
|
|
974
|
-
def gen_llm_body(self, node:
|
|
872
|
+
def gen_llm_body(self, node: uni.Ability) -> list[ast3.AST]:
|
|
975
873
|
"""Generate the by LLM body."""
|
|
976
874
|
# to Avoid circular import
|
|
977
|
-
from jaclang.
|
|
978
|
-
|
|
979
|
-
return JacFeature.gen_llm_body(self, node)
|
|
875
|
+
from jaclang.runtimelib.machine import JacMachineInterface
|
|
980
876
|
|
|
981
|
-
|
|
982
|
-
"""Sub objects.
|
|
877
|
+
return JacMachineInterface.gen_llm_body(self, node)
|
|
983
878
|
|
|
984
|
-
|
|
985
|
-
is_func: bool,
|
|
986
|
-
is_async: bool,
|
|
987
|
-
is_static: bool,
|
|
988
|
-
is_abstract: bool,
|
|
989
|
-
access: Optional[SubTag[Token]],
|
|
990
|
-
signature: Optional[FuncSignature | ExprType | EventSignature],
|
|
991
|
-
body: Optional[SubNodeList[CodeBlockStmt] | AbilityDef | FuncCall],
|
|
992
|
-
doc: Optional[String],
|
|
993
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
994
|
-
"""
|
|
879
|
+
def exit_ability(self, node: uni.Ability) -> None:
|
|
995
880
|
func_type = ast3.AsyncFunctionDef if node.is_async else ast3.FunctionDef
|
|
996
881
|
body = (
|
|
997
882
|
self.gen_llm_body(node)
|
|
998
|
-
if isinstance(node.body,
|
|
883
|
+
if isinstance(node.body, uni.FuncCall)
|
|
884
|
+
or isinstance(node.body, uni.ImplDef)
|
|
885
|
+
and isinstance(node.body.body, uni.FuncCall)
|
|
999
886
|
else (
|
|
1000
887
|
[
|
|
1001
888
|
self.sync(
|
|
1002
|
-
ast3.Expr(value=node.doc.gen.py_ast[0]),
|
|
889
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
890
|
+
jac_node=node.doc,
|
|
1003
891
|
),
|
|
1004
892
|
self.sync(ast3.Pass(), node.body),
|
|
1005
893
|
]
|
|
@@ -1010,7 +898,8 @@ class PyastGenPass(Pass):
|
|
|
1010
898
|
else self.resolve_stmt_block(
|
|
1011
899
|
(
|
|
1012
900
|
node.body.body
|
|
1013
|
-
if isinstance(node.body,
|
|
901
|
+
if isinstance(node.body, uni.ImplDef)
|
|
902
|
+
and isinstance(node.body.body, uni.SubNodeList)
|
|
1014
903
|
else node.body
|
|
1015
904
|
),
|
|
1016
905
|
doc=node.doc,
|
|
@@ -1019,57 +908,71 @@ class PyastGenPass(Pass):
|
|
|
1019
908
|
)
|
|
1020
909
|
)
|
|
1021
910
|
if node.is_abstract and node.body:
|
|
1022
|
-
self.
|
|
911
|
+
self.log_error(
|
|
1023
912
|
f"Abstract ability {node.sym_name} should not have a body.",
|
|
1024
913
|
node,
|
|
1025
914
|
)
|
|
1026
915
|
decorator_list = node.decorators.gen.py_ast if node.decorators else []
|
|
1027
|
-
if isinstance(node.signature,
|
|
916
|
+
if isinstance(node.signature, uni.EventSignature):
|
|
1028
917
|
decorator_list.append(
|
|
1029
918
|
self.jaclib_obj(
|
|
1030
|
-
"
|
|
1031
|
-
if node.signature.event.name == Tok.KW_ENTRY
|
|
1032
|
-
else "with_exit"
|
|
919
|
+
"entry" if node.signature.event.name == Tok.KW_ENTRY else "exit"
|
|
1033
920
|
)
|
|
1034
921
|
)
|
|
1035
922
|
|
|
1036
|
-
if isinstance(node.body,
|
|
923
|
+
if isinstance(node.body, uni.ImplDef):
|
|
1037
924
|
decorator_list.append(
|
|
1038
925
|
self.sync(
|
|
1039
926
|
ast3.Call(
|
|
1040
|
-
func=self.
|
|
1041
|
-
ast3.Attribute(
|
|
1042
|
-
self.jaclib_obj("Jac"),
|
|
1043
|
-
attr="impl_patch_filename",
|
|
1044
|
-
ctx=ast3.Load(),
|
|
1045
|
-
),
|
|
1046
|
-
),
|
|
927
|
+
func=self.jaclib_obj("impl_patch_filename"),
|
|
1047
928
|
args=[self.sync(ast3.Constant(value=node.body.loc.mod_path))],
|
|
1048
929
|
keywords=[],
|
|
1049
930
|
)
|
|
1050
931
|
)
|
|
1051
932
|
)
|
|
1052
933
|
if node.is_abstract:
|
|
1053
|
-
decorator_list.append(
|
|
934
|
+
decorator_list.append(
|
|
935
|
+
self.sync(ast3.Name(id="abstractmethod", ctx=ast3.Load()))
|
|
936
|
+
)
|
|
1054
937
|
if node.is_override:
|
|
1055
|
-
decorator_list.append(self.
|
|
938
|
+
decorator_list.append(self.sync(ast3.Name(id="override", ctx=ast3.Load())))
|
|
1056
939
|
if node.is_static:
|
|
1057
940
|
decorator_list.insert(
|
|
1058
941
|
0, self.sync(ast3.Name(id="staticmethod", ctx=ast3.Load()))
|
|
1059
942
|
)
|
|
1060
|
-
if not body and not isinstance(node.body,
|
|
1061
|
-
self.
|
|
943
|
+
if not body and not isinstance(node.body, uni.FuncCall):
|
|
944
|
+
self.log_error(
|
|
945
|
+
"Ability has no body. Perhaps an impl must be imported.", node
|
|
946
|
+
)
|
|
1062
947
|
body = [self.sync(ast3.Pass(), node)]
|
|
1063
948
|
|
|
1064
949
|
node.gen.py_ast = [
|
|
1065
950
|
self.sync(
|
|
1066
951
|
func_type(
|
|
1067
952
|
name=node.name_ref.sym_name,
|
|
1068
|
-
args=
|
|
1069
|
-
|
|
1070
|
-
|
|
953
|
+
args=(
|
|
954
|
+
cast(ast3.arguments, node.signature.gen.py_ast[0])
|
|
955
|
+
if node.signature
|
|
956
|
+
else self.sync(
|
|
957
|
+
ast3.arguments(
|
|
958
|
+
posonlyargs=[],
|
|
959
|
+
args=(
|
|
960
|
+
[self.sync(ast3.arg(arg="self", annotation=None))]
|
|
961
|
+
if node.is_method
|
|
962
|
+
else []
|
|
963
|
+
),
|
|
964
|
+
vararg=None,
|
|
965
|
+
kwonlyargs=[],
|
|
966
|
+
kw_defaults=[],
|
|
967
|
+
kwarg=None,
|
|
968
|
+
defaults=[],
|
|
969
|
+
)
|
|
970
|
+
)
|
|
971
|
+
),
|
|
972
|
+
body=[cast(ast3.stmt, i) for i in body],
|
|
973
|
+
decorator_list=[cast(ast3.expr, i) for i in decorator_list],
|
|
1071
974
|
returns=(
|
|
1072
|
-
node.signature.return_type.gen.py_ast[0]
|
|
975
|
+
cast(ast3.expr, node.signature.return_type.gen.py_ast[0])
|
|
1073
976
|
if node.signature and node.signature.return_type
|
|
1074
977
|
else self.sync(ast3.Constant(value=None))
|
|
1075
978
|
),
|
|
@@ -1078,30 +981,21 @@ class PyastGenPass(Pass):
|
|
|
1078
981
|
)
|
|
1079
982
|
]
|
|
1080
983
|
|
|
1081
|
-
def
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
target: ArchRefChain,
|
|
1085
|
-
signature: FuncSignature | EventSignature,
|
|
1086
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1087
|
-
doc: Optional[String],
|
|
1088
|
-
decorators: Optional[SubNodeList[ExprType]],
|
|
1089
|
-
"""
|
|
1090
|
-
|
|
1091
|
-
def exit_func_signature(self, node: ast.FuncSignature) -> None:
|
|
1092
|
-
"""Sub objects.
|
|
984
|
+
def exit_impl_def(self, node: uni.ImplDef) -> None:
|
|
985
|
+
pass
|
|
1093
986
|
|
|
1094
|
-
|
|
1095
|
-
return_type: Optional[SubTag[ExprType]],
|
|
1096
|
-
"""
|
|
987
|
+
def exit_func_signature(self, node: uni.FuncSignature) -> None:
|
|
1097
988
|
params = (
|
|
1098
989
|
[self.sync(ast3.arg(arg="self", annotation=None))]
|
|
1099
|
-
if
|
|
990
|
+
if (abl := node.find_parent_of_type(uni.Ability))
|
|
991
|
+
and abl.is_method
|
|
992
|
+
and not node.is_static
|
|
993
|
+
and not node.is_in_py_class
|
|
1100
994
|
else []
|
|
1101
995
|
)
|
|
1102
996
|
vararg = None
|
|
1103
997
|
kwarg = None
|
|
1104
|
-
if isinstance(node.params,
|
|
998
|
+
if isinstance(node.params, uni.SubNodeList):
|
|
1105
999
|
for i in node.params.items:
|
|
1106
1000
|
if i.unpack and i.unpack.value == "*":
|
|
1107
1001
|
vararg = i.gen.py_ast[0]
|
|
@@ -1122,28 +1016,24 @@ class PyastGenPass(Pass):
|
|
|
1122
1016
|
self.sync(
|
|
1123
1017
|
ast3.arguments(
|
|
1124
1018
|
posonlyargs=[],
|
|
1125
|
-
args=params,
|
|
1019
|
+
args=[cast(ast3.arg, param) for param in params],
|
|
1126
1020
|
kwonlyargs=[],
|
|
1127
|
-
vararg=vararg,
|
|
1128
|
-
kwarg=kwarg,
|
|
1021
|
+
vararg=cast(ast3.arg, vararg) if vararg else None,
|
|
1022
|
+
kwarg=cast(ast3.arg, kwarg) if kwarg else None,
|
|
1129
1023
|
kw_defaults=[],
|
|
1130
|
-
defaults=defaults,
|
|
1024
|
+
defaults=[cast(ast3.expr, default) for default in defaults],
|
|
1131
1025
|
)
|
|
1132
1026
|
)
|
|
1133
1027
|
]
|
|
1134
1028
|
|
|
1135
|
-
def exit_event_signature(self, node:
|
|
1136
|
-
"""Sub objects.
|
|
1137
|
-
|
|
1138
|
-
event: Token,
|
|
1139
|
-
arch_tag_info: Optional[ExprType],
|
|
1140
|
-
return_type: Optional[SubTag[ExprType]],
|
|
1141
|
-
"""
|
|
1029
|
+
def exit_event_signature(self, node: uni.EventSignature) -> None:
|
|
1142
1030
|
here = self.sync(
|
|
1143
1031
|
ast3.arg(
|
|
1144
1032
|
arg=f"{Con.HERE.value}",
|
|
1145
1033
|
annotation=(
|
|
1146
|
-
node.arch_tag_info.gen.py_ast[0]
|
|
1034
|
+
cast(ast3.expr, node.arch_tag_info.gen.py_ast[0])
|
|
1035
|
+
if node.arch_tag_info
|
|
1036
|
+
else None
|
|
1147
1037
|
),
|
|
1148
1038
|
),
|
|
1149
1039
|
jac_node=node.arch_tag_info if node.arch_tag_info else node,
|
|
@@ -1154,97 +1044,57 @@ class PyastGenPass(Pass):
|
|
|
1154
1044
|
posonlyargs=[],
|
|
1155
1045
|
args=(
|
|
1156
1046
|
[self.sync(ast3.arg(arg="self", annotation=None)), here]
|
|
1157
|
-
if node.
|
|
1047
|
+
if (abl := node.find_parent_of_type(uni.Ability))
|
|
1048
|
+
and abl.is_method
|
|
1158
1049
|
else [here]
|
|
1159
1050
|
),
|
|
1160
1051
|
kwonlyargs=[],
|
|
1161
1052
|
vararg=None,
|
|
1162
|
-
|
|
1053
|
+
kwarg=None,
|
|
1163
1054
|
kw_defaults=[],
|
|
1164
1055
|
defaults=[],
|
|
1165
1056
|
)
|
|
1166
1057
|
)
|
|
1167
1058
|
]
|
|
1168
1059
|
|
|
1169
|
-
def
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
if node.arch_type.name == Tok.TYPE_OP:
|
|
1176
|
-
if (
|
|
1177
|
-
isinstance(node.arch_name, ast.SpecialVarRef)
|
|
1178
|
-
and node.arch_name.orig.name == Tok.KW_ROOT
|
|
1179
|
-
):
|
|
1180
|
-
node.gen.py_ast = [self.jaclib_obj("Root")]
|
|
1181
|
-
else:
|
|
1182
|
-
self.needs_typing()
|
|
1183
|
-
node.gen.py_ast = [
|
|
1184
|
-
self.sync(
|
|
1185
|
-
ast3.Attribute(
|
|
1186
|
-
value=self.sync(ast3.Name(id="typing", ctx=ast3.Load())),
|
|
1187
|
-
attr=node.arch_name.sym_name,
|
|
1188
|
-
ctx=ast3.Load(),
|
|
1189
|
-
)
|
|
1190
|
-
)
|
|
1191
|
-
]
|
|
1060
|
+
def exit_type_ref(self, node: uni.TypeRef) -> None:
|
|
1061
|
+
if (
|
|
1062
|
+
isinstance(node.target, uni.SpecialVarRef)
|
|
1063
|
+
and node.target.orig.name == Tok.KW_ROOT
|
|
1064
|
+
):
|
|
1065
|
+
node.gen.py_ast = [self.jaclib_obj("Root")]
|
|
1192
1066
|
else:
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1067
|
+
self.needs_typing()
|
|
1068
|
+
node.gen.py_ast = [
|
|
1069
|
+
self.sync(
|
|
1070
|
+
ast3.Attribute(
|
|
1071
|
+
value=self.sync(ast3.Name(id="typing", ctx=ast3.Load())),
|
|
1072
|
+
attr=node.target.sym_name,
|
|
1073
|
+
ctx=ast3.Load(),
|
|
1074
|
+
)
|
|
1075
|
+
)
|
|
1076
|
+
]
|
|
1200
1077
|
|
|
1201
|
-
|
|
1202
|
-
"""Make attr chain."""
|
|
1203
|
-
if len(arch) == 0:
|
|
1204
|
-
return []
|
|
1205
|
-
if len(arch) == 1 and isinstance(arch[0].gen.py_ast, ast3.AST):
|
|
1206
|
-
return arch[0].gen.py_ast
|
|
1207
|
-
cur = arch[-1]
|
|
1208
|
-
attr = self.sync(
|
|
1209
|
-
ast3.Attribute(
|
|
1210
|
-
value=make_attr_chain(arch[:-1]),
|
|
1211
|
-
attr=cur.arch_name.sym_name,
|
|
1212
|
-
ctx=ast3.Load(),
|
|
1213
|
-
),
|
|
1214
|
-
jac_node=cur,
|
|
1215
|
-
)
|
|
1216
|
-
return [attr]
|
|
1217
|
-
|
|
1218
|
-
node.gen.py_ast = make_attr_chain(node.archs)
|
|
1219
|
-
|
|
1220
|
-
def exit_param_var(self, node: ast.ParamVar) -> None:
|
|
1221
|
-
"""Sub objects.
|
|
1222
|
-
|
|
1223
|
-
name: Name,
|
|
1224
|
-
unpack: Optional[Token],
|
|
1225
|
-
type_tag: SubTag[ExprType],
|
|
1226
|
-
value: Optional[ExprType],
|
|
1227
|
-
"""
|
|
1078
|
+
def exit_param_var(self, node: uni.ParamVar) -> None:
|
|
1228
1079
|
node.gen.py_ast = [
|
|
1229
1080
|
self.sync(
|
|
1230
1081
|
ast3.arg(
|
|
1231
1082
|
arg=node.name.sym_name,
|
|
1232
|
-
annotation=
|
|
1083
|
+
annotation=(
|
|
1084
|
+
cast(ast3.expr, node.type_tag.gen.py_ast[0])
|
|
1085
|
+
if node.type_tag
|
|
1086
|
+
else None
|
|
1087
|
+
),
|
|
1233
1088
|
)
|
|
1234
1089
|
)
|
|
1235
1090
|
]
|
|
1236
1091
|
|
|
1237
|
-
def exit_arch_has(self, node:
|
|
1238
|
-
"""Sub objects.
|
|
1239
|
-
|
|
1240
|
-
is_static: bool,
|
|
1241
|
-
access: Optional[SubTag[Token]],
|
|
1242
|
-
vars: SubNodeList[HasVar],
|
|
1243
|
-
is_frozen: bool,
|
|
1244
|
-
doc: Optional[String],
|
|
1245
|
-
"""
|
|
1092
|
+
def exit_arch_has(self, node: uni.ArchHas) -> None:
|
|
1246
1093
|
if node.doc:
|
|
1247
|
-
doc = self.sync(
|
|
1094
|
+
doc = self.sync(
|
|
1095
|
+
ast3.Expr(value=cast(ast3.expr, node.doc.gen.py_ast[0])),
|
|
1096
|
+
jac_node=node.doc,
|
|
1097
|
+
)
|
|
1248
1098
|
if isinstance(doc, ast3.AST) and isinstance(node.vars.gen.py_ast, list):
|
|
1249
1099
|
node.gen.py_ast = [doc] + node.vars.gen.py_ast
|
|
1250
1100
|
else:
|
|
@@ -1252,188 +1102,161 @@ class PyastGenPass(Pass):
|
|
|
1252
1102
|
else:
|
|
1253
1103
|
node.gen.py_ast = node.vars.gen.py_ast # TODO: This is a list
|
|
1254
1104
|
|
|
1255
|
-
def exit_has_var(self, node:
|
|
1256
|
-
"""Sub objects.
|
|
1257
|
-
|
|
1258
|
-
name: Name,
|
|
1259
|
-
type_tag: SubTag[Expr],
|
|
1260
|
-
value: Optional[Expr],
|
|
1261
|
-
semstr: Optional[String] = None,
|
|
1262
|
-
"""
|
|
1105
|
+
def exit_has_var(self, node: uni.HasVar) -> None:
|
|
1263
1106
|
annotation = node.type_tag.gen.py_ast[0] if node.type_tag else None
|
|
1107
|
+
|
|
1264
1108
|
is_static_var = (
|
|
1265
1109
|
node.parent
|
|
1266
1110
|
and node.parent.parent
|
|
1267
|
-
and isinstance(node.parent.parent,
|
|
1111
|
+
and isinstance(node.parent.parent, uni.ArchHas)
|
|
1268
1112
|
and node.parent.parent.is_static
|
|
1269
1113
|
)
|
|
1114
|
+
|
|
1270
1115
|
is_in_class = (
|
|
1271
1116
|
node.parent
|
|
1272
1117
|
and node.parent.parent
|
|
1273
1118
|
and node.parent.parent.parent
|
|
1274
1119
|
and (
|
|
1275
1120
|
(
|
|
1276
|
-
isinstance(node.parent.parent.parent,
|
|
1121
|
+
isinstance(node.parent.parent.parent, uni.Archetype)
|
|
1277
1122
|
and node.parent.parent.parent.arch_type.name == Tok.KW_CLASS
|
|
1278
1123
|
)
|
|
1279
1124
|
or (
|
|
1280
1125
|
node.parent.parent.parent.parent
|
|
1281
|
-
and isinstance(node.parent.parent.parent.parent,
|
|
1126
|
+
and isinstance(node.parent.parent.parent.parent, uni.Archetype)
|
|
1282
1127
|
and node.parent.parent.parent.parent.arch_type.name == Tok.KW_CLASS
|
|
1283
1128
|
)
|
|
1284
1129
|
)
|
|
1285
1130
|
)
|
|
1286
|
-
|
|
1131
|
+
|
|
1132
|
+
value = None
|
|
1133
|
+
|
|
1134
|
+
if is_in_class:
|
|
1135
|
+
value = cast(ast3.expr, node.value.gen.py_ast[0]) if node.value else None
|
|
1136
|
+
elif is_static_var:
|
|
1287
1137
|
annotation = self.sync(
|
|
1288
1138
|
ast3.Subscript(
|
|
1289
|
-
value=self.
|
|
1290
|
-
slice=annotation,
|
|
1139
|
+
value=self.sync(ast3.Name(id="ClassVar", ctx=ast3.Load())),
|
|
1140
|
+
slice=cast(ast3.expr, annotation),
|
|
1291
1141
|
ctx=ast3.Load(),
|
|
1292
1142
|
)
|
|
1293
1143
|
)
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1144
|
+
value = cast(ast3.expr, node.value.gen.py_ast[0]) if node.value else None
|
|
1145
|
+
elif node.defer:
|
|
1146
|
+
value = self.sync(
|
|
1147
|
+
ast3.Call(
|
|
1148
|
+
func=self.jaclib_obj("field"),
|
|
1149
|
+
args=[],
|
|
1150
|
+
keywords=[
|
|
1151
|
+
self.sync(
|
|
1152
|
+
ast3.keyword(
|
|
1153
|
+
arg="init",
|
|
1154
|
+
value=self.sync(ast3.Constant(value=False)),
|
|
1155
|
+
)
|
|
1156
|
+
)
|
|
1157
|
+
],
|
|
1158
|
+
),
|
|
1159
|
+
)
|
|
1160
|
+
elif node.value:
|
|
1161
|
+
if isinstance(node.value.gen.py_ast[0], ast3.Constant):
|
|
1162
|
+
value = cast(ast3.expr, node.value.gen.py_ast[0])
|
|
1163
|
+
else:
|
|
1164
|
+
value = self.sync(
|
|
1165
|
+
ast3.Call(
|
|
1166
|
+
func=self.jaclib_obj("field"),
|
|
1167
|
+
args=[],
|
|
1168
|
+
keywords=[
|
|
1303
1169
|
self.sync(
|
|
1304
|
-
ast3.
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
arg="gen",
|
|
1318
|
-
value=self.sync(
|
|
1319
|
-
ast3.Lambda(
|
|
1320
|
-
args=self.sync(
|
|
1321
|
-
ast3.arguments(
|
|
1322
|
-
posonlyargs=[],
|
|
1323
|
-
args=[],
|
|
1324
|
-
kwonlyargs=[],
|
|
1325
|
-
vararg=None,
|
|
1326
|
-
kwargs=None,
|
|
1327
|
-
kw_defaults=[],
|
|
1328
|
-
defaults=[],
|
|
1329
|
-
)
|
|
1330
|
-
),
|
|
1331
|
-
body=node.value.gen.py_ast[
|
|
1332
|
-
0
|
|
1333
|
-
],
|
|
1334
|
-
)
|
|
1335
|
-
),
|
|
1170
|
+
ast3.keyword(
|
|
1171
|
+
arg="factory",
|
|
1172
|
+
value=self.sync(
|
|
1173
|
+
ast3.Lambda(
|
|
1174
|
+
args=self.sync(
|
|
1175
|
+
ast3.arguments(
|
|
1176
|
+
posonlyargs=[],
|
|
1177
|
+
args=[],
|
|
1178
|
+
kwonlyargs=[],
|
|
1179
|
+
vararg=None,
|
|
1180
|
+
kwarg=None,
|
|
1181
|
+
kw_defaults=[],
|
|
1182
|
+
defaults=[],
|
|
1336
1183
|
)
|
|
1337
|
-
)
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1184
|
+
),
|
|
1185
|
+
body=cast(
|
|
1186
|
+
ast3.expr,
|
|
1187
|
+
node.value.gen.py_ast[0],
|
|
1188
|
+
),
|
|
1341
1189
|
)
|
|
1342
|
-
else []
|
|
1343
1190
|
),
|
|
1344
|
-
)
|
|
1345
|
-
)
|
|
1346
|
-
if node.value
|
|
1347
|
-
and not (is_static_var or is_in_class or node.defer)
|
|
1348
|
-
else (
|
|
1349
|
-
self.sync(
|
|
1350
|
-
ast3.Call(
|
|
1351
|
-
func=self.jaclib_obj(default_field_fn_name),
|
|
1352
|
-
args=[],
|
|
1353
|
-
keywords=[
|
|
1354
|
-
self.sync(
|
|
1355
|
-
ast3.keyword(
|
|
1356
|
-
arg="postinit",
|
|
1357
|
-
value=self.sync(
|
|
1358
|
-
ast3.Constant(value=True)
|
|
1359
|
-
),
|
|
1360
|
-
)
|
|
1361
|
-
)
|
|
1362
|
-
],
|
|
1363
|
-
)
|
|
1364
|
-
)
|
|
1365
|
-
if node.defer and not (is_static_var or is_in_class)
|
|
1366
|
-
else node.value.gen.py_ast[0] if node.value else None
|
|
1191
|
+
),
|
|
1367
1192
|
)
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1193
|
+
],
|
|
1194
|
+
),
|
|
1195
|
+
)
|
|
1196
|
+
|
|
1197
|
+
node.gen.py_ast = [
|
|
1198
|
+
self.sync(
|
|
1199
|
+
ast3.AnnAssign(
|
|
1200
|
+
target=cast(
|
|
1201
|
+
ast3.Name | ast3.Attribute | ast3.Subscript,
|
|
1202
|
+
node.name.gen.py_ast[0],
|
|
1203
|
+
),
|
|
1204
|
+
annotation=(
|
|
1205
|
+
cast(ast3.expr, annotation)
|
|
1206
|
+
if annotation
|
|
1207
|
+
else ast3.Constant(value=None)
|
|
1208
|
+
),
|
|
1209
|
+
value=value,
|
|
1210
|
+
simple=int(isinstance(node.name, uni.Name)),
|
|
1371
1211
|
)
|
|
1372
1212
|
)
|
|
1373
1213
|
]
|
|
1374
1214
|
|
|
1375
|
-
def exit_typed_ctx_block(self, node:
|
|
1376
|
-
"""Sub objects.
|
|
1377
|
-
|
|
1378
|
-
type_ctx: ExprType,
|
|
1379
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1380
|
-
"""
|
|
1215
|
+
def exit_typed_ctx_block(self, node: uni.TypedCtxBlock) -> None:
|
|
1381
1216
|
# TODO: Come back
|
|
1217
|
+
pass
|
|
1382
1218
|
|
|
1383
|
-
def exit_if_stmt(self, node:
|
|
1384
|
-
"""Sub objects.
|
|
1385
|
-
|
|
1386
|
-
condition: ExprType,
|
|
1387
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1388
|
-
else_body: Optional[ElseStmt | ElseIf],
|
|
1389
|
-
"""
|
|
1219
|
+
def exit_if_stmt(self, node: uni.IfStmt) -> None:
|
|
1390
1220
|
node.gen.py_ast = [
|
|
1391
1221
|
self.sync(
|
|
1392
1222
|
ast3.If(
|
|
1393
|
-
test=node.condition.gen.py_ast[0],
|
|
1394
|
-
body=self.resolve_stmt_block(node.body),
|
|
1395
|
-
orelse=
|
|
1223
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
1224
|
+
body=cast(list[ast3.stmt], self.resolve_stmt_block(node.body)),
|
|
1225
|
+
orelse=(
|
|
1226
|
+
cast(list[ast3.stmt], node.else_body.gen.py_ast)
|
|
1227
|
+
if node.else_body
|
|
1228
|
+
else []
|
|
1229
|
+
),
|
|
1396
1230
|
)
|
|
1397
1231
|
)
|
|
1398
1232
|
]
|
|
1399
1233
|
|
|
1400
|
-
def exit_else_if(self, node:
|
|
1401
|
-
"""Sub objects.
|
|
1402
|
-
|
|
1403
|
-
condition: ExprType,
|
|
1404
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1405
|
-
else_body: Optional[ElseStmt | ElseIf],
|
|
1406
|
-
"""
|
|
1234
|
+
def exit_else_if(self, node: uni.ElseIf) -> None:
|
|
1407
1235
|
node.gen.py_ast = [
|
|
1408
1236
|
self.sync(
|
|
1409
1237
|
ast3.If(
|
|
1410
|
-
test=node.condition.gen.py_ast[0],
|
|
1411
|
-
body=self.resolve_stmt_block(node.body),
|
|
1412
|
-
orelse=
|
|
1238
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
1239
|
+
body=cast(list[ast3.stmt], self.resolve_stmt_block(node.body)),
|
|
1240
|
+
orelse=(
|
|
1241
|
+
cast(list[ast3.stmt], node.else_body.gen.py_ast)
|
|
1242
|
+
if node.else_body
|
|
1243
|
+
else []
|
|
1244
|
+
),
|
|
1413
1245
|
)
|
|
1414
1246
|
)
|
|
1415
1247
|
]
|
|
1416
1248
|
|
|
1417
|
-
def exit_else_stmt(self, node:
|
|
1418
|
-
"""Sub objects.
|
|
1419
|
-
|
|
1420
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1421
|
-
"""
|
|
1249
|
+
def exit_else_stmt(self, node: uni.ElseStmt) -> None:
|
|
1422
1250
|
node.gen.py_ast = self.resolve_stmt_block(node.body)
|
|
1423
1251
|
|
|
1424
|
-
def exit_expr_stmt(self, node:
|
|
1425
|
-
"""Sub objects.
|
|
1426
|
-
|
|
1427
|
-
expr: ExprType,
|
|
1428
|
-
in_fstring: bool,
|
|
1429
|
-
"""
|
|
1252
|
+
def exit_expr_stmt(self, node: uni.ExprStmt) -> None:
|
|
1430
1253
|
node.gen.py_ast = [
|
|
1431
1254
|
(
|
|
1432
|
-
self.sync(ast3.Expr(value=node.expr.gen.py_ast[0]))
|
|
1255
|
+
self.sync(ast3.Expr(value=cast(ast3.expr, node.expr.gen.py_ast[0])))
|
|
1433
1256
|
if not node.in_fstring
|
|
1434
1257
|
else self.sync(
|
|
1435
1258
|
ast3.FormattedValue(
|
|
1436
|
-
value=node.expr.gen.py_ast[0],
|
|
1259
|
+
value=cast(ast3.expr, node.expr.gen.py_ast[0]),
|
|
1437
1260
|
conversion=-1,
|
|
1438
1261
|
format_spec=None,
|
|
1439
1262
|
)
|
|
@@ -1441,59 +1264,96 @@ class PyastGenPass(Pass):
|
|
|
1441
1264
|
)
|
|
1442
1265
|
]
|
|
1443
1266
|
|
|
1444
|
-
def
|
|
1445
|
-
""
|
|
1267
|
+
def exit_concurrent_expr(self, node: uni.ConcurrentExpr) -> None:
|
|
1268
|
+
func = ""
|
|
1269
|
+
if node.tok:
|
|
1270
|
+
match node.tok.value:
|
|
1271
|
+
case "flow":
|
|
1272
|
+
func = "thread_run"
|
|
1273
|
+
case "wait":
|
|
1274
|
+
func = "thread_wait"
|
|
1275
|
+
if func:
|
|
1276
|
+
lambda_ex = [
|
|
1277
|
+
self.sync(
|
|
1278
|
+
ast3.Lambda(
|
|
1279
|
+
args=(
|
|
1280
|
+
self.sync(
|
|
1281
|
+
ast3.arguments(
|
|
1282
|
+
posonlyargs=[],
|
|
1283
|
+
args=[],
|
|
1284
|
+
kwonlyargs=[],
|
|
1285
|
+
kw_defaults=[],
|
|
1286
|
+
defaults=[],
|
|
1287
|
+
)
|
|
1288
|
+
)
|
|
1289
|
+
),
|
|
1290
|
+
body=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
1291
|
+
)
|
|
1292
|
+
)
|
|
1293
|
+
]
|
|
1294
|
+
node.gen.py_ast = [
|
|
1295
|
+
self.sync(
|
|
1296
|
+
ast3.Call(
|
|
1297
|
+
func=self.jaclib_obj(func),
|
|
1298
|
+
args=cast(
|
|
1299
|
+
list[ast3.expr],
|
|
1300
|
+
(
|
|
1301
|
+
lambda_ex
|
|
1302
|
+
if func == "thread_run"
|
|
1303
|
+
else [node.target.gen.py_ast[0]] # type: ignore
|
|
1304
|
+
),
|
|
1305
|
+
),
|
|
1306
|
+
keywords=[],
|
|
1307
|
+
)
|
|
1308
|
+
)
|
|
1309
|
+
]
|
|
1446
1310
|
|
|
1447
|
-
|
|
1448
|
-
excepts: Optional[SubNodeList[Except]],
|
|
1449
|
-
else_body: Optional[ElseStmt],
|
|
1450
|
-
finally_body: Optional[FinallyStmt],
|
|
1451
|
-
"""
|
|
1311
|
+
def exit_try_stmt(self, node: uni.TryStmt) -> None:
|
|
1452
1312
|
node.gen.py_ast = [
|
|
1453
1313
|
self.sync(
|
|
1454
1314
|
ast3.Try(
|
|
1455
|
-
body=self.resolve_stmt_block(node.body),
|
|
1456
|
-
handlers=
|
|
1457
|
-
|
|
1458
|
-
|
|
1315
|
+
body=cast(list[ast3.stmt], self.resolve_stmt_block(node.body)),
|
|
1316
|
+
handlers=(
|
|
1317
|
+
[cast(ast3.ExceptHandler, i) for i in node.excepts.gen.py_ast]
|
|
1318
|
+
if node.excepts
|
|
1319
|
+
else []
|
|
1320
|
+
),
|
|
1321
|
+
orelse=(
|
|
1322
|
+
[cast(ast3.stmt, i) for i in node.else_body.gen.py_ast]
|
|
1323
|
+
if node.else_body
|
|
1324
|
+
else []
|
|
1325
|
+
),
|
|
1326
|
+
finalbody=(
|
|
1327
|
+
[cast(ast3.stmt, i) for i in node.finally_body.gen.py_ast]
|
|
1328
|
+
if node.finally_body
|
|
1329
|
+
else []
|
|
1330
|
+
),
|
|
1459
1331
|
)
|
|
1460
1332
|
)
|
|
1461
1333
|
]
|
|
1462
1334
|
|
|
1463
|
-
def exit_except(self, node:
|
|
1464
|
-
"""Sub objects.
|
|
1465
|
-
|
|
1466
|
-
ex_type: ExprType,
|
|
1467
|
-
name: Optional[Name],
|
|
1468
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1469
|
-
"""
|
|
1335
|
+
def exit_except(self, node: uni.Except) -> None:
|
|
1470
1336
|
node.gen.py_ast = [
|
|
1471
1337
|
self.sync(
|
|
1472
1338
|
ast3.ExceptHandler(
|
|
1473
|
-
type=
|
|
1339
|
+
type=(
|
|
1340
|
+
cast(ast3.expr, node.ex_type.gen.py_ast[0])
|
|
1341
|
+
if node.ex_type
|
|
1342
|
+
else None
|
|
1343
|
+
),
|
|
1474
1344
|
name=node.name.sym_name if node.name else None,
|
|
1475
|
-
body=
|
|
1345
|
+
body=[
|
|
1346
|
+
cast(ast3.stmt, stmt)
|
|
1347
|
+
for stmt in self.resolve_stmt_block(node.body)
|
|
1348
|
+
],
|
|
1476
1349
|
)
|
|
1477
1350
|
)
|
|
1478
1351
|
]
|
|
1479
1352
|
|
|
1480
|
-
def exit_finally_stmt(self, node:
|
|
1481
|
-
"""Sub objects.
|
|
1482
|
-
|
|
1483
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1484
|
-
"""
|
|
1353
|
+
def exit_finally_stmt(self, node: uni.FinallyStmt) -> None:
|
|
1485
1354
|
node.gen.py_ast = self.resolve_stmt_block(node.body)
|
|
1486
1355
|
|
|
1487
|
-
def exit_iter_for_stmt(self, node:
|
|
1488
|
-
"""Sub objects.
|
|
1489
|
-
|
|
1490
|
-
iter: Assignment,
|
|
1491
|
-
is_async: bool,
|
|
1492
|
-
condition: ExprType,
|
|
1493
|
-
count_by: ExprType,
|
|
1494
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1495
|
-
else_body: Optional[ElseStmt],
|
|
1496
|
-
"""
|
|
1356
|
+
def exit_iter_for_stmt(self, node: uni.IterForStmt) -> None:
|
|
1497
1357
|
py_nodes: list[ast3.AST] = []
|
|
1498
1358
|
body = node.body.gen.py_ast
|
|
1499
1359
|
if (
|
|
@@ -1508,113 +1368,113 @@ class PyastGenPass(Pass):
|
|
|
1508
1368
|
py_nodes.append(
|
|
1509
1369
|
self.sync(
|
|
1510
1370
|
ast3.While(
|
|
1511
|
-
test=node.condition.gen.py_ast[0],
|
|
1512
|
-
body=body,
|
|
1513
|
-
orelse=
|
|
1371
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
1372
|
+
body=[cast(ast3.stmt, stmt) for stmt in body],
|
|
1373
|
+
orelse=(
|
|
1374
|
+
[cast(ast3.stmt, stmt) for stmt in node.else_body.gen.py_ast]
|
|
1375
|
+
if node.else_body
|
|
1376
|
+
else []
|
|
1377
|
+
),
|
|
1514
1378
|
)
|
|
1515
1379
|
)
|
|
1516
1380
|
)
|
|
1517
1381
|
node.gen.py_ast = py_nodes
|
|
1518
1382
|
|
|
1519
|
-
def exit_in_for_stmt(self, node:
|
|
1520
|
-
"""Sub objects.
|
|
1521
|
-
|
|
1522
|
-
target: Expr,
|
|
1523
|
-
is_async: bool,
|
|
1524
|
-
collection: Expr,
|
|
1525
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1526
|
-
else_body: Optional[ElseStmt],
|
|
1527
|
-
"""
|
|
1383
|
+
def exit_in_for_stmt(self, node: uni.InForStmt) -> None:
|
|
1528
1384
|
for_node = ast3.AsyncFor if node.is_async else ast3.For
|
|
1529
1385
|
node.gen.py_ast = [
|
|
1530
1386
|
self.sync(
|
|
1531
1387
|
for_node(
|
|
1532
|
-
target=node.target.gen.py_ast[0],
|
|
1533
|
-
iter=node.collection.gen.py_ast[0],
|
|
1534
|
-
body=
|
|
1535
|
-
|
|
1388
|
+
target=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
1389
|
+
iter=cast(ast3.expr, node.collection.gen.py_ast[0]),
|
|
1390
|
+
body=[
|
|
1391
|
+
cast(ast3.stmt, stmt)
|
|
1392
|
+
for stmt in self.resolve_stmt_block(node.body)
|
|
1393
|
+
],
|
|
1394
|
+
orelse=(
|
|
1395
|
+
[cast(ast3.stmt, stmt) for stmt in node.else_body.gen.py_ast]
|
|
1396
|
+
if node.else_body
|
|
1397
|
+
else []
|
|
1398
|
+
),
|
|
1536
1399
|
)
|
|
1537
1400
|
)
|
|
1538
1401
|
]
|
|
1539
1402
|
|
|
1540
|
-
def exit_while_stmt(self, node:
|
|
1541
|
-
"""Sub objects.
|
|
1542
|
-
|
|
1543
|
-
condition: ExprType,
|
|
1544
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1545
|
-
"""
|
|
1403
|
+
def exit_while_stmt(self, node: uni.WhileStmt) -> None:
|
|
1546
1404
|
node.gen.py_ast = [
|
|
1547
1405
|
self.sync(
|
|
1548
1406
|
ast3.While(
|
|
1549
|
-
test=node.condition.gen.py_ast[0],
|
|
1550
|
-
body=
|
|
1407
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
1408
|
+
body=[
|
|
1409
|
+
cast(ast3.stmt, stmt)
|
|
1410
|
+
for stmt in self.resolve_stmt_block(node.body)
|
|
1411
|
+
],
|
|
1551
1412
|
orelse=[],
|
|
1552
1413
|
)
|
|
1553
1414
|
)
|
|
1554
1415
|
]
|
|
1555
1416
|
|
|
1556
|
-
def exit_with_stmt(self, node:
|
|
1557
|
-
"""Sub objects.
|
|
1558
|
-
|
|
1559
|
-
is_async: bool,
|
|
1560
|
-
exprs: SubNodeList[ExprAsItem],
|
|
1561
|
-
body: SubNodeList[CodeBlockStmt],
|
|
1562
|
-
"""
|
|
1417
|
+
def exit_with_stmt(self, node: uni.WithStmt) -> None:
|
|
1563
1418
|
with_node = ast3.AsyncWith if node.is_async else ast3.With
|
|
1564
1419
|
node.gen.py_ast = [
|
|
1565
1420
|
self.sync(
|
|
1566
1421
|
with_node(
|
|
1567
|
-
items=node.exprs.gen.py_ast,
|
|
1422
|
+
items=[cast(ast3.withitem, item) for item in node.exprs.gen.py_ast],
|
|
1423
|
+
body=[
|
|
1424
|
+
cast(ast3.stmt, stmt)
|
|
1425
|
+
for stmt in self.resolve_stmt_block(node.body)
|
|
1426
|
+
],
|
|
1568
1427
|
)
|
|
1569
1428
|
)
|
|
1570
1429
|
]
|
|
1571
1430
|
|
|
1572
|
-
def exit_expr_as_item(self, node:
|
|
1573
|
-
"""Sub objects.
|
|
1574
|
-
|
|
1575
|
-
expr: ExprType,
|
|
1576
|
-
alias: Optional[ExprType],
|
|
1577
|
-
"""
|
|
1431
|
+
def exit_expr_as_item(self, node: uni.ExprAsItem) -> None:
|
|
1578
1432
|
node.gen.py_ast = [
|
|
1579
1433
|
self.sync(
|
|
1580
1434
|
ast3.withitem(
|
|
1581
|
-
context_expr=node.expr.gen.py_ast[0],
|
|
1582
|
-
optional_vars=
|
|
1435
|
+
context_expr=cast(ast3.expr, node.expr.gen.py_ast[0]),
|
|
1436
|
+
optional_vars=(
|
|
1437
|
+
cast(ast3.expr, node.alias.gen.py_ast[0])
|
|
1438
|
+
if node.alias
|
|
1439
|
+
else None
|
|
1440
|
+
),
|
|
1583
1441
|
)
|
|
1584
1442
|
)
|
|
1585
1443
|
]
|
|
1586
1444
|
|
|
1587
|
-
def exit_raise_stmt(self, node:
|
|
1588
|
-
"""Sub objects.
|
|
1589
|
-
|
|
1590
|
-
cause: Optional[ExprType],
|
|
1591
|
-
from_target: Optional[ExprType],
|
|
1592
|
-
"""
|
|
1445
|
+
def exit_raise_stmt(self, node: uni.RaiseStmt) -> None:
|
|
1593
1446
|
node.gen.py_ast = [
|
|
1594
1447
|
self.sync(
|
|
1595
1448
|
ast3.Raise(
|
|
1596
|
-
exc=
|
|
1597
|
-
|
|
1449
|
+
exc=(
|
|
1450
|
+
cast(ast3.expr, node.cause.gen.py_ast[0])
|
|
1451
|
+
if node.cause
|
|
1452
|
+
else None
|
|
1453
|
+
),
|
|
1454
|
+
cause=(
|
|
1455
|
+
cast(ast3.expr, node.from_target.gen.py_ast[0])
|
|
1456
|
+
if node.from_target
|
|
1457
|
+
else None
|
|
1458
|
+
),
|
|
1598
1459
|
)
|
|
1599
1460
|
)
|
|
1600
1461
|
]
|
|
1601
1462
|
|
|
1602
|
-
def exit_assert_stmt(self, node:
|
|
1603
|
-
"""Sub objects.
|
|
1604
|
-
|
|
1605
|
-
condition: ExprType,
|
|
1606
|
-
error_msg: Optional[ExprType],
|
|
1607
|
-
"""
|
|
1463
|
+
def exit_assert_stmt(self, node: uni.AssertStmt) -> None:
|
|
1608
1464
|
node.gen.py_ast = [
|
|
1609
1465
|
self.sync(
|
|
1610
1466
|
ast3.Assert(
|
|
1611
|
-
test=node.condition.gen.py_ast[0],
|
|
1612
|
-
msg=
|
|
1467
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
1468
|
+
msg=(
|
|
1469
|
+
cast(ast3.expr, node.error_msg.gen.py_ast[0])
|
|
1470
|
+
if node.error_msg
|
|
1471
|
+
else None
|
|
1472
|
+
),
|
|
1613
1473
|
)
|
|
1614
1474
|
)
|
|
1615
1475
|
]
|
|
1616
1476
|
|
|
1617
|
-
def exit_check_stmt(self, node:
|
|
1477
|
+
def exit_check_stmt(self, node: uni.CheckStmt) -> None:
|
|
1618
1478
|
"""Sub objects.
|
|
1619
1479
|
|
|
1620
1480
|
target: ExprType,
|
|
@@ -1647,7 +1507,7 @@ class PyastGenPass(Pass):
|
|
|
1647
1507
|
# This will check if a node is `isinstance(<expr>, <expr>)`, we're
|
|
1648
1508
|
# using a function because it's reusable to check not isinstance(<expr>, <expr>).
|
|
1649
1509
|
def check_node_isinstance_call(
|
|
1650
|
-
node:
|
|
1510
|
+
node: uni.FuncCall,
|
|
1651
1511
|
) -> CheckNodeIsinstanceCallResult:
|
|
1652
1512
|
|
|
1653
1513
|
# Ensure the type of the FuncCall node is SubNodeList[Expr]
|
|
@@ -1655,8 +1515,8 @@ class PyastGenPass(Pass):
|
|
|
1655
1515
|
if not (
|
|
1656
1516
|
node.params is not None
|
|
1657
1517
|
and len(node.params.items) == 2
|
|
1658
|
-
and isinstance(node.params.items[0],
|
|
1659
|
-
and isinstance(node.params.items[1],
|
|
1518
|
+
and isinstance(node.params.items[0], uni.Expr)
|
|
1519
|
+
and isinstance(node.params.items[1], uni.Expr)
|
|
1660
1520
|
):
|
|
1661
1521
|
return CheckNodeIsinstanceCallResult()
|
|
1662
1522
|
|
|
@@ -1677,12 +1537,12 @@ class PyastGenPass(Pass):
|
|
|
1677
1537
|
# Compare operations. Note that We're only considering the compare
|
|
1678
1538
|
# operation with a single operation ie. a < b < c is ignored here.
|
|
1679
1539
|
if (
|
|
1680
|
-
isinstance(node.target,
|
|
1540
|
+
isinstance(node.target, uni.CompareExpr)
|
|
1681
1541
|
and isinstance(node.target.gen.py_ast[0], ast3.Compare)
|
|
1682
1542
|
and len(node.target.ops) == 1
|
|
1683
1543
|
):
|
|
1684
|
-
expr:
|
|
1685
|
-
opty:
|
|
1544
|
+
expr: uni.CompareExpr = node.target
|
|
1545
|
+
opty: uni.Token = expr.ops[0]
|
|
1686
1546
|
|
|
1687
1547
|
optype2fn = {
|
|
1688
1548
|
Tok.EE.name: "assertEqual",
|
|
@@ -1705,17 +1565,17 @@ class PyastGenPass(Pass):
|
|
|
1705
1565
|
]
|
|
1706
1566
|
|
|
1707
1567
|
# Override for <expr> is None.
|
|
1708
|
-
if opty.name == Tok.KW_IS and isinstance(expr.rights[0],
|
|
1568
|
+
if opty.name == Tok.KW_IS and isinstance(expr.rights[0], uni.Null):
|
|
1709
1569
|
assert_func_name = "assertIsNone"
|
|
1710
1570
|
assert_args_list.pop()
|
|
1711
1571
|
|
|
1712
1572
|
# Override for <expr> is not None.
|
|
1713
|
-
elif opty.name == Tok.KW_ISN and isinstance(expr.rights[0],
|
|
1573
|
+
elif opty.name == Tok.KW_ISN and isinstance(expr.rights[0], uni.Null):
|
|
1714
1574
|
assert_func_name = "assertIsNotNone"
|
|
1715
1575
|
assert_args_list.pop()
|
|
1716
1576
|
|
|
1717
1577
|
# Check if 'isinstance' is called.
|
|
1718
|
-
elif isinstance(node.target,
|
|
1578
|
+
elif isinstance(node.target, uni.FuncCall) and isinstance(
|
|
1719
1579
|
node.target.gen.py_ast[0], ast3.Call
|
|
1720
1580
|
):
|
|
1721
1581
|
res = check_node_isinstance_call(node.target)
|
|
@@ -1728,10 +1588,10 @@ class PyastGenPass(Pass):
|
|
|
1728
1588
|
|
|
1729
1589
|
# Check if 'not isinstance(<expr>, <expr>)' is called.
|
|
1730
1590
|
elif (
|
|
1731
|
-
isinstance(node.target,
|
|
1732
|
-
and isinstance(node.target,
|
|
1733
|
-
and isinstance(node.target.operand,
|
|
1734
|
-
and isinstance(node.target.operand,
|
|
1591
|
+
isinstance(node.target, uni.UnaryExpr)
|
|
1592
|
+
and isinstance(node.target, uni.UnaryExpr)
|
|
1593
|
+
and isinstance(node.target.operand, uni.FuncCall)
|
|
1594
|
+
and isinstance(node.target.operand, uni.UnaryExpr)
|
|
1735
1595
|
):
|
|
1736
1596
|
res = check_node_isinstance_call(node.target.operand)
|
|
1737
1597
|
if res.isit:
|
|
@@ -1746,11 +1606,11 @@ class PyastGenPass(Pass):
|
|
|
1746
1606
|
# the almost equal functionality (snice there is no almost equal operator in jac and never needed ig.).
|
|
1747
1607
|
|
|
1748
1608
|
# Check if 'almostEqual' is called.
|
|
1749
|
-
if isinstance(node.target,
|
|
1609
|
+
if isinstance(node.target, uni.FuncCall) and isinstance(
|
|
1750
1610
|
node.target.gen.py_ast[0], ast3.Call
|
|
1751
1611
|
):
|
|
1752
1612
|
func = node.target.target
|
|
1753
|
-
if isinstance(func,
|
|
1613
|
+
if isinstance(func, uni.Name) and func.value == "almostEqual":
|
|
1754
1614
|
assert_func_name = "assertAlmostEqual"
|
|
1755
1615
|
assert_args_list = []
|
|
1756
1616
|
if node.target.params is not None:
|
|
@@ -1768,16 +1628,16 @@ class PyastGenPass(Pass):
|
|
|
1768
1628
|
|
|
1769
1629
|
# assert_call_expr = "(Con.JAC_CHECK.value.assertXXX)(args)"
|
|
1770
1630
|
assert_call_expr: ast3.Call = self.sync(
|
|
1771
|
-
ast3.Call(
|
|
1631
|
+
ast3.Call(
|
|
1632
|
+
func=assert_func_expr,
|
|
1633
|
+
args=[cast(ast3.expr, arg) for arg in assert_args_list],
|
|
1634
|
+
keywords=[],
|
|
1635
|
+
)
|
|
1772
1636
|
)
|
|
1773
1637
|
|
|
1774
1638
|
node.gen.py_ast = [self.sync(ast3.Expr(assert_call_expr))]
|
|
1775
1639
|
|
|
1776
|
-
def exit_ctrl_stmt(self, node:
|
|
1777
|
-
"""Sub objects.
|
|
1778
|
-
|
|
1779
|
-
ctrl: Token,
|
|
1780
|
-
"""
|
|
1640
|
+
def exit_ctrl_stmt(self, node: uni.CtrlStmt) -> None:
|
|
1781
1641
|
if node.ctrl.name == Tok.KW_BREAK:
|
|
1782
1642
|
node.gen.py_ast = [self.sync(ast3.Break())]
|
|
1783
1643
|
elif node.ctrl.name == Tok.KW_CONTINUE:
|
|
@@ -1785,42 +1645,58 @@ class PyastGenPass(Pass):
|
|
|
1785
1645
|
elif node.ctrl.name == Tok.KW_SKIP:
|
|
1786
1646
|
node.gen.py_ast = [self.sync(ast3.Return(value=None))]
|
|
1787
1647
|
|
|
1788
|
-
def exit_delete_stmt(self, node:
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
)
|
|
1648
|
+
def exit_delete_stmt(self, node: uni.DeleteStmt) -> None:
|
|
1649
|
+
def set_ctx(
|
|
1650
|
+
targets: Union[ast3.AST, List[ast3.AST]], ctx: type
|
|
1651
|
+
) -> List[ast3.AST]:
|
|
1652
|
+
"""Set the given ctx (Load, Del) to AST node(s)."""
|
|
1653
|
+
if not isinstance(targets, list):
|
|
1654
|
+
targets = [targets]
|
|
1655
|
+
elif isinstance(targets[0], (ast3.List, ast3.Tuple)):
|
|
1656
|
+
targets = [i for i in targets[0].elts if isinstance(i, ast3.AST)]
|
|
1657
|
+
result = []
|
|
1658
|
+
for target in targets:
|
|
1659
|
+
if hasattr(target, "ctx"):
|
|
1660
|
+
target = copy.copy(target)
|
|
1661
|
+
target.ctx = ctx()
|
|
1662
|
+
result.append(target)
|
|
1663
|
+
return result
|
|
1664
|
+
|
|
1665
|
+
destroy_expr = ast3.Expr(
|
|
1666
|
+
value=self.sync(
|
|
1667
|
+
ast3.Call(
|
|
1668
|
+
func=self.jaclib_obj("destroy"),
|
|
1669
|
+
args=[
|
|
1670
|
+
self.sync(
|
|
1671
|
+
ast3.List(
|
|
1672
|
+
elts=cast(
|
|
1673
|
+
list[ast3.expr],
|
|
1674
|
+
set_ctx(node.py_ast_targets, ast3.Load),
|
|
1675
|
+
),
|
|
1676
|
+
ctx=ast3.Load(),
|
|
1677
|
+
)
|
|
1678
|
+
)
|
|
1679
|
+
],
|
|
1680
|
+
keywords=[],
|
|
1801
1681
|
)
|
|
1802
1682
|
)
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1683
|
+
)
|
|
1684
|
+
delete_stmt = self.sync(
|
|
1685
|
+
ast3.Delete(
|
|
1686
|
+
targets=cast(list[ast3.expr], set_ctx(node.py_ast_targets, ast3.Del))
|
|
1687
|
+
)
|
|
1688
|
+
)
|
|
1689
|
+
node.gen.py_ast = [self.sync(destroy_expr), self.sync(delete_stmt)]
|
|
1807
1690
|
|
|
1808
|
-
|
|
1809
|
-
"""
|
|
1691
|
+
def exit_report_stmt(self, node: uni.ReportStmt) -> None:
|
|
1810
1692
|
node.gen.py_ast = [
|
|
1811
1693
|
self.sync(
|
|
1812
1694
|
ast3.Expr(
|
|
1813
1695
|
value=self.sync(
|
|
1814
1696
|
self.sync(
|
|
1815
1697
|
ast3.Call(
|
|
1816
|
-
func=self.
|
|
1817
|
-
|
|
1818
|
-
value=self.jaclib_obj(Con.JAC_FEATURE.value),
|
|
1819
|
-
attr="report",
|
|
1820
|
-
ctx=ast3.Load(),
|
|
1821
|
-
)
|
|
1822
|
-
),
|
|
1823
|
-
args=node.expr.gen.py_ast,
|
|
1698
|
+
func=self.jaclib_obj("report"),
|
|
1699
|
+
args=cast(list[ast3.expr], node.expr.gen.py_ast),
|
|
1824
1700
|
keywords=[],
|
|
1825
1701
|
)
|
|
1826
1702
|
)
|
|
@@ -1829,38 +1705,44 @@ class PyastGenPass(Pass):
|
|
|
1829
1705
|
)
|
|
1830
1706
|
]
|
|
1831
1707
|
|
|
1832
|
-
def exit_return_stmt(self, node:
|
|
1833
|
-
"""Sub objects.
|
|
1834
|
-
|
|
1835
|
-
expr: Optional[ExprType],
|
|
1836
|
-
"""
|
|
1708
|
+
def exit_return_stmt(self, node: uni.ReturnStmt) -> None:
|
|
1837
1709
|
node.gen.py_ast = [
|
|
1838
|
-
self.sync(
|
|
1710
|
+
self.sync(
|
|
1711
|
+
ast3.Return(
|
|
1712
|
+
value=(
|
|
1713
|
+
cast(ast3.expr, node.expr.gen.py_ast[0]) if node.expr else None
|
|
1714
|
+
)
|
|
1715
|
+
)
|
|
1716
|
+
)
|
|
1839
1717
|
]
|
|
1840
1718
|
|
|
1841
|
-
def exit_yield_expr(self, node:
|
|
1842
|
-
"""Sub objects.
|
|
1843
|
-
|
|
1844
|
-
expr: Optional[ExprType],
|
|
1845
|
-
"""
|
|
1719
|
+
def exit_yield_expr(self, node: uni.YieldExpr) -> None:
|
|
1846
1720
|
if not node.with_from:
|
|
1847
1721
|
node.gen.py_ast = [
|
|
1848
1722
|
self.sync(
|
|
1849
|
-
ast3.Yield(
|
|
1723
|
+
ast3.Yield(
|
|
1724
|
+
value=(
|
|
1725
|
+
cast(ast3.expr, node.expr.gen.py_ast[0])
|
|
1726
|
+
if node.expr
|
|
1727
|
+
else None
|
|
1728
|
+
)
|
|
1729
|
+
)
|
|
1850
1730
|
)
|
|
1851
1731
|
]
|
|
1852
1732
|
else:
|
|
1853
1733
|
node.gen.py_ast = [
|
|
1854
1734
|
self.sync(
|
|
1855
|
-
ast3.YieldFrom(
|
|
1735
|
+
ast3.YieldFrom(
|
|
1736
|
+
value=(
|
|
1737
|
+
cast(ast3.expr, node.expr.gen.py_ast[0])
|
|
1738
|
+
if node.expr
|
|
1739
|
+
else self.sync(ast3.Constant(value=None))
|
|
1740
|
+
)
|
|
1741
|
+
)
|
|
1856
1742
|
)
|
|
1857
1743
|
]
|
|
1858
1744
|
|
|
1859
|
-
def exit_ignore_stmt(self, node:
|
|
1860
|
-
"""Sub objects.
|
|
1861
|
-
|
|
1862
|
-
target: ExprType,
|
|
1863
|
-
"""
|
|
1745
|
+
def exit_ignore_stmt(self, node: uni.IgnoreStmt) -> None:
|
|
1864
1746
|
walker = self.sync(
|
|
1865
1747
|
ast3.Name(id="self", ctx=ast3.Load())
|
|
1866
1748
|
if node.from_walker
|
|
@@ -1872,14 +1754,10 @@ class PyastGenPass(Pass):
|
|
|
1872
1754
|
ast3.Expr(
|
|
1873
1755
|
value=self.sync(
|
|
1874
1756
|
ast3.Call(
|
|
1875
|
-
func=self.
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
attr="ignore",
|
|
1879
|
-
ctx=ast3.Load(),
|
|
1880
|
-
)
|
|
1757
|
+
func=self.jaclib_obj("ignore"),
|
|
1758
|
+
args=cast(
|
|
1759
|
+
list[ast3.expr], [walker, node.target.gen.py_ast[0]]
|
|
1881
1760
|
),
|
|
1882
|
-
args=[node.target.gen.py_ast[0]],
|
|
1883
1761
|
keywords=[],
|
|
1884
1762
|
)
|
|
1885
1763
|
)
|
|
@@ -1887,13 +1765,7 @@ class PyastGenPass(Pass):
|
|
|
1887
1765
|
)
|
|
1888
1766
|
]
|
|
1889
1767
|
|
|
1890
|
-
def exit_visit_stmt(self, node:
|
|
1891
|
-
"""Sub objects.
|
|
1892
|
-
|
|
1893
|
-
vis_type: Optional[SubNodeList[AtomType]],
|
|
1894
|
-
target: ExprType,
|
|
1895
|
-
else_body: Optional[ElseStmt],
|
|
1896
|
-
"""
|
|
1768
|
+
def exit_visit_stmt(self, node: uni.VisitStmt) -> None:
|
|
1897
1769
|
loc = self.sync(
|
|
1898
1770
|
ast3.Name(id="self", ctx=ast3.Load())
|
|
1899
1771
|
if node.from_walker
|
|
@@ -1902,14 +1774,8 @@ class PyastGenPass(Pass):
|
|
|
1902
1774
|
|
|
1903
1775
|
visit_call = self.sync(
|
|
1904
1776
|
ast3.Call(
|
|
1905
|
-
func=self.
|
|
1906
|
-
|
|
1907
|
-
value=loc,
|
|
1908
|
-
attr="visit",
|
|
1909
|
-
ctx=ast3.Load(),
|
|
1910
|
-
)
|
|
1911
|
-
),
|
|
1912
|
-
args=[node.target.gen.py_ast[0]],
|
|
1777
|
+
func=self.jaclib_obj("visit"),
|
|
1778
|
+
args=cast(list[ast3.expr], [loc, node.target.gen.py_ast[0]]),
|
|
1913
1779
|
keywords=[],
|
|
1914
1780
|
)
|
|
1915
1781
|
)
|
|
@@ -1924,7 +1790,7 @@ class PyastGenPass(Pass):
|
|
|
1924
1790
|
operand=visit_call,
|
|
1925
1791
|
)
|
|
1926
1792
|
),
|
|
1927
|
-
body=node.else_body.gen.py_ast,
|
|
1793
|
+
body=cast(list[ast3.stmt], node.else_body.gen.py_ast),
|
|
1928
1794
|
orelse=[],
|
|
1929
1795
|
)
|
|
1930
1796
|
)
|
|
@@ -1933,19 +1799,7 @@ class PyastGenPass(Pass):
|
|
|
1933
1799
|
)
|
|
1934
1800
|
]
|
|
1935
1801
|
|
|
1936
|
-
def
|
|
1937
|
-
"""Sub objects.
|
|
1938
|
-
|
|
1939
|
-
hops: Optional[ExprType],
|
|
1940
|
-
else_body: Optional[ElseStmt],
|
|
1941
|
-
"""
|
|
1942
|
-
self.warning("Revisit not used in Jac", node)
|
|
1943
|
-
node.gen.py_ast = [
|
|
1944
|
-
self.sync(ast3.Expr(value=self.sync(ast3.Constant(value=None))))
|
|
1945
|
-
]
|
|
1946
|
-
|
|
1947
|
-
def exit_disengage_stmt(self, node: ast.DisengageStmt) -> None:
|
|
1948
|
-
"""Sub objects."""
|
|
1802
|
+
def exit_disengage_stmt(self, node: uni.DisengageStmt) -> None:
|
|
1949
1803
|
loc = self.sync(
|
|
1950
1804
|
ast3.Name(id="self", ctx=ast3.Load())
|
|
1951
1805
|
if node.from_walker
|
|
@@ -1953,38 +1807,41 @@ class PyastGenPass(Pass):
|
|
|
1953
1807
|
)
|
|
1954
1808
|
node.gen.py_ast = [
|
|
1955
1809
|
self.sync(
|
|
1956
|
-
ast3.
|
|
1810
|
+
ast3.Expr(
|
|
1957
1811
|
self.sync(
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
value=loc,
|
|
1963
|
-
attr="disengage",
|
|
1964
|
-
ctx=ast3.Load(),
|
|
1965
|
-
)
|
|
1966
|
-
),
|
|
1967
|
-
args=[],
|
|
1968
|
-
keywords=[],
|
|
1969
|
-
)
|
|
1812
|
+
ast3.Call(
|
|
1813
|
+
func=self.jaclib_obj("disengage"),
|
|
1814
|
+
args=[loc],
|
|
1815
|
+
keywords=[],
|
|
1970
1816
|
)
|
|
1971
1817
|
)
|
|
1972
1818
|
)
|
|
1973
1819
|
),
|
|
1820
|
+
self.sync(ast3.Return()),
|
|
1974
1821
|
]
|
|
1975
1822
|
|
|
1976
|
-
def exit_await_expr(self, node:
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1823
|
+
def exit_await_expr(self, node: uni.AwaitExpr) -> None:
|
|
1824
|
+
parent_node = node.parent
|
|
1825
|
+
while parent_node and (parent_node := parent_node.parent):
|
|
1826
|
+
if hasattr(parent_node, "is_async") and parent_node.is_async:
|
|
1827
|
+
node.gen.py_ast = [
|
|
1828
|
+
self.sync(
|
|
1829
|
+
ast3.Await(value=cast(ast3.expr, node.target.gen.py_ast[0]))
|
|
1830
|
+
)
|
|
1831
|
+
]
|
|
1832
|
+
break
|
|
1833
|
+
else:
|
|
1834
|
+
node.gen.py_ast = [
|
|
1835
|
+
self.sync(
|
|
1836
|
+
ast3.Call(
|
|
1837
|
+
func=self.jaclib_obj("await_obj"),
|
|
1838
|
+
args=[cast(ast3.expr, node.target.gen.py_ast[0])],
|
|
1839
|
+
keywords=[],
|
|
1840
|
+
)
|
|
1841
|
+
)
|
|
1842
|
+
]
|
|
1985
1843
|
|
|
1986
|
-
|
|
1987
|
-
"""
|
|
1844
|
+
def exit_global_stmt(self, node: uni.GlobalStmt) -> None:
|
|
1988
1845
|
py_nodes = []
|
|
1989
1846
|
for x in node.target.items:
|
|
1990
1847
|
py_nodes.append(
|
|
@@ -1995,11 +1852,7 @@ class PyastGenPass(Pass):
|
|
|
1995
1852
|
)
|
|
1996
1853
|
node.gen.py_ast = [*py_nodes]
|
|
1997
1854
|
|
|
1998
|
-
def exit_non_local_stmt(self, node:
|
|
1999
|
-
"""Sub objects.
|
|
2000
|
-
|
|
2001
|
-
target: SubNodeList[NameType],
|
|
2002
|
-
"""
|
|
1855
|
+
def exit_non_local_stmt(self, node: uni.NonLocalStmt) -> None:
|
|
2003
1856
|
py_nodes = []
|
|
2004
1857
|
for x in node.target.items:
|
|
2005
1858
|
py_nodes.append(
|
|
@@ -2010,14 +1863,7 @@ class PyastGenPass(Pass):
|
|
|
2010
1863
|
)
|
|
2011
1864
|
node.gen.py_ast = [*py_nodes]
|
|
2012
1865
|
|
|
2013
|
-
def exit_assignment(self, node:
|
|
2014
|
-
"""Sub objects.
|
|
2015
|
-
|
|
2016
|
-
target: SubNodeList[AtomType],
|
|
2017
|
-
value: Optional[ExprType | YieldStmt],
|
|
2018
|
-
type_tag: Optional[SubTag[ExprType]],
|
|
2019
|
-
mutable: bool =True,
|
|
2020
|
-
"""
|
|
1866
|
+
def exit_assignment(self, node: uni.Assignment) -> None:
|
|
2021
1867
|
value = (
|
|
2022
1868
|
node.value.gen.py_ast[0]
|
|
2023
1869
|
if node.value
|
|
@@ -2037,9 +1883,13 @@ class PyastGenPass(Pass):
|
|
|
2037
1883
|
node.gen.py_ast = [
|
|
2038
1884
|
self.sync(
|
|
2039
1885
|
ast3.AnnAssign(
|
|
2040
|
-
target=node.target.items[0].gen.py_ast[0],
|
|
2041
|
-
annotation=node.type_tag.gen.py_ast[0],
|
|
2042
|
-
value=
|
|
1886
|
+
target=cast(ast3.Name, node.target.items[0].gen.py_ast[0]),
|
|
1887
|
+
annotation=cast(ast3.expr, node.type_tag.gen.py_ast[0]),
|
|
1888
|
+
value=(
|
|
1889
|
+
cast(ast3.expr, node.value.gen.py_ast[0])
|
|
1890
|
+
if node.value
|
|
1891
|
+
else None
|
|
1892
|
+
),
|
|
2043
1893
|
simple=int(isinstance(node.target.gen.py_ast[0], ast3.Name)),
|
|
2044
1894
|
)
|
|
2045
1895
|
)
|
|
@@ -2048,26 +1898,32 @@ class PyastGenPass(Pass):
|
|
|
2048
1898
|
node.gen.py_ast = [
|
|
2049
1899
|
self.sync(
|
|
2050
1900
|
ast3.AugAssign(
|
|
2051
|
-
target=node.target.items[0].gen.py_ast[0],
|
|
2052
|
-
op=node.aug_op.gen.py_ast[0],
|
|
2053
|
-
value=
|
|
1901
|
+
target=cast(ast3.Name, node.target.items[0].gen.py_ast[0]),
|
|
1902
|
+
op=cast(ast3.operator, node.aug_op.gen.py_ast[0]),
|
|
1903
|
+
value=(
|
|
1904
|
+
cast(ast3.expr, value)
|
|
1905
|
+
if isinstance(value, ast3.expr)
|
|
1906
|
+
else ast3.Constant(value=None)
|
|
1907
|
+
),
|
|
2054
1908
|
)
|
|
2055
1909
|
)
|
|
2056
1910
|
]
|
|
2057
1911
|
else:
|
|
2058
1912
|
node.gen.py_ast = [
|
|
2059
|
-
self.sync(
|
|
1913
|
+
self.sync(
|
|
1914
|
+
ast3.Assign(
|
|
1915
|
+
targets=cast(list[ast3.expr], node.target.gen.py_ast),
|
|
1916
|
+
value=(
|
|
1917
|
+
cast(ast3.expr, value)
|
|
1918
|
+
if isinstance(value, ast3.expr)
|
|
1919
|
+
else ast3.Constant(value=None)
|
|
1920
|
+
),
|
|
1921
|
+
)
|
|
1922
|
+
)
|
|
2060
1923
|
]
|
|
2061
1924
|
|
|
2062
|
-
def exit_binary_expr(self, node:
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
left: ExprType,
|
|
2066
|
-
right: ExprType,
|
|
2067
|
-
op: Token | DisconnectOp | ConnectOp,
|
|
2068
|
-
"""
|
|
2069
|
-
if isinstance(node.op, ast.ConnectOp):
|
|
2070
|
-
|
|
1925
|
+
def exit_binary_expr(self, node: uni.BinaryExpr) -> None:
|
|
1926
|
+
if isinstance(node.op, uni.ConnectOp):
|
|
2071
1927
|
left = (
|
|
2072
1928
|
node.right.gen.py_ast[0]
|
|
2073
1929
|
if node.op.edge_dir == EdgeDir.IN
|
|
@@ -2078,46 +1934,37 @@ class PyastGenPass(Pass):
|
|
|
2078
1934
|
if node.op.edge_dir == EdgeDir.IN
|
|
2079
1935
|
else node.right.gen.py_ast[0]
|
|
2080
1936
|
)
|
|
2081
|
-
conn_type = (
|
|
2082
|
-
node.op.conn_type.gen.py_ast[0]
|
|
2083
|
-
if node.op.conn_type
|
|
2084
|
-
else self.sync(ast3.Constant(value=None))
|
|
2085
|
-
)
|
|
2086
|
-
undir = self.sync(ast3.Constant(value=node.op.edge_dir == EdgeDir.ANY))
|
|
2087
|
-
conn_assign = (
|
|
2088
|
-
node.op.conn_assign.gen.py_ast[0]
|
|
2089
|
-
if node.op.conn_assign
|
|
2090
|
-
else self.sync(ast3.Constant(value=None))
|
|
2091
|
-
)
|
|
2092
1937
|
|
|
2093
|
-
keywords = [
|
|
2094
|
-
|
|
1938
|
+
keywords = [
|
|
1939
|
+
self.sync(ast3.keyword(arg="left", value=cast(ast3.expr, left))),
|
|
1940
|
+
self.sync(ast3.keyword(arg="right", value=cast(ast3.expr, right))),
|
|
1941
|
+
]
|
|
1942
|
+
|
|
1943
|
+
if node.op.conn_type:
|
|
2095
1944
|
keywords.append(
|
|
2096
1945
|
self.sync(
|
|
2097
1946
|
ast3.keyword(
|
|
2098
1947
|
arg="edge",
|
|
2099
|
-
value=conn_type,
|
|
1948
|
+
value=cast(ast3.expr, node.op.conn_type.gen.py_ast[0]),
|
|
2100
1949
|
)
|
|
2101
1950
|
)
|
|
2102
1951
|
)
|
|
2103
|
-
|
|
1952
|
+
|
|
1953
|
+
if node.op.edge_dir == EdgeDir.ANY:
|
|
2104
1954
|
keywords.append(
|
|
2105
1955
|
self.sync(
|
|
2106
1956
|
ast3.keyword(
|
|
2107
|
-
arg="undir",
|
|
2108
|
-
value=undir,
|
|
1957
|
+
arg="undir", value=self.sync(ast3.Constant(value=True))
|
|
2109
1958
|
)
|
|
2110
1959
|
)
|
|
2111
1960
|
)
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
or conn_assign.value is not None
|
|
2115
|
-
):
|
|
1961
|
+
|
|
1962
|
+
if node.op.conn_assign:
|
|
2116
1963
|
keywords.append(
|
|
2117
1964
|
self.sync(
|
|
2118
1965
|
ast3.keyword(
|
|
2119
1966
|
arg="conn_assign",
|
|
2120
|
-
value=conn_assign,
|
|
1967
|
+
value=cast(ast3.expr, node.op.conn_assign.gen.py_ast[0]),
|
|
2121
1968
|
)
|
|
2122
1969
|
)
|
|
2123
1970
|
)
|
|
@@ -2125,39 +1972,32 @@ class PyastGenPass(Pass):
|
|
|
2125
1972
|
node.gen.py_ast = [
|
|
2126
1973
|
self.sync(
|
|
2127
1974
|
ast3.Call(
|
|
2128
|
-
func=self.
|
|
2129
|
-
|
|
2130
|
-
value=left,
|
|
2131
|
-
attr="connect",
|
|
2132
|
-
ctx=ast3.Load(),
|
|
2133
|
-
),
|
|
2134
|
-
),
|
|
2135
|
-
args=[right],
|
|
1975
|
+
func=self.jaclib_obj("connect"),
|
|
1976
|
+
args=[],
|
|
2136
1977
|
keywords=keywords,
|
|
2137
1978
|
)
|
|
2138
1979
|
)
|
|
2139
1980
|
]
|
|
2140
1981
|
|
|
2141
|
-
elif isinstance(node.op,
|
|
2142
|
-
keywords = [
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
self.sync(
|
|
2147
|
-
ast3.keyword(
|
|
2148
|
-
arg="edge",
|
|
2149
|
-
value=self.sync(
|
|
2150
|
-
node.op.edge_spec.filter_cond.f_type.gen.py_ast[0]
|
|
2151
|
-
),
|
|
2152
|
-
)
|
|
1982
|
+
elif isinstance(node.op, uni.DisconnectOp):
|
|
1983
|
+
keywords = [
|
|
1984
|
+
self.sync(
|
|
1985
|
+
ast3.keyword(
|
|
1986
|
+
arg="left", value=cast(ast3.expr, node.left.gen.py_ast[0])
|
|
2153
1987
|
)
|
|
2154
|
-
)
|
|
1988
|
+
),
|
|
1989
|
+
self.sync(
|
|
1990
|
+
ast3.keyword(
|
|
1991
|
+
arg="right", value=cast(ast3.expr, node.right.gen.py_ast[0])
|
|
1992
|
+
)
|
|
1993
|
+
),
|
|
1994
|
+
]
|
|
2155
1995
|
|
|
2156
1996
|
if node.op.edge_spec.edge_dir != EdgeDir.OUT:
|
|
2157
1997
|
keywords.append(
|
|
2158
1998
|
self.sync(
|
|
2159
1999
|
ast3.keyword(
|
|
2160
|
-
arg="
|
|
2000
|
+
arg="EdgeDir",
|
|
2161
2001
|
value=self.sync(
|
|
2162
2002
|
ast3.Attribute(
|
|
2163
2003
|
value=self.jaclib_obj("EdgeDir"),
|
|
@@ -2169,17 +2009,24 @@ class PyastGenPass(Pass):
|
|
|
2169
2009
|
)
|
|
2170
2010
|
)
|
|
2171
2011
|
|
|
2012
|
+
if node.op.edge_spec.filter_cond:
|
|
2013
|
+
keywords.append(
|
|
2014
|
+
self.sync(
|
|
2015
|
+
ast3.keyword(
|
|
2016
|
+
arg="filter",
|
|
2017
|
+
value=cast(
|
|
2018
|
+
ast3.expr,
|
|
2019
|
+
node.op.edge_spec.filter_cond.gen.py_ast[0],
|
|
2020
|
+
),
|
|
2021
|
+
),
|
|
2022
|
+
)
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2172
2025
|
node.gen.py_ast = [
|
|
2173
2026
|
self.sync(
|
|
2174
2027
|
ast3.Call(
|
|
2175
|
-
func=self.
|
|
2176
|
-
|
|
2177
|
-
value=node.left.gen.py_ast[0],
|
|
2178
|
-
attr="disconnect",
|
|
2179
|
-
ctx=ast3.Load(),
|
|
2180
|
-
)
|
|
2181
|
-
),
|
|
2182
|
-
args=[node.right.gen.py_ast[0]],
|
|
2028
|
+
func=self.jaclib_obj("disconnect"),
|
|
2029
|
+
args=[],
|
|
2183
2030
|
keywords=keywords,
|
|
2184
2031
|
)
|
|
2185
2032
|
)
|
|
@@ -2188,8 +2035,11 @@ class PyastGenPass(Pass):
|
|
|
2188
2035
|
node.gen.py_ast = [
|
|
2189
2036
|
self.sync(
|
|
2190
2037
|
ast3.BoolOp(
|
|
2191
|
-
op=node.op.gen.py_ast[0],
|
|
2192
|
-
values=[
|
|
2038
|
+
op=cast(ast3.boolop, node.op.gen.py_ast[0]),
|
|
2039
|
+
values=[
|
|
2040
|
+
cast(ast3.expr, node.left.gen.py_ast[0]),
|
|
2041
|
+
cast(ast3.expr, node.right.gen.py_ast[0]),
|
|
2042
|
+
],
|
|
2193
2043
|
)
|
|
2194
2044
|
)
|
|
2195
2045
|
]
|
|
@@ -2200,8 +2050,8 @@ class PyastGenPass(Pass):
|
|
|
2200
2050
|
node.gen.py_ast = [
|
|
2201
2051
|
self.sync(
|
|
2202
2052
|
ast3.NamedExpr(
|
|
2203
|
-
target=node.left.gen.py_ast[0],
|
|
2204
|
-
value=node.right.gen.py_ast[0],
|
|
2053
|
+
target=cast(ast3.Name, node.left.gen.py_ast[0]),
|
|
2054
|
+
value=cast(ast3.expr, node.right.gen.py_ast[0]),
|
|
2205
2055
|
)
|
|
2206
2056
|
)
|
|
2207
2057
|
]
|
|
@@ -2209,49 +2059,46 @@ class PyastGenPass(Pass):
|
|
|
2209
2059
|
node.gen.py_ast = [
|
|
2210
2060
|
self.sync(
|
|
2211
2061
|
ast3.BinOp(
|
|
2212
|
-
left=node.left.gen.py_ast[0],
|
|
2213
|
-
right=node.right.gen.py_ast[0],
|
|
2214
|
-
op=node.op.gen.py_ast[0],
|
|
2062
|
+
left=cast(ast3.expr, node.left.gen.py_ast[0]),
|
|
2063
|
+
right=cast(ast3.expr, node.right.gen.py_ast[0]),
|
|
2064
|
+
op=cast(ast3.operator, node.op.gen.py_ast[0]),
|
|
2215
2065
|
)
|
|
2216
2066
|
)
|
|
2217
2067
|
]
|
|
2218
2068
|
else:
|
|
2219
2069
|
node.gen.py_ast = self.translate_jac_bin_op(node)
|
|
2220
2070
|
|
|
2221
|
-
def translate_jac_bin_op(self, node:
|
|
2222
|
-
|
|
2223
|
-
if isinstance(node.op, (ast.DisconnectOp, ast.ConnectOp)):
|
|
2071
|
+
def translate_jac_bin_op(self, node: uni.BinaryExpr) -> list[ast3.AST]:
|
|
2072
|
+
if isinstance(node.op, (uni.DisconnectOp, uni.ConnectOp)):
|
|
2224
2073
|
raise self.ice()
|
|
2225
2074
|
elif node.op.name in [
|
|
2226
2075
|
Tok.PIPE_FWD,
|
|
2227
2076
|
Tok.A_PIPE_FWD,
|
|
2228
2077
|
]:
|
|
2229
|
-
func_node =
|
|
2078
|
+
func_node = uni.FuncCall(
|
|
2230
2079
|
target=node.right,
|
|
2231
2080
|
params=(
|
|
2232
2081
|
node.left.values
|
|
2233
|
-
if isinstance(node.left,
|
|
2234
|
-
else
|
|
2082
|
+
if isinstance(node.left, uni.TupleVal)
|
|
2083
|
+
else uni.SubNodeList(
|
|
2235
2084
|
items=[node.left], delim=Tok.COMMA, kid=[node.left]
|
|
2236
2085
|
)
|
|
2237
2086
|
),
|
|
2238
2087
|
genai_call=None,
|
|
2239
2088
|
kid=node.kid,
|
|
2240
2089
|
)
|
|
2090
|
+
func_node.parent = node.parent
|
|
2241
2091
|
self.exit_func_call(func_node)
|
|
2242
2092
|
return func_node.gen.py_ast
|
|
2243
2093
|
elif node.op.name in [Tok.KW_SPAWN]:
|
|
2244
2094
|
return [
|
|
2245
2095
|
self.sync(
|
|
2246
2096
|
ast3.Call(
|
|
2247
|
-
func=self.
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
ctx=ast3.Load(),
|
|
2252
|
-
)
|
|
2097
|
+
func=self.jaclib_obj("spawn"),
|
|
2098
|
+
args=cast(
|
|
2099
|
+
list[ast3.expr],
|
|
2100
|
+
[node.left.gen.py_ast[0], node.right.gen.py_ast[0]],
|
|
2253
2101
|
),
|
|
2254
|
-
args=[node.right.gen.py_ast[0]],
|
|
2255
2102
|
keywords=[],
|
|
2256
2103
|
)
|
|
2257
2104
|
)
|
|
@@ -2260,71 +2107,56 @@ class PyastGenPass(Pass):
|
|
|
2260
2107
|
Tok.PIPE_BKWD,
|
|
2261
2108
|
Tok.A_PIPE_BKWD,
|
|
2262
2109
|
]:
|
|
2263
|
-
func_node =
|
|
2110
|
+
func_node = uni.FuncCall(
|
|
2264
2111
|
target=node.left,
|
|
2265
2112
|
params=(
|
|
2266
2113
|
node.right.values
|
|
2267
|
-
if isinstance(node.right,
|
|
2268
|
-
else
|
|
2114
|
+
if isinstance(node.right, uni.TupleVal)
|
|
2115
|
+
else uni.SubNodeList(
|
|
2269
2116
|
items=[node.right], delim=Tok.COMMA, kid=[node.right]
|
|
2270
2117
|
)
|
|
2271
2118
|
),
|
|
2272
2119
|
genai_call=None,
|
|
2273
2120
|
kid=node.kid,
|
|
2274
2121
|
)
|
|
2122
|
+
func_node.parent = node.parent
|
|
2275
2123
|
self.exit_func_call(func_node)
|
|
2276
2124
|
return func_node.gen.py_ast
|
|
2277
|
-
elif node.op.name == Tok.PIPE_FWD and isinstance(node.right,
|
|
2278
|
-
self.
|
|
2125
|
+
elif node.op.name == Tok.PIPE_FWD and isinstance(node.right, uni.TupleVal):
|
|
2126
|
+
self.log_error("Invalid pipe target.")
|
|
2279
2127
|
else:
|
|
2280
|
-
self.
|
|
2128
|
+
self.log_error(
|
|
2281
2129
|
f"Binary operator {node.op.value} not supported in bootstrap Jac"
|
|
2282
2130
|
)
|
|
2283
2131
|
return []
|
|
2284
2132
|
|
|
2285
|
-
def exit_compare_expr(self, node:
|
|
2286
|
-
"""Sub objects.
|
|
2287
|
-
|
|
2288
|
-
left: Expr,
|
|
2289
|
-
rights: list[Expr],
|
|
2290
|
-
ops: list[Token],
|
|
2291
|
-
"""
|
|
2133
|
+
def exit_compare_expr(self, node: uni.CompareExpr) -> None:
|
|
2292
2134
|
node.gen.py_ast = [
|
|
2293
2135
|
self.sync(
|
|
2294
2136
|
ast3.Compare(
|
|
2295
|
-
left=node.left.gen.py_ast[0],
|
|
2296
|
-
comparators=[i.gen.py_ast[0] for i in node.rights],
|
|
2297
|
-
ops=[i.gen.py_ast[0] for i in node.ops],
|
|
2137
|
+
left=cast(ast3.expr, node.left.gen.py_ast[0]),
|
|
2138
|
+
comparators=[cast(ast3.expr, i.gen.py_ast[0]) for i in node.rights],
|
|
2139
|
+
ops=[cast(ast3.cmpop, i.gen.py_ast[0]) for i in node.ops],
|
|
2298
2140
|
)
|
|
2299
2141
|
)
|
|
2300
2142
|
]
|
|
2301
2143
|
|
|
2302
|
-
def exit_bool_expr(self, node:
|
|
2303
|
-
"""Sub objects.
|
|
2304
|
-
|
|
2305
|
-
op: Token,
|
|
2306
|
-
values: list[Expr],
|
|
2307
|
-
"""
|
|
2144
|
+
def exit_bool_expr(self, node: uni.BoolExpr) -> None:
|
|
2308
2145
|
node.gen.py_ast = [
|
|
2309
2146
|
self.sync(
|
|
2310
2147
|
ast3.BoolOp(
|
|
2311
|
-
op=node.op.gen.py_ast[0],
|
|
2312
|
-
values=[i.gen.py_ast[0] for i in node.values],
|
|
2148
|
+
op=cast(ast3.boolop, node.op.gen.py_ast[0]),
|
|
2149
|
+
values=[cast(ast3.expr, i.gen.py_ast[0]) for i in node.values],
|
|
2313
2150
|
)
|
|
2314
2151
|
)
|
|
2315
2152
|
]
|
|
2316
2153
|
|
|
2317
|
-
def exit_lambda_expr(self, node:
|
|
2318
|
-
"""Sub objects.
|
|
2319
|
-
|
|
2320
|
-
signature: FuncSignature,
|
|
2321
|
-
body: ExprType,
|
|
2322
|
-
"""
|
|
2154
|
+
def exit_lambda_expr(self, node: uni.LambdaExpr) -> None:
|
|
2323
2155
|
node.gen.py_ast = [
|
|
2324
2156
|
self.sync(
|
|
2325
2157
|
ast3.Lambda(
|
|
2326
2158
|
args=(
|
|
2327
|
-
node.signature.gen.py_ast[0]
|
|
2159
|
+
cast(ast3.arguments, node.signature.gen.py_ast[0])
|
|
2328
2160
|
if node.signature
|
|
2329
2161
|
else self.sync(
|
|
2330
2162
|
ast3.arguments(
|
|
@@ -2336,23 +2168,18 @@ class PyastGenPass(Pass):
|
|
|
2336
2168
|
)
|
|
2337
2169
|
)
|
|
2338
2170
|
),
|
|
2339
|
-
body=node.body.gen.py_ast[0],
|
|
2171
|
+
body=cast(ast3.expr, node.body.gen.py_ast[0]),
|
|
2340
2172
|
)
|
|
2341
2173
|
)
|
|
2342
2174
|
]
|
|
2343
2175
|
|
|
2344
|
-
def exit_unary_expr(self, node:
|
|
2345
|
-
"""Sub objects.
|
|
2346
|
-
|
|
2347
|
-
operand: ExprType,
|
|
2348
|
-
op: Token,
|
|
2349
|
-
"""
|
|
2176
|
+
def exit_unary_expr(self, node: uni.UnaryExpr) -> None:
|
|
2350
2177
|
if node.op.name == Tok.NOT:
|
|
2351
2178
|
node.gen.py_ast = [
|
|
2352
2179
|
self.sync(
|
|
2353
2180
|
ast3.UnaryOp(
|
|
2354
2181
|
op=self.sync(ast3.Not()),
|
|
2355
|
-
operand=node.operand.gen.py_ast[0],
|
|
2182
|
+
operand=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2356
2183
|
)
|
|
2357
2184
|
)
|
|
2358
2185
|
]
|
|
@@ -2361,7 +2188,7 @@ class PyastGenPass(Pass):
|
|
|
2361
2188
|
self.sync(
|
|
2362
2189
|
ast3.UnaryOp(
|
|
2363
2190
|
op=self.sync(ast3.Invert()),
|
|
2364
|
-
operand=node.operand.gen.py_ast[0],
|
|
2191
|
+
operand=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2365
2192
|
)
|
|
2366
2193
|
)
|
|
2367
2194
|
]
|
|
@@ -2370,7 +2197,7 @@ class PyastGenPass(Pass):
|
|
|
2370
2197
|
self.sync(
|
|
2371
2198
|
ast3.UnaryOp(
|
|
2372
2199
|
op=self.sync(ast3.UAdd()),
|
|
2373
|
-
operand=node.operand.gen.py_ast[0],
|
|
2200
|
+
operand=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2374
2201
|
)
|
|
2375
2202
|
)
|
|
2376
2203
|
]
|
|
@@ -2379,7 +2206,7 @@ class PyastGenPass(Pass):
|
|
|
2379
2206
|
self.sync(
|
|
2380
2207
|
ast3.UnaryOp(
|
|
2381
2208
|
op=self.sync(ast3.USub()),
|
|
2382
|
-
operand=node.operand.gen.py_ast[0],
|
|
2209
|
+
operand=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2383
2210
|
)
|
|
2384
2211
|
)
|
|
2385
2212
|
]
|
|
@@ -2387,7 +2214,7 @@ class PyastGenPass(Pass):
|
|
|
2387
2214
|
node.gen.py_ast = [
|
|
2388
2215
|
self.sync(
|
|
2389
2216
|
ast3.Call(
|
|
2390
|
-
func=node.operand.gen.py_ast[0],
|
|
2217
|
+
func=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2391
2218
|
args=[],
|
|
2392
2219
|
keywords=[],
|
|
2393
2220
|
)
|
|
@@ -2396,14 +2223,14 @@ class PyastGenPass(Pass):
|
|
|
2396
2223
|
elif node.op.name in [Tok.STAR_MUL]:
|
|
2397
2224
|
ctx_val = (
|
|
2398
2225
|
node.operand.py_ctx_func()
|
|
2399
|
-
if isinstance(node.operand,
|
|
2226
|
+
if isinstance(node.operand, uni.AstSymbolNode)
|
|
2400
2227
|
else ast3.Load()
|
|
2401
2228
|
)
|
|
2402
2229
|
node.gen.py_ast = [
|
|
2403
2230
|
self.sync(
|
|
2404
2231
|
ast3.Starred(
|
|
2405
|
-
value=node.operand.gen.py_ast[0],
|
|
2406
|
-
ctx=ctx_val,
|
|
2232
|
+
value=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2233
|
+
ctx=cast(ast3.expr_context, ctx_val),
|
|
2407
2234
|
)
|
|
2408
2235
|
)
|
|
2409
2236
|
]
|
|
@@ -2413,13 +2240,13 @@ class PyastGenPass(Pass):
|
|
|
2413
2240
|
node.gen.py_ast = [
|
|
2414
2241
|
self.sync(
|
|
2415
2242
|
ast3.Call(
|
|
2416
|
-
func=self.
|
|
2243
|
+
func=self.sync(ast3.Name(id="jobj", ctx=ast3.Load())),
|
|
2417
2244
|
args=[],
|
|
2418
2245
|
keywords=[
|
|
2419
2246
|
self.sync(
|
|
2420
2247
|
ast3.keyword(
|
|
2421
2248
|
arg="id",
|
|
2422
|
-
value=node.operand.gen.py_ast[0],
|
|
2249
|
+
value=cast(ast3.expr, node.operand.gen.py_ast[0]),
|
|
2423
2250
|
)
|
|
2424
2251
|
),
|
|
2425
2252
|
],
|
|
@@ -2429,38 +2256,26 @@ class PyastGenPass(Pass):
|
|
|
2429
2256
|
else:
|
|
2430
2257
|
self.ice(f"Unknown Unary operator {node.op.value}")
|
|
2431
2258
|
|
|
2432
|
-
def exit_if_else_expr(self, node:
|
|
2433
|
-
"""Sub objects.
|
|
2434
|
-
|
|
2435
|
-
condition: ExprType,
|
|
2436
|
-
value: ExprType,
|
|
2437
|
-
else_value: ExprType,
|
|
2438
|
-
"""
|
|
2259
|
+
def exit_if_else_expr(self, node: uni.IfElseExpr) -> None:
|
|
2439
2260
|
node.gen.py_ast = [
|
|
2440
2261
|
self.sync(
|
|
2441
2262
|
ast3.IfExp(
|
|
2442
|
-
test=node.condition.gen.py_ast[0],
|
|
2443
|
-
body=node.value.gen.py_ast[0],
|
|
2444
|
-
orelse=node.else_value.gen.py_ast[0],
|
|
2263
|
+
test=cast(ast3.expr, node.condition.gen.py_ast[0]),
|
|
2264
|
+
body=cast(ast3.expr, node.value.gen.py_ast[0]),
|
|
2265
|
+
orelse=cast(ast3.expr, node.else_value.gen.py_ast[0]),
|
|
2445
2266
|
)
|
|
2446
2267
|
)
|
|
2447
2268
|
]
|
|
2448
2269
|
|
|
2449
|
-
def exit_multi_string(self, node:
|
|
2450
|
-
"""Sub objects.
|
|
2451
|
-
|
|
2452
|
-
strings: Sequence[String | FString],
|
|
2453
|
-
"""
|
|
2454
|
-
|
|
2270
|
+
def exit_multi_string(self, node: uni.MultiString) -> None:
|
|
2455
2271
|
def get_pieces(str_seq: Sequence) -> list[str | ast3.AST]:
|
|
2456
|
-
"""Pieces."""
|
|
2457
2272
|
pieces: list[str | ast3.AST] = []
|
|
2458
2273
|
for i in str_seq:
|
|
2459
|
-
if isinstance(i,
|
|
2274
|
+
if isinstance(i, uni.String):
|
|
2460
2275
|
pieces.append(i.lit_value)
|
|
2461
|
-
elif isinstance(i,
|
|
2276
|
+
elif isinstance(i, uni.FString):
|
|
2462
2277
|
pieces.extend(get_pieces(i.parts.items)) if i.parts else None
|
|
2463
|
-
elif isinstance(i,
|
|
2278
|
+
elif isinstance(i, uni.ExprStmt):
|
|
2464
2279
|
pieces.append(i.gen.py_ast[0])
|
|
2465
2280
|
else:
|
|
2466
2281
|
raise self.ice("Multi string made of something weird.")
|
|
@@ -2490,43 +2305,31 @@ class PyastGenPass(Pass):
|
|
|
2490
2305
|
node.gen.py_ast = [
|
|
2491
2306
|
self.sync(
|
|
2492
2307
|
ast3.JoinedStr(
|
|
2493
|
-
values=combined_multi,
|
|
2308
|
+
values=[cast(ast3.expr, node) for node in combined_multi],
|
|
2494
2309
|
)
|
|
2495
2310
|
)
|
|
2496
2311
|
]
|
|
2497
2312
|
else:
|
|
2498
2313
|
node.gen.py_ast = [combined_multi[0]]
|
|
2499
2314
|
|
|
2500
|
-
def exit_f_string(self, node:
|
|
2501
|
-
"""Sub objects.
|
|
2502
|
-
|
|
2503
|
-
parts: Optional[SubNodeList[String | ExprType]],
|
|
2504
|
-
"""
|
|
2315
|
+
def exit_f_string(self, node: uni.FString) -> None:
|
|
2505
2316
|
node.gen.py_ast = (
|
|
2506
2317
|
node.parts.gen.py_ast
|
|
2507
2318
|
if node.parts
|
|
2508
2319
|
else [self.sync(ast3.Constant(value=""))]
|
|
2509
2320
|
)
|
|
2510
2321
|
|
|
2511
|
-
def exit_list_val(self, node:
|
|
2512
|
-
"""Sub objects.
|
|
2513
|
-
|
|
2514
|
-
values: Optional[SubNodeList[ExprType]],
|
|
2515
|
-
"""
|
|
2322
|
+
def exit_list_val(self, node: uni.ListVal) -> None:
|
|
2516
2323
|
if isinstance(node.py_ctx_func(), ast3.Load):
|
|
2517
2324
|
node.gen.py_ast = [
|
|
2518
2325
|
self.sync(
|
|
2519
|
-
ast3.
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
)
|
|
2527
|
-
)
|
|
2528
|
-
],
|
|
2529
|
-
keywords=[],
|
|
2326
|
+
ast3.List(
|
|
2327
|
+
elts=(
|
|
2328
|
+
cast(list[ast3.expr], node.values.gen.py_ast)
|
|
2329
|
+
if node.values
|
|
2330
|
+
else []
|
|
2331
|
+
),
|
|
2332
|
+
ctx=ast3.Load(),
|
|
2530
2333
|
)
|
|
2531
2334
|
)
|
|
2532
2335
|
]
|
|
@@ -2534,94 +2337,79 @@ class PyastGenPass(Pass):
|
|
|
2534
2337
|
node.gen.py_ast = [
|
|
2535
2338
|
self.sync(
|
|
2536
2339
|
ast3.List(
|
|
2537
|
-
elts=
|
|
2538
|
-
|
|
2340
|
+
elts=(
|
|
2341
|
+
[cast(ast3.expr, item) for item in node.values.gen.py_ast]
|
|
2342
|
+
if node.values and node.values.gen.py_ast
|
|
2343
|
+
else []
|
|
2344
|
+
),
|
|
2345
|
+
ctx=cast(ast3.expr_context, node.py_ctx_func()),
|
|
2539
2346
|
)
|
|
2540
2347
|
)
|
|
2541
2348
|
]
|
|
2542
2349
|
|
|
2543
|
-
def exit_set_val(self, node:
|
|
2544
|
-
"""Sub objects.
|
|
2545
|
-
|
|
2546
|
-
values: Optional[SubNodeList[ExprType]],
|
|
2547
|
-
"""
|
|
2350
|
+
def exit_set_val(self, node: uni.SetVal) -> None:
|
|
2548
2351
|
node.gen.py_ast = [
|
|
2549
2352
|
self.sync(
|
|
2550
2353
|
ast3.Set(
|
|
2551
|
-
elts=
|
|
2552
|
-
|
|
2354
|
+
elts=(
|
|
2355
|
+
[cast(ast3.expr, i) for i in node.values.gen.py_ast]
|
|
2356
|
+
if node.values
|
|
2357
|
+
else []
|
|
2358
|
+
),
|
|
2553
2359
|
)
|
|
2554
2360
|
)
|
|
2555
2361
|
]
|
|
2556
2362
|
|
|
2557
|
-
def exit_tuple_val(self, node:
|
|
2558
|
-
"""Sub objects.
|
|
2559
|
-
|
|
2560
|
-
values: Optional[SubNodeList[ExprType | Assignment]],
|
|
2561
|
-
"""
|
|
2363
|
+
def exit_tuple_val(self, node: uni.TupleVal) -> None:
|
|
2562
2364
|
node.gen.py_ast = [
|
|
2563
2365
|
self.sync(
|
|
2564
2366
|
ast3.Tuple(
|
|
2565
|
-
elts=
|
|
2566
|
-
|
|
2367
|
+
elts=(
|
|
2368
|
+
cast(list[ast3.expr], node.values.gen.py_ast)
|
|
2369
|
+
if node.values
|
|
2370
|
+
else []
|
|
2371
|
+
),
|
|
2372
|
+
ctx=cast(ast3.expr_context, node.py_ctx_func()),
|
|
2567
2373
|
)
|
|
2568
2374
|
)
|
|
2569
2375
|
]
|
|
2570
2376
|
|
|
2571
|
-
def exit_dict_val(self, node:
|
|
2572
|
-
"""Sub objects.
|
|
2573
|
-
|
|
2574
|
-
kv_pairs: Sequence[KVPair],
|
|
2575
|
-
"""
|
|
2377
|
+
def exit_dict_val(self, node: uni.DictVal) -> None:
|
|
2576
2378
|
node.gen.py_ast = [
|
|
2577
2379
|
self.sync(
|
|
2578
2380
|
ast3.Dict(
|
|
2579
2381
|
keys=[
|
|
2580
|
-
(x.key.gen.py_ast[0] if x.key else None
|
|
2382
|
+
cast(ast3.expr, x.key.gen.py_ast[0]) if x.key else None
|
|
2383
|
+
for x in node.kv_pairs
|
|
2384
|
+
],
|
|
2385
|
+
values=[
|
|
2386
|
+
cast(ast3.expr, x.value.gen.py_ast[0]) for x in node.kv_pairs
|
|
2581
2387
|
],
|
|
2582
|
-
values=[x.value.gen.py_ast[0] for x in node.kv_pairs],
|
|
2583
2388
|
)
|
|
2584
2389
|
)
|
|
2585
2390
|
]
|
|
2586
2391
|
|
|
2587
|
-
def exit_k_v_pair(self, node:
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
key: ExprType,
|
|
2591
|
-
value: ExprType,
|
|
2592
|
-
"""
|
|
2593
|
-
# Processed elsewhere
|
|
2594
|
-
|
|
2595
|
-
def exit_k_w_pair(self, node: ast.KWPair) -> None:
|
|
2596
|
-
"""Sub objects.
|
|
2392
|
+
def exit_k_v_pair(self, node: uni.KVPair) -> None:
|
|
2393
|
+
pass
|
|
2597
2394
|
|
|
2598
|
-
|
|
2599
|
-
value: ExprType,
|
|
2600
|
-
"""
|
|
2395
|
+
def exit_k_w_pair(self, node: uni.KWPair) -> None:
|
|
2601
2396
|
node.gen.py_ast = [
|
|
2602
2397
|
self.sync(
|
|
2603
2398
|
ast3.keyword(
|
|
2604
2399
|
arg=node.key.sym_name if node.key else None,
|
|
2605
|
-
value=node.value.gen.py_ast[0],
|
|
2400
|
+
value=cast(ast3.expr, node.value.gen.py_ast[0]),
|
|
2606
2401
|
)
|
|
2607
2402
|
)
|
|
2608
2403
|
]
|
|
2609
2404
|
|
|
2610
|
-
def exit_inner_compr(self, node:
|
|
2611
|
-
"""Sub objects.
|
|
2612
|
-
|
|
2613
|
-
out_expr: ExprType,
|
|
2614
|
-
target: ExprType,
|
|
2615
|
-
collection: ExprType,
|
|
2616
|
-
conditional: Optional[ExprType],
|
|
2617
|
-
"""
|
|
2405
|
+
def exit_inner_compr(self, node: uni.InnerCompr) -> None:
|
|
2618
2406
|
node.gen.py_ast = [
|
|
2619
2407
|
self.sync(
|
|
2620
2408
|
ast3.comprehension(
|
|
2621
|
-
target=node.target.gen.py_ast[0],
|
|
2622
|
-
iter=node.collection.gen.py_ast[0],
|
|
2409
|
+
target=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
2410
|
+
iter=cast(ast3.expr, node.collection.gen.py_ast[0]),
|
|
2623
2411
|
ifs=(
|
|
2624
|
-
[x.gen.py_ast[0] for x in node.conditional]
|
|
2412
|
+
[cast(ast3.expr, x.gen.py_ast[0]) for x in node.conditional]
|
|
2625
2413
|
if node.conditional
|
|
2626
2414
|
else []
|
|
2627
2415
|
),
|
|
@@ -2630,129 +2418,107 @@ class PyastGenPass(Pass):
|
|
|
2630
2418
|
)
|
|
2631
2419
|
]
|
|
2632
2420
|
|
|
2633
|
-
def exit_list_compr(self, node:
|
|
2634
|
-
"""Sub objects.
|
|
2635
|
-
|
|
2636
|
-
out_expr: ExprType,
|
|
2637
|
-
compr: list[InnerCompr]
|
|
2638
|
-
"""
|
|
2421
|
+
def exit_list_compr(self, node: uni.ListCompr) -> None:
|
|
2639
2422
|
node.gen.py_ast = [
|
|
2640
2423
|
self.sync(
|
|
2641
|
-
ast3.
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
elt=node.out_expr.gen.py_ast[0],
|
|
2647
|
-
generators=[i.gen.py_ast[0] for i in node.compr],
|
|
2648
|
-
)
|
|
2649
|
-
)
|
|
2650
|
-
],
|
|
2651
|
-
keywords=[],
|
|
2424
|
+
ast3.ListComp(
|
|
2425
|
+
elt=cast(ast3.expr, node.out_expr.gen.py_ast[0]),
|
|
2426
|
+
generators=cast(
|
|
2427
|
+
list[ast3.comprehension], [i.gen.py_ast[0] for i in node.compr]
|
|
2428
|
+
),
|
|
2652
2429
|
)
|
|
2653
2430
|
)
|
|
2654
2431
|
]
|
|
2655
2432
|
|
|
2656
|
-
def exit_gen_compr(self, node:
|
|
2657
|
-
"""Sub objects.
|
|
2658
|
-
|
|
2659
|
-
out_expr: ExprType,
|
|
2660
|
-
compr: list[InnerCompr]
|
|
2661
|
-
"""
|
|
2433
|
+
def exit_gen_compr(self, node: uni.GenCompr) -> None:
|
|
2662
2434
|
node.gen.py_ast = [
|
|
2663
2435
|
self.sync(
|
|
2664
2436
|
ast3.GeneratorExp(
|
|
2665
|
-
elt=node.out_expr.gen.py_ast[0],
|
|
2666
|
-
generators=[
|
|
2437
|
+
elt=cast(ast3.expr, node.out_expr.gen.py_ast[0]),
|
|
2438
|
+
generators=[
|
|
2439
|
+
cast(ast3.comprehension, i.gen.py_ast[0]) for i in node.compr
|
|
2440
|
+
],
|
|
2667
2441
|
)
|
|
2668
2442
|
)
|
|
2669
2443
|
]
|
|
2670
2444
|
|
|
2671
|
-
def exit_set_compr(self, node:
|
|
2672
|
-
"""Sub objects.
|
|
2673
|
-
|
|
2674
|
-
out_expr: ExprType,
|
|
2675
|
-
compr: list[InnerCompr]
|
|
2676
|
-
"""
|
|
2445
|
+
def exit_set_compr(self, node: uni.SetCompr) -> None:
|
|
2677
2446
|
node.gen.py_ast = [
|
|
2678
2447
|
self.sync(
|
|
2679
2448
|
ast3.SetComp(
|
|
2680
|
-
elt=node.out_expr.gen.py_ast[0],
|
|
2681
|
-
generators=[
|
|
2449
|
+
elt=cast(ast3.expr, node.out_expr.gen.py_ast[0]),
|
|
2450
|
+
generators=[
|
|
2451
|
+
cast(ast3.comprehension, i.gen.py_ast[0]) for i in node.compr
|
|
2452
|
+
],
|
|
2682
2453
|
)
|
|
2683
2454
|
)
|
|
2684
2455
|
]
|
|
2685
2456
|
|
|
2686
|
-
def exit_dict_compr(self, node:
|
|
2687
|
-
"""Sub objects.
|
|
2688
|
-
|
|
2689
|
-
kv_pair: KVPair,
|
|
2690
|
-
names: SubNodeList[AtomType],
|
|
2691
|
-
collection: ExprType,
|
|
2692
|
-
conditional: Optional[ExprType],
|
|
2693
|
-
"""
|
|
2457
|
+
def exit_dict_compr(self, node: uni.DictCompr) -> None:
|
|
2694
2458
|
node.gen.py_ast = [
|
|
2695
2459
|
self.sync(
|
|
2696
2460
|
ast3.DictComp(
|
|
2697
|
-
key=
|
|
2698
|
-
|
|
2699
|
-
|
|
2461
|
+
key=(
|
|
2462
|
+
cast(ast3.expr, node.kv_pair.key.gen.py_ast[0])
|
|
2463
|
+
if node.kv_pair.key
|
|
2464
|
+
else cast(ast3.expr, ast3.Constant(value=None))
|
|
2465
|
+
),
|
|
2466
|
+
value=cast(ast3.expr, node.kv_pair.value.gen.py_ast[0]),
|
|
2467
|
+
generators=[
|
|
2468
|
+
cast(ast3.comprehension, i.gen.py_ast[0]) for i in node.compr
|
|
2469
|
+
],
|
|
2700
2470
|
)
|
|
2701
2471
|
)
|
|
2702
2472
|
]
|
|
2703
2473
|
|
|
2704
|
-
def exit_atom_trailer(self, node:
|
|
2705
|
-
"""Sub objects.
|
|
2706
|
-
|
|
2707
|
-
target: Expr,
|
|
2708
|
-
right: AtomExpr | Expr,
|
|
2709
|
-
is_attr: bool,
|
|
2710
|
-
is_null_ok: bool,
|
|
2711
|
-
is_genai: bool = False,
|
|
2712
|
-
"""
|
|
2474
|
+
def exit_atom_trailer(self, node: uni.AtomTrailer) -> None:
|
|
2713
2475
|
if node.is_genai:
|
|
2714
2476
|
node.gen.py_ast = []
|
|
2715
2477
|
if node.is_attr:
|
|
2716
|
-
if isinstance(node.right,
|
|
2478
|
+
if isinstance(node.right, uni.AstSymbolNode):
|
|
2717
2479
|
node.gen.py_ast = [
|
|
2718
2480
|
self.sync(
|
|
2719
2481
|
ast3.Attribute(
|
|
2720
|
-
value=node.target.gen.py_ast[0],
|
|
2482
|
+
value=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
2721
2483
|
attr=(node.right.sym_name),
|
|
2722
|
-
ctx=(node.right.py_ctx_func()),
|
|
2484
|
+
ctx=cast(ast3.expr_context, node.right.py_ctx_func()),
|
|
2723
2485
|
)
|
|
2724
2486
|
)
|
|
2725
2487
|
]
|
|
2726
2488
|
else:
|
|
2727
|
-
self.
|
|
2728
|
-
elif isinstance(node.right,
|
|
2489
|
+
self.log_error("Invalid attribute access")
|
|
2490
|
+
elif isinstance(node.right, uni.FilterCompr):
|
|
2729
2491
|
node.gen.py_ast = [
|
|
2730
2492
|
self.sync(
|
|
2731
2493
|
ast3.Call(
|
|
2732
|
-
func=self.
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2494
|
+
func=self.jaclib_obj("filter"),
|
|
2495
|
+
args=[],
|
|
2496
|
+
keywords=[
|
|
2497
|
+
self.sync(
|
|
2498
|
+
ast3.keyword(
|
|
2499
|
+
arg="items",
|
|
2500
|
+
value=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
2501
|
+
)
|
|
2502
|
+
),
|
|
2503
|
+
self.sync(
|
|
2504
|
+
ast3.keyword(
|
|
2505
|
+
arg="func",
|
|
2506
|
+
value=cast(ast3.expr, node.right.gen.py_ast[0]),
|
|
2507
|
+
)
|
|
2508
|
+
),
|
|
2509
|
+
],
|
|
2741
2510
|
)
|
|
2742
2511
|
)
|
|
2743
2512
|
]
|
|
2744
|
-
elif isinstance(node.right,
|
|
2513
|
+
elif isinstance(node.right, uni.AssignCompr):
|
|
2745
2514
|
node.gen.py_ast = [
|
|
2746
|
-
self.sync(
|
|
2747
|
-
ast3.Call(
|
|
2748
|
-
func=self.
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
ctx=ast3.Load(),
|
|
2753
|
-
)
|
|
2515
|
+
self.sync(
|
|
2516
|
+
ast3.Call(
|
|
2517
|
+
func=self.jaclib_obj("assign"),
|
|
2518
|
+
args=cast(
|
|
2519
|
+
list[ast3.expr],
|
|
2520
|
+
[node.target.gen.py_ast[0], node.right.gen.py_ast[0]],
|
|
2754
2521
|
),
|
|
2755
|
-
args=cast(ast3.Tuple, node.right.gen.py_ast[0]).elts,
|
|
2756
2522
|
keywords=[],
|
|
2757
2523
|
)
|
|
2758
2524
|
)
|
|
@@ -2761,11 +2527,11 @@ class PyastGenPass(Pass):
|
|
|
2761
2527
|
node.gen.py_ast = [
|
|
2762
2528
|
self.sync(
|
|
2763
2529
|
ast3.Subscript(
|
|
2764
|
-
value=node.target.gen.py_ast[0],
|
|
2765
|
-
slice=node.right.gen.py_ast[0],
|
|
2530
|
+
value=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
2531
|
+
slice=cast(ast3.expr, node.right.gen.py_ast[0]),
|
|
2766
2532
|
ctx=(
|
|
2767
|
-
node.right.py_ctx_func()
|
|
2768
|
-
if isinstance(node.right,
|
|
2533
|
+
cast(ast3.expr_context, node.right.py_ctx_func())
|
|
2534
|
+
if isinstance(node.right, uni.AstSymbolNode)
|
|
2769
2535
|
else ast3.Load()
|
|
2770
2536
|
),
|
|
2771
2537
|
)
|
|
@@ -2785,27 +2551,22 @@ class PyastGenPass(Pass):
|
|
|
2785
2551
|
target=self.sync(
|
|
2786
2552
|
ast3.Name(id="__jac_tmp", ctx=ast3.Store())
|
|
2787
2553
|
),
|
|
2788
|
-
value=node.target.gen.py_ast[0],
|
|
2554
|
+
value=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
2789
2555
|
)
|
|
2790
2556
|
),
|
|
2791
|
-
body=node.gen.py_ast[0],
|
|
2557
|
+
body=cast(ast3.expr, node.gen.py_ast[0]),
|
|
2792
2558
|
orelse=self.sync(ast3.Constant(value=None)),
|
|
2793
2559
|
)
|
|
2794
2560
|
)
|
|
2795
2561
|
]
|
|
2796
2562
|
|
|
2797
|
-
def exit_atom_unit(self, node:
|
|
2798
|
-
"""Sub objects.
|
|
2799
|
-
|
|
2800
|
-
value: AtomType | ExprType,
|
|
2801
|
-
is_paren: bool,
|
|
2802
|
-
"""
|
|
2563
|
+
def exit_atom_unit(self, node: uni.AtomUnit) -> None:
|
|
2803
2564
|
node.gen.py_ast = node.value.gen.py_ast
|
|
2804
2565
|
|
|
2805
2566
|
def by_llm_call(
|
|
2806
2567
|
self,
|
|
2807
2568
|
model: ast3.AST,
|
|
2808
|
-
model_params: dict[str,
|
|
2569
|
+
model_params: dict[str, uni.Expr],
|
|
2809
2570
|
scope: ast3.AST,
|
|
2810
2571
|
inputs: Sequence[Optional[ast3.AST]],
|
|
2811
2572
|
outputs: Sequence[Optional[ast3.AST]] | ast3.Call,
|
|
@@ -2815,9 +2576,9 @@ class PyastGenPass(Pass):
|
|
|
2815
2576
|
) -> ast3.Call:
|
|
2816
2577
|
"""Return the LLM Call, e.g. _Jac.with_llm()."""
|
|
2817
2578
|
# to avoid circular import
|
|
2818
|
-
from jaclang.
|
|
2579
|
+
from jaclang.runtimelib.machine import JacMachineInterface
|
|
2819
2580
|
|
|
2820
|
-
return
|
|
2581
|
+
return JacMachineInterface.by_llm_call(
|
|
2821
2582
|
self,
|
|
2822
2583
|
model,
|
|
2823
2584
|
model_params,
|
|
@@ -2829,31 +2590,31 @@ class PyastGenPass(Pass):
|
|
|
2829
2590
|
exclude_info,
|
|
2830
2591
|
)
|
|
2831
2592
|
|
|
2832
|
-
def get_by_llm_call_args(self, node:
|
|
2593
|
+
def get_by_llm_call_args(self, node: uni.FuncCall) -> dict:
|
|
2833
2594
|
"""Get the arguments for the by_llm_call."""
|
|
2834
2595
|
# to avoid circular import
|
|
2835
|
-
from jaclang.
|
|
2836
|
-
|
|
2837
|
-
return JacFeature.get_by_llm_call_args(self, node)
|
|
2596
|
+
from jaclang.runtimelib.machine import JacMachineInterface
|
|
2838
2597
|
|
|
2839
|
-
|
|
2840
|
-
"""Sub objects.
|
|
2598
|
+
return JacMachineInterface.get_by_llm_call_args(self, node)
|
|
2841
2599
|
|
|
2842
|
-
|
|
2843
|
-
params: Optional[SubNodeList[Expr | KWPair]],
|
|
2844
|
-
"""
|
|
2600
|
+
def exit_func_call(self, node: uni.FuncCall) -> None:
|
|
2845
2601
|
func = node.target.gen.py_ast[0]
|
|
2846
2602
|
args = []
|
|
2847
2603
|
keywords = []
|
|
2848
2604
|
if node.params and len(node.params.items) > 0:
|
|
2849
2605
|
for x in node.params.items:
|
|
2850
|
-
if isinstance(x,
|
|
2606
|
+
if isinstance(x, uni.UnaryExpr) and x.op.name == Tok.STAR_POW:
|
|
2851
2607
|
keywords.append(
|
|
2852
|
-
self.sync(
|
|
2608
|
+
self.sync(
|
|
2609
|
+
ast3.keyword(
|
|
2610
|
+
value=cast(ast3.expr, x.operand.gen.py_ast[0])
|
|
2611
|
+
),
|
|
2612
|
+
x,
|
|
2613
|
+
)
|
|
2853
2614
|
)
|
|
2854
|
-
elif isinstance(x,
|
|
2615
|
+
elif isinstance(x, uni.Expr):
|
|
2855
2616
|
args.append(x.gen.py_ast[0])
|
|
2856
|
-
elif isinstance(x,
|
|
2617
|
+
elif isinstance(x, uni.KWPair) and isinstance(
|
|
2857
2618
|
x.gen.py_ast[0], ast3.keyword
|
|
2858
2619
|
):
|
|
2859
2620
|
keywords.append(x.gen.py_ast[0])
|
|
@@ -2864,15 +2625,16 @@ class PyastGenPass(Pass):
|
|
|
2864
2625
|
node.gen.py_ast = [self.sync(self.by_llm_call(**by_llm_call_args))]
|
|
2865
2626
|
else:
|
|
2866
2627
|
node.gen.py_ast = [
|
|
2867
|
-
self.sync(
|
|
2628
|
+
self.sync(
|
|
2629
|
+
ast3.Call(
|
|
2630
|
+
func=cast(ast3.expr, func),
|
|
2631
|
+
args=[cast(ast3.expr, arg) for arg in args],
|
|
2632
|
+
keywords=keywords,
|
|
2633
|
+
)
|
|
2634
|
+
)
|
|
2868
2635
|
]
|
|
2869
2636
|
|
|
2870
|
-
def exit_index_slice(self, node:
|
|
2871
|
-
"""Sub objects.
|
|
2872
|
-
|
|
2873
|
-
slices: list[IndexSlice.Slice],
|
|
2874
|
-
is_range: bool,
|
|
2875
|
-
"""
|
|
2637
|
+
def exit_index_slice(self, node: uni.IndexSlice) -> None:
|
|
2876
2638
|
if node.is_range:
|
|
2877
2639
|
if len(node.slices) > 1: # Multiple slices. Example arr[a:b, c:d]
|
|
2878
2640
|
node.gen.py_ast = [
|
|
@@ -2882,17 +2644,17 @@ class PyastGenPass(Pass):
|
|
|
2882
2644
|
self.sync(
|
|
2883
2645
|
ast3.Slice(
|
|
2884
2646
|
lower=(
|
|
2885
|
-
slice.start.gen.py_ast[0]
|
|
2647
|
+
cast(ast3.expr, slice.start.gen.py_ast[0])
|
|
2886
2648
|
if slice.start
|
|
2887
2649
|
else None
|
|
2888
2650
|
),
|
|
2889
2651
|
upper=(
|
|
2890
|
-
slice.stop.gen.py_ast[0]
|
|
2652
|
+
cast(ast3.expr, slice.stop.gen.py_ast[0])
|
|
2891
2653
|
if slice.stop
|
|
2892
2654
|
else None
|
|
2893
2655
|
),
|
|
2894
2656
|
step=(
|
|
2895
|
-
slice.step.gen.py_ast[0]
|
|
2657
|
+
cast(ast3.expr, slice.step.gen.py_ast[0])
|
|
2896
2658
|
if slice.step
|
|
2897
2659
|
else None
|
|
2898
2660
|
),
|
|
@@ -2909,9 +2671,21 @@ class PyastGenPass(Pass):
|
|
|
2909
2671
|
node.gen.py_ast = [
|
|
2910
2672
|
self.sync(
|
|
2911
2673
|
ast3.Slice(
|
|
2912
|
-
lower=
|
|
2913
|
-
|
|
2914
|
-
|
|
2674
|
+
lower=(
|
|
2675
|
+
cast(ast3.expr, slice.start.gen.py_ast[0])
|
|
2676
|
+
if slice.start
|
|
2677
|
+
else None
|
|
2678
|
+
),
|
|
2679
|
+
upper=(
|
|
2680
|
+
cast(ast3.expr, slice.stop.gen.py_ast[0])
|
|
2681
|
+
if slice.stop
|
|
2682
|
+
else None
|
|
2683
|
+
),
|
|
2684
|
+
step=(
|
|
2685
|
+
cast(ast3.expr, slice.step.gen.py_ast[0])
|
|
2686
|
+
if slice.step
|
|
2687
|
+
else None
|
|
2688
|
+
),
|
|
2915
2689
|
)
|
|
2916
2690
|
)
|
|
2917
2691
|
]
|
|
@@ -2921,11 +2695,7 @@ class PyastGenPass(Pass):
|
|
|
2921
2695
|
else:
|
|
2922
2696
|
node.gen.py_ast = []
|
|
2923
2697
|
|
|
2924
|
-
def exit_special_var_ref(self, node:
|
|
2925
|
-
"""Sub objects.
|
|
2926
|
-
|
|
2927
|
-
var: Token,
|
|
2928
|
-
"""
|
|
2698
|
+
def exit_special_var_ref(self, node: uni.SpecialVarRef) -> None:
|
|
2929
2699
|
if node.name == Tok.KW_SUPER:
|
|
2930
2700
|
node.gen.py_ast = [
|
|
2931
2701
|
self.sync(
|
|
@@ -2952,54 +2722,56 @@ class PyastGenPass(Pass):
|
|
|
2952
2722
|
self.sync(ast3.Name(id=node.sym_name, ctx=node.py_ctx_func()))
|
|
2953
2723
|
]
|
|
2954
2724
|
|
|
2955
|
-
def exit_edge_ref_trailer(self, node:
|
|
2956
|
-
"""Sub objects.
|
|
2957
|
-
|
|
2958
|
-
chain: list[Expr|FilterCompr],
|
|
2959
|
-
edges_only: bool,
|
|
2960
|
-
"""
|
|
2725
|
+
def exit_edge_ref_trailer(self, node: uni.EdgeRefTrailer) -> None:
|
|
2961
2726
|
pynode = node.chain[0].gen.py_ast[0]
|
|
2962
2727
|
chomp = [*node.chain]
|
|
2963
2728
|
last_edge = None
|
|
2964
2729
|
if node.edges_only:
|
|
2965
2730
|
for i in node.chain:
|
|
2966
|
-
if isinstance(i,
|
|
2731
|
+
if isinstance(i, uni.EdgeOpRef):
|
|
2967
2732
|
last_edge = i
|
|
2968
2733
|
while len(chomp):
|
|
2969
2734
|
cur = chomp[0]
|
|
2970
2735
|
chomp = chomp[1:]
|
|
2971
|
-
if len(chomp) == len(node.chain) - 1 and not isinstance(cur,
|
|
2736
|
+
if len(chomp) == len(node.chain) - 1 and not isinstance(cur, uni.EdgeOpRef):
|
|
2972
2737
|
continue
|
|
2973
2738
|
next_i = chomp[0] if chomp else None
|
|
2974
|
-
if isinstance(cur,
|
|
2975
|
-
not next_i or not isinstance(next_i,
|
|
2739
|
+
if isinstance(cur, uni.EdgeOpRef) and (
|
|
2740
|
+
not next_i or not isinstance(next_i, uni.EdgeOpRef)
|
|
2976
2741
|
):
|
|
2977
2742
|
pynode = self.translate_edge_op_ref(
|
|
2978
2743
|
loc=pynode,
|
|
2979
2744
|
node=cur,
|
|
2980
2745
|
targ=(
|
|
2981
2746
|
next_i.gen.py_ast[0]
|
|
2982
|
-
if next_i and not isinstance(next_i,
|
|
2747
|
+
if next_i and not isinstance(next_i, uni.FilterCompr)
|
|
2983
2748
|
else None
|
|
2984
2749
|
),
|
|
2985
2750
|
edges_only=node.edges_only and cur == last_edge,
|
|
2986
2751
|
)
|
|
2987
|
-
if next_i and isinstance(next_i,
|
|
2752
|
+
if next_i and isinstance(next_i, uni.FilterCompr):
|
|
2988
2753
|
pynode = self.sync(
|
|
2989
2754
|
ast3.Call(
|
|
2990
|
-
func=self.
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2755
|
+
func=self.jaclib_obj("filter"),
|
|
2756
|
+
args=[],
|
|
2757
|
+
keywords=[
|
|
2758
|
+
self.sync(
|
|
2759
|
+
ast3.keyword(
|
|
2760
|
+
arg="items",
|
|
2761
|
+
value=cast(ast3.expr, pynode),
|
|
2762
|
+
)
|
|
2763
|
+
),
|
|
2764
|
+
self.sync(
|
|
2765
|
+
ast3.keyword(
|
|
2766
|
+
arg="func",
|
|
2767
|
+
value=cast(ast3.expr, next_i.gen.py_ast[0]),
|
|
2768
|
+
)
|
|
2769
|
+
),
|
|
2770
|
+
],
|
|
2999
2771
|
)
|
|
3000
2772
|
)
|
|
3001
2773
|
chomp = chomp[1:] if next_i else chomp
|
|
3002
|
-
elif isinstance(cur,
|
|
2774
|
+
elif isinstance(cur, uni.EdgeOpRef) and isinstance(next_i, uni.EdgeOpRef):
|
|
3003
2775
|
pynode = self.translate_edge_op_ref(
|
|
3004
2776
|
pynode,
|
|
3005
2777
|
cur,
|
|
@@ -3011,13 +2783,7 @@ class PyastGenPass(Pass):
|
|
|
3011
2783
|
|
|
3012
2784
|
node.gen.py_ast = [pynode]
|
|
3013
2785
|
|
|
3014
|
-
def exit_edge_op_ref(self, node:
|
|
3015
|
-
"""Sub objects.
|
|
3016
|
-
|
|
3017
|
-
filter_type: Optional[ExprType],
|
|
3018
|
-
filter_cond: Optional[FilterCompr],
|
|
3019
|
-
edge_dir: EdgeDir,
|
|
3020
|
-
"""
|
|
2786
|
+
def exit_edge_op_ref(self, node: uni.EdgeOpRef) -> None:
|
|
3021
2787
|
loc = self.sync(
|
|
3022
2788
|
ast3.Name(id=Con.HERE.value, ctx=ast3.Load())
|
|
3023
2789
|
if node.from_walker
|
|
@@ -3028,107 +2794,16 @@ class PyastGenPass(Pass):
|
|
|
3028
2794
|
def translate_edge_op_ref(
|
|
3029
2795
|
self,
|
|
3030
2796
|
loc: ast3.AST,
|
|
3031
|
-
node:
|
|
2797
|
+
node: uni.EdgeOpRef,
|
|
3032
2798
|
targ: ast3.AST | None,
|
|
3033
2799
|
edges_only: bool,
|
|
3034
2800
|
) -> ast3.AST:
|
|
3035
2801
|
"""Generate ast for edge op ref call."""
|
|
3036
|
-
|
|
3037
|
-
keywords = []
|
|
3038
|
-
|
|
3039
|
-
if node.filter_cond and node.filter_cond.f_type:
|
|
3040
|
-
args.append(self.sync(node.filter_cond.f_type.gen.py_ast[0]))
|
|
3041
|
-
|
|
3042
|
-
edge_iter_name = "edge"
|
|
3043
|
-
if node.filter_cond.compares:
|
|
3044
|
-
|
|
3045
|
-
expr: ast3.expr | None = None
|
|
3046
|
-
comp = node.filter_cond.compares.items[0]
|
|
3047
|
-
if (
|
|
3048
|
-
len(node.filter_cond.compares.items) == 1
|
|
3049
|
-
and isinstance(comp.gen.py_ast[0], ast3.Compare)
|
|
3050
|
-
and isinstance(comp.gen.py_ast[0].left, ast3.Name)
|
|
3051
|
-
):
|
|
3052
|
-
expr = self.sync(
|
|
3053
|
-
ast3.Compare(
|
|
3054
|
-
left=self.sync(
|
|
3055
|
-
ast3.Attribute(
|
|
3056
|
-
value=self.sync(
|
|
3057
|
-
ast3.Name(
|
|
3058
|
-
id=edge_iter_name,
|
|
3059
|
-
ctx=ast3.Load(),
|
|
3060
|
-
),
|
|
3061
|
-
jac_node=comp,
|
|
3062
|
-
),
|
|
3063
|
-
attr=comp.gen.py_ast[0].left.id,
|
|
3064
|
-
ctx=ast3.Load(),
|
|
3065
|
-
),
|
|
3066
|
-
jac_node=comp,
|
|
3067
|
-
),
|
|
3068
|
-
ops=comp.gen.py_ast[0].ops,
|
|
3069
|
-
comparators=comp.gen.py_ast[0].comparators,
|
|
3070
|
-
),
|
|
3071
|
-
jac_node=comp,
|
|
3072
|
-
)
|
|
3073
|
-
else:
|
|
3074
|
-
expr = self.sync(
|
|
3075
|
-
ast3.BoolOp(
|
|
3076
|
-
op=self.sync(ast3.And()),
|
|
3077
|
-
values=[
|
|
3078
|
-
self.sync(
|
|
3079
|
-
ast3.Compare(
|
|
3080
|
-
left=self.sync(
|
|
3081
|
-
ast3.Attribute(
|
|
3082
|
-
value=self.sync(
|
|
3083
|
-
ast3.Name(
|
|
3084
|
-
id=edge_iter_name,
|
|
3085
|
-
ctx=ast3.Load(),
|
|
3086
|
-
),
|
|
3087
|
-
jac_node=comp,
|
|
3088
|
-
),
|
|
3089
|
-
attr=comp.gen.py_ast[0].left.id,
|
|
3090
|
-
ctx=ast3.Load(),
|
|
3091
|
-
),
|
|
3092
|
-
jac_node=comp,
|
|
3093
|
-
),
|
|
3094
|
-
ops=comp.gen.py_ast[0].ops,
|
|
3095
|
-
comparators=comp.gen.py_ast[0].comparators,
|
|
3096
|
-
),
|
|
3097
|
-
jac_node=comp,
|
|
3098
|
-
)
|
|
3099
|
-
for comp in node.filter_cond.compares.items
|
|
3100
|
-
if isinstance(comp.gen.py_ast[0], ast3.Compare)
|
|
3101
|
-
and isinstance(comp.gen.py_ast[0].left, ast3.Name)
|
|
3102
|
-
],
|
|
3103
|
-
),
|
|
3104
|
-
)
|
|
3105
|
-
assert expr is not None
|
|
3106
|
-
|
|
3107
|
-
args.append(
|
|
3108
|
-
self.sync(
|
|
3109
|
-
ast3.Lambda(
|
|
3110
|
-
args=self.sync(
|
|
3111
|
-
ast3.arguments(
|
|
3112
|
-
posonlyargs=[],
|
|
3113
|
-
args=[self.sync(ast3.arg(arg=edge_iter_name))],
|
|
3114
|
-
kwonlyargs=[],
|
|
3115
|
-
kw_defaults=[],
|
|
3116
|
-
defaults=[],
|
|
3117
|
-
)
|
|
3118
|
-
),
|
|
3119
|
-
body=expr,
|
|
3120
|
-
)
|
|
3121
|
-
)
|
|
3122
|
-
)
|
|
2802
|
+
keywords = [self.sync(ast3.keyword(arg="sources", value=cast(ast3.expr, loc)))]
|
|
3123
2803
|
|
|
3124
|
-
if targ
|
|
2804
|
+
if targ:
|
|
3125
2805
|
keywords.append(
|
|
3126
|
-
self.sync(
|
|
3127
|
-
ast3.keyword(
|
|
3128
|
-
arg="target",
|
|
3129
|
-
value=targ,
|
|
3130
|
-
)
|
|
3131
|
-
)
|
|
2806
|
+
self.sync(ast3.keyword(arg="targets", value=cast(ast3.expr, targ)))
|
|
3132
2807
|
)
|
|
3133
2808
|
|
|
3134
2809
|
if node.edge_dir != EdgeDir.OUT:
|
|
@@ -3147,6 +2822,18 @@ class PyastGenPass(Pass):
|
|
|
3147
2822
|
)
|
|
3148
2823
|
)
|
|
3149
2824
|
|
|
2825
|
+
if node.filter_cond:
|
|
2826
|
+
keywords.append(
|
|
2827
|
+
self.sync(
|
|
2828
|
+
ast3.keyword(
|
|
2829
|
+
arg="filter",
|
|
2830
|
+
value=cast(
|
|
2831
|
+
ast3.expr, self.sync(node.filter_cond.gen.py_ast[0])
|
|
2832
|
+
),
|
|
2833
|
+
)
|
|
2834
|
+
)
|
|
2835
|
+
)
|
|
2836
|
+
|
|
3150
2837
|
if edges_only:
|
|
3151
2838
|
keywords.append(
|
|
3152
2839
|
self.sync(
|
|
@@ -3159,42 +2846,20 @@ class PyastGenPass(Pass):
|
|
|
3159
2846
|
|
|
3160
2847
|
return self.sync(
|
|
3161
2848
|
ast3.Call(
|
|
3162
|
-
func=self.
|
|
3163
|
-
|
|
3164
|
-
value=loc,
|
|
3165
|
-
attr="refs",
|
|
3166
|
-
ctx=ast3.Load(),
|
|
3167
|
-
)
|
|
3168
|
-
),
|
|
3169
|
-
args=args,
|
|
2849
|
+
func=self.jaclib_obj("refs"),
|
|
2850
|
+
args=[],
|
|
3170
2851
|
keywords=keywords,
|
|
3171
2852
|
)
|
|
3172
2853
|
)
|
|
3173
2854
|
|
|
3174
|
-
def exit_disconnect_op(self, node:
|
|
3175
|
-
"""Sub objects.
|
|
3176
|
-
|
|
3177
|
-
edge_spec: EdgeOpRef,
|
|
3178
|
-
"""
|
|
2855
|
+
def exit_disconnect_op(self, node: uni.DisconnectOp) -> None:
|
|
3179
2856
|
node.gen.py_ast = node.edge_spec.gen.py_ast
|
|
3180
2857
|
|
|
3181
|
-
def exit_connect_op(self, node:
|
|
3182
|
-
"""Sub objects.
|
|
3183
|
-
|
|
3184
|
-
conn_type: Optional[ExprType],
|
|
3185
|
-
conn_assign: Optional[AssignCompr],
|
|
3186
|
-
edge_dir: EdgeDir,
|
|
3187
|
-
"""
|
|
2858
|
+
def exit_connect_op(self, node: uni.ConnectOp) -> None:
|
|
3188
2859
|
node.gen.py_ast = [
|
|
3189
2860
|
self.sync(
|
|
3190
2861
|
ast3.Call(
|
|
3191
|
-
func=self.
|
|
3192
|
-
ast3.Attribute(
|
|
3193
|
-
value=self.jaclib_obj(Con.JAC_FEATURE.value),
|
|
3194
|
-
attr="build_edge",
|
|
3195
|
-
ctx=ast3.Load(),
|
|
3196
|
-
)
|
|
3197
|
-
),
|
|
2862
|
+
func=self.jaclib_obj("build_edge"),
|
|
3198
2863
|
args=[],
|
|
3199
2864
|
keywords=[
|
|
3200
2865
|
self.sync(
|
|
@@ -3209,7 +2874,7 @@ class PyastGenPass(Pass):
|
|
|
3209
2874
|
ast3.keyword(
|
|
3210
2875
|
arg="conn_type",
|
|
3211
2876
|
value=(
|
|
3212
|
-
node.conn_type.gen.py_ast[0]
|
|
2877
|
+
cast(ast3.expr, node.conn_type.gen.py_ast[0])
|
|
3213
2878
|
if node.conn_type
|
|
3214
2879
|
else self.sync(ast3.Constant(value=None))
|
|
3215
2880
|
),
|
|
@@ -3219,7 +2884,7 @@ class PyastGenPass(Pass):
|
|
|
3219
2884
|
ast3.keyword(
|
|
3220
2885
|
arg="conn_assign",
|
|
3221
2886
|
value=(
|
|
3222
|
-
node.conn_assign.gen.py_ast[0]
|
|
2887
|
+
cast(ast3.expr, node.conn_assign.gen.py_ast[0])
|
|
3223
2888
|
if node.conn_assign
|
|
3224
2889
|
else self.sync(ast3.Constant(value=None))
|
|
3225
2890
|
),
|
|
@@ -3230,13 +2895,39 @@ class PyastGenPass(Pass):
|
|
|
3230
2895
|
)
|
|
3231
2896
|
]
|
|
3232
2897
|
|
|
3233
|
-
def exit_filter_compr(self, node:
|
|
3234
|
-
""
|
|
2898
|
+
def exit_filter_compr(self, node: uni.FilterCompr) -> None:
|
|
2899
|
+
iter_name = "i"
|
|
3235
2900
|
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
2901
|
+
comprs: list[ast3.Compare | ast3.Call] = (
|
|
2902
|
+
[
|
|
2903
|
+
self.sync(
|
|
2904
|
+
ast3.Call(
|
|
2905
|
+
func=self.sync(
|
|
2906
|
+
ast3.Name(
|
|
2907
|
+
id="isinstance",
|
|
2908
|
+
ctx=ast3.Load(),
|
|
2909
|
+
)
|
|
2910
|
+
),
|
|
2911
|
+
args=cast(
|
|
2912
|
+
list[ast3.expr],
|
|
2913
|
+
[
|
|
2914
|
+
self.sync(
|
|
2915
|
+
ast3.Name(
|
|
2916
|
+
id=iter_name,
|
|
2917
|
+
ctx=ast3.Load(),
|
|
2918
|
+
)
|
|
2919
|
+
),
|
|
2920
|
+
self.sync(node.f_type.gen.py_ast[0]),
|
|
2921
|
+
],
|
|
2922
|
+
),
|
|
2923
|
+
keywords=[],
|
|
2924
|
+
)
|
|
2925
|
+
)
|
|
2926
|
+
]
|
|
2927
|
+
if node.f_type
|
|
2928
|
+
else []
|
|
2929
|
+
)
|
|
2930
|
+
comprs.extend(
|
|
3240
2931
|
self.sync(
|
|
3241
2932
|
ast3.Compare(
|
|
3242
2933
|
left=self.sync(
|
|
@@ -3261,214 +2952,158 @@ class PyastGenPass(Pass):
|
|
|
3261
2952
|
for x in (node.compares.items if node.compares else [])
|
|
3262
2953
|
if isinstance(x.gen.py_ast[0], ast3.Compare)
|
|
3263
2954
|
and isinstance(x.gen.py_ast[0].left, ast3.Name)
|
|
3264
|
-
|
|
2955
|
+
)
|
|
3265
2956
|
|
|
3266
|
-
body
|
|
2957
|
+
if body := (
|
|
3267
2958
|
self.sync(
|
|
3268
2959
|
ast3.BoolOp(
|
|
3269
2960
|
op=self.sync(ast3.And()),
|
|
3270
|
-
values=comprs,
|
|
2961
|
+
values=[cast(ast3.expr, item) for item in comprs],
|
|
3271
2962
|
)
|
|
3272
2963
|
)
|
|
3273
2964
|
if len(comprs) > 1
|
|
3274
2965
|
else (comprs[0] if comprs else None)
|
|
3275
|
-
)
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
(
|
|
3287
|
-
self.sync(
|
|
3288
|
-
ast3.Lambda(
|
|
3289
|
-
args=self.sync(
|
|
3290
|
-
ast3.arguments(
|
|
3291
|
-
posonlyargs=[],
|
|
3292
|
-
args=[self.sync(ast3.arg(arg=iter_name))],
|
|
3293
|
-
kwonlyargs=[],
|
|
3294
|
-
kw_defaults=[],
|
|
3295
|
-
defaults=[],
|
|
3296
|
-
)
|
|
3297
|
-
),
|
|
3298
|
-
body=body,
|
|
3299
|
-
)
|
|
2966
|
+
):
|
|
2967
|
+
node.gen.py_ast = [
|
|
2968
|
+
self.sync(
|
|
2969
|
+
ast3.Lambda(
|
|
2970
|
+
args=self.sync(
|
|
2971
|
+
ast3.arguments(
|
|
2972
|
+
posonlyargs=[],
|
|
2973
|
+
args=[self.sync(ast3.arg(arg=iter_name))],
|
|
2974
|
+
kwonlyargs=[],
|
|
2975
|
+
kw_defaults=[],
|
|
2976
|
+
defaults=[],
|
|
3300
2977
|
)
|
|
3301
|
-
if body
|
|
3302
|
-
else self.sync(ast3.Constant(value=None))
|
|
3303
2978
|
),
|
|
3304
|
-
|
|
3305
|
-
|
|
2979
|
+
body=body,
|
|
2980
|
+
)
|
|
3306
2981
|
)
|
|
3307
|
-
|
|
3308
|
-
]
|
|
3309
|
-
|
|
3310
|
-
def exit_assign_compr(self, node: ast.AssignCompr) -> None:
|
|
3311
|
-
"""Sub objects.
|
|
2982
|
+
]
|
|
3312
2983
|
|
|
3313
|
-
|
|
3314
|
-
"""
|
|
2984
|
+
def exit_assign_compr(self, node: uni.AssignCompr) -> None:
|
|
3315
2985
|
keys = []
|
|
3316
2986
|
values = []
|
|
3317
2987
|
for i in node.assigns.items:
|
|
3318
2988
|
if i.key: # TODO: add support for **kwargs in assign_compr
|
|
3319
2989
|
keys.append(self.sync(ast3.Constant(i.key.sym_name)))
|
|
3320
2990
|
values.append(i.value.gen.py_ast[0])
|
|
3321
|
-
key_tup = self.sync(
|
|
3322
|
-
|
|
2991
|
+
key_tup = self.sync(
|
|
2992
|
+
ast3.Tuple(
|
|
2993
|
+
elts=[key for key in keys if isinstance(key, ast3.expr)],
|
|
2994
|
+
ctx=ast3.Load(),
|
|
2995
|
+
)
|
|
2996
|
+
)
|
|
2997
|
+
val_tup = self.sync(
|
|
2998
|
+
ast3.Tuple(
|
|
2999
|
+
elts=[v for v in values if isinstance(v, ast3.expr)], ctx=ast3.Load()
|
|
3000
|
+
)
|
|
3001
|
+
)
|
|
3323
3002
|
node.gen.py_ast = [
|
|
3324
3003
|
self.sync(ast3.Tuple(elts=[key_tup, val_tup], ctx=ast3.Load()))
|
|
3325
3004
|
]
|
|
3326
3005
|
|
|
3327
|
-
def exit_match_stmt(self, node:
|
|
3328
|
-
"""Sub objects.
|
|
3329
|
-
|
|
3330
|
-
target: Expr,
|
|
3331
|
-
cases: list[MatchCase],
|
|
3332
|
-
"""
|
|
3006
|
+
def exit_match_stmt(self, node: uni.MatchStmt) -> None:
|
|
3333
3007
|
node.gen.py_ast = [
|
|
3334
3008
|
self.sync(
|
|
3335
3009
|
ast3.Match(
|
|
3336
|
-
subject=node.target.gen.py_ast[0],
|
|
3337
|
-
cases=[x.gen.py_ast[0] for x in node.cases],
|
|
3010
|
+
subject=cast(ast3.expr, node.target.gen.py_ast[0]),
|
|
3011
|
+
cases=[cast(ast3.match_case, x.gen.py_ast[0]) for x in node.cases],
|
|
3338
3012
|
)
|
|
3339
3013
|
)
|
|
3340
3014
|
]
|
|
3341
3015
|
|
|
3342
|
-
def exit_match_case(self, node:
|
|
3343
|
-
"""Sub objects.
|
|
3344
|
-
|
|
3345
|
-
pattern: MatchPattern,
|
|
3346
|
-
guard: Optional[ExprType],
|
|
3347
|
-
body: list[CodeBlockStmt],
|
|
3348
|
-
"""
|
|
3016
|
+
def exit_match_case(self, node: uni.MatchCase) -> None:
|
|
3349
3017
|
node.gen.py_ast = [
|
|
3350
3018
|
self.sync(
|
|
3351
3019
|
ast3.match_case(
|
|
3352
|
-
pattern=node.pattern.gen.py_ast[0],
|
|
3353
|
-
guard=
|
|
3354
|
-
|
|
3020
|
+
pattern=cast(ast3.pattern, node.pattern.gen.py_ast[0]),
|
|
3021
|
+
guard=(
|
|
3022
|
+
cast(ast3.expr, node.guard.gen.py_ast[0])
|
|
3023
|
+
if node.guard
|
|
3024
|
+
else None
|
|
3025
|
+
),
|
|
3026
|
+
body=[cast(ast3.stmt, x.gen.py_ast[0]) for x in node.body],
|
|
3355
3027
|
)
|
|
3356
3028
|
)
|
|
3357
3029
|
]
|
|
3358
3030
|
|
|
3359
|
-
def exit_match_or(self, node:
|
|
3360
|
-
"""Sub objects.
|
|
3361
|
-
|
|
3362
|
-
patterns: list[MatchPattern],
|
|
3363
|
-
"""
|
|
3031
|
+
def exit_match_or(self, node: uni.MatchOr) -> None:
|
|
3364
3032
|
node.gen.py_ast = [
|
|
3365
3033
|
self.sync(
|
|
3366
3034
|
ast3.MatchOr(
|
|
3367
|
-
patterns=[
|
|
3035
|
+
patterns=[
|
|
3036
|
+
cast(ast3.pattern, x.gen.py_ast[0]) for x in node.patterns
|
|
3037
|
+
],
|
|
3368
3038
|
)
|
|
3369
3039
|
)
|
|
3370
3040
|
]
|
|
3371
3041
|
|
|
3372
|
-
def exit_match_as(self, node:
|
|
3373
|
-
"""Sub objects.
|
|
3374
|
-
|
|
3375
|
-
name: NameType,
|
|
3376
|
-
pattern: MatchPattern,
|
|
3377
|
-
"""
|
|
3042
|
+
def exit_match_as(self, node: uni.MatchAs) -> None:
|
|
3378
3043
|
node.gen.py_ast = [
|
|
3379
3044
|
self.sync(
|
|
3380
3045
|
ast3.MatchAs(
|
|
3381
3046
|
name=node.name.sym_name,
|
|
3382
|
-
pattern=
|
|
3047
|
+
pattern=(
|
|
3048
|
+
cast(ast3.pattern, node.pattern.gen.py_ast[0])
|
|
3049
|
+
if node.pattern
|
|
3050
|
+
else None
|
|
3051
|
+
),
|
|
3383
3052
|
)
|
|
3384
3053
|
)
|
|
3385
3054
|
]
|
|
3386
3055
|
|
|
3387
|
-
def exit_match_wild(self, node:
|
|
3388
|
-
"""Sub objects."""
|
|
3056
|
+
def exit_match_wild(self, node: uni.MatchWild) -> None:
|
|
3389
3057
|
node.gen.py_ast = [self.sync(ast3.MatchAs())]
|
|
3390
3058
|
|
|
3391
|
-
def exit_match_value(self, node:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
"""
|
|
3396
|
-
node.gen.py_ast = [self.sync(ast3.MatchValue(value=node.value.gen.py_ast[0]))]
|
|
3397
|
-
|
|
3398
|
-
def exit_match_singleton(self, node: ast.MatchSingleton) -> None:
|
|
3399
|
-
"""Sub objects.
|
|
3059
|
+
def exit_match_value(self, node: uni.MatchValue) -> None:
|
|
3060
|
+
node.gen.py_ast = [
|
|
3061
|
+
self.sync(ast3.MatchValue(value=cast(ast3.expr, node.value.gen.py_ast[0])))
|
|
3062
|
+
]
|
|
3400
3063
|
|
|
3401
|
-
|
|
3402
|
-
"""
|
|
3064
|
+
def exit_match_singleton(self, node: uni.MatchSingleton) -> None:
|
|
3403
3065
|
node.gen.py_ast = [self.sync(ast3.MatchSingleton(value=node.value.lit_value))]
|
|
3404
3066
|
|
|
3405
|
-
def exit_match_sequence(self, node:
|
|
3406
|
-
"""Sub objects.
|
|
3407
|
-
|
|
3408
|
-
values: list[MatchPattern],
|
|
3409
|
-
"""
|
|
3067
|
+
def exit_match_sequence(self, node: uni.MatchSequence) -> None:
|
|
3410
3068
|
node.gen.py_ast = [
|
|
3411
3069
|
self.sync(
|
|
3412
3070
|
ast3.MatchSequence(
|
|
3413
|
-
patterns=[x.gen.py_ast[0] for x in node.values],
|
|
3071
|
+
patterns=[cast(ast3.pattern, x.gen.py_ast[0]) for x in node.values],
|
|
3414
3072
|
)
|
|
3415
3073
|
)
|
|
3416
3074
|
]
|
|
3417
3075
|
|
|
3418
|
-
def exit_match_mapping(self, node:
|
|
3419
|
-
"""Sub objects.
|
|
3420
|
-
|
|
3421
|
-
values: list[MatchKVPair | MatchStar],
|
|
3422
|
-
"""
|
|
3076
|
+
def exit_match_mapping(self, node: uni.MatchMapping) -> None:
|
|
3423
3077
|
mapping = self.sync(ast3.MatchMapping(keys=[], patterns=[], rest=None))
|
|
3424
3078
|
for i in node.values:
|
|
3425
3079
|
if (
|
|
3426
|
-
isinstance(i,
|
|
3427
|
-
and isinstance(i.key,
|
|
3080
|
+
isinstance(i, uni.MatchKVPair)
|
|
3081
|
+
and isinstance(i.key, uni.MatchValue)
|
|
3428
3082
|
and isinstance(i.key.value.gen.py_ast[0], ast3.expr)
|
|
3429
3083
|
and isinstance(i.value.gen.py_ast[0], ast3.pattern)
|
|
3430
3084
|
):
|
|
3431
3085
|
mapping.keys.append(i.key.value.gen.py_ast[0])
|
|
3432
3086
|
mapping.patterns.append(i.value.gen.py_ast[0])
|
|
3433
|
-
elif isinstance(i,
|
|
3087
|
+
elif isinstance(i, uni.MatchStar):
|
|
3434
3088
|
mapping.rest = i.name.sym_name
|
|
3435
3089
|
node.gen.py_ast = [mapping]
|
|
3436
3090
|
|
|
3437
|
-
def exit_match_k_v_pair(self, node:
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
key: MatchPattern | NameType,
|
|
3441
|
-
value: MatchPattern,
|
|
3442
|
-
"""
|
|
3443
|
-
node.gen.py_ast = [
|
|
3444
|
-
self.sync(
|
|
3445
|
-
ast3.MatchMapping(
|
|
3446
|
-
patterns=[node.key.gen.py_ast[0], node.value.gen.py_ast[0]],
|
|
3447
|
-
)
|
|
3448
|
-
)
|
|
3449
|
-
]
|
|
3450
|
-
|
|
3451
|
-
def exit_match_star(self, node: ast.MatchStar) -> None:
|
|
3452
|
-
"""Sub objects.
|
|
3091
|
+
def exit_match_k_v_pair(self, node: uni.MatchKVPair) -> None:
|
|
3092
|
+
pass
|
|
3453
3093
|
|
|
3454
|
-
|
|
3455
|
-
is_list: bool,
|
|
3456
|
-
"""
|
|
3094
|
+
def exit_match_star(self, node: uni.MatchStar) -> None:
|
|
3457
3095
|
node.gen.py_ast = [self.sync(ast3.MatchStar(name=node.name.sym_name))]
|
|
3458
3096
|
|
|
3459
|
-
def exit_match_arch(self, node:
|
|
3460
|
-
"""Sub objects.
|
|
3461
|
-
|
|
3462
|
-
name: NameType,
|
|
3463
|
-
arg_patterns: Optional[SubNodeList[MatchPattern]],
|
|
3464
|
-
kw_patterns: Optional[SubNodeList[MatchKVPair]],
|
|
3465
|
-
"""
|
|
3097
|
+
def exit_match_arch(self, node: uni.MatchArch) -> None:
|
|
3466
3098
|
node.gen.py_ast = [
|
|
3467
3099
|
self.sync(
|
|
3468
3100
|
ast3.MatchClass(
|
|
3469
|
-
cls=node.name.gen.py_ast[0],
|
|
3101
|
+
cls=cast(ast3.expr, node.name.gen.py_ast[0]),
|
|
3470
3102
|
patterns=(
|
|
3471
|
-
[
|
|
3103
|
+
[
|
|
3104
|
+
cast(ast3.pattern, x.gen.py_ast[0])
|
|
3105
|
+
for x in node.arg_patterns.items
|
|
3106
|
+
]
|
|
3472
3107
|
if node.arg_patterns
|
|
3473
3108
|
else []
|
|
3474
3109
|
),
|
|
@@ -3476,13 +3111,16 @@ class PyastGenPass(Pass):
|
|
|
3476
3111
|
[
|
|
3477
3112
|
x.key.sym_name
|
|
3478
3113
|
for x in node.kw_patterns.items
|
|
3479
|
-
if isinstance(x.key,
|
|
3114
|
+
if isinstance(x.key, uni.NameAtom)
|
|
3480
3115
|
]
|
|
3481
3116
|
if node.kw_patterns
|
|
3482
3117
|
else []
|
|
3483
3118
|
),
|
|
3484
3119
|
kwd_patterns=(
|
|
3485
|
-
[
|
|
3120
|
+
[
|
|
3121
|
+
cast(ast3.pattern, x.value.gen.py_ast[0])
|
|
3122
|
+
for x in node.kw_patterns.items
|
|
3123
|
+
]
|
|
3486
3124
|
if node.kw_patterns
|
|
3487
3125
|
else []
|
|
3488
3126
|
),
|
|
@@ -3490,17 +3128,7 @@ class PyastGenPass(Pass):
|
|
|
3490
3128
|
)
|
|
3491
3129
|
]
|
|
3492
3130
|
|
|
3493
|
-
def exit_token(self, node:
|
|
3494
|
-
"""Sub objects.
|
|
3495
|
-
|
|
3496
|
-
file_path: str,
|
|
3497
|
-
name: str,
|
|
3498
|
-
value: str,
|
|
3499
|
-
col_start: int,
|
|
3500
|
-
col_end: int,
|
|
3501
|
-
pos_start: int,
|
|
3502
|
-
pos_end: int,
|
|
3503
|
-
"""
|
|
3131
|
+
def exit_token(self, node: uni.Token) -> None:
|
|
3504
3132
|
if node.name == Tok.KW_AND:
|
|
3505
3133
|
node.gen.py_ast = [self.sync(ast3.And())]
|
|
3506
3134
|
elif node.name == Tok.KW_OR:
|
|
@@ -3558,46 +3186,15 @@ class PyastGenPass(Pass):
|
|
|
3558
3186
|
elif node.name == Tok.KW_NIN:
|
|
3559
3187
|
node.gen.py_ast = [self.sync(ast3.NotIn())]
|
|
3560
3188
|
|
|
3561
|
-
def exit_name(self, node:
|
|
3562
|
-
"""Sub objects.
|
|
3563
|
-
|
|
3564
|
-
file_path: str,
|
|
3565
|
-
name: str,
|
|
3566
|
-
value: str,
|
|
3567
|
-
col_start: int,
|
|
3568
|
-
col_end: int,
|
|
3569
|
-
pos_start: int,
|
|
3570
|
-
pos_end: int,
|
|
3571
|
-
"""
|
|
3189
|
+
def exit_name(self, node: uni.Name) -> None:
|
|
3572
3190
|
node.gen.py_ast = [
|
|
3573
3191
|
self.sync(ast3.Name(id=node.sym_name, ctx=node.py_ctx_func()))
|
|
3574
3192
|
]
|
|
3575
3193
|
|
|
3576
|
-
def exit_float(self, node:
|
|
3577
|
-
"""Sub objects.
|
|
3578
|
-
|
|
3579
|
-
file_path: str,
|
|
3580
|
-
name: str,
|
|
3581
|
-
value: str,
|
|
3582
|
-
col_start: int,
|
|
3583
|
-
col_end: int,
|
|
3584
|
-
pos_start: int,
|
|
3585
|
-
pos_end: int,
|
|
3586
|
-
"""
|
|
3194
|
+
def exit_float(self, node: uni.Float) -> None:
|
|
3587
3195
|
node.gen.py_ast = [self.sync(ast3.Constant(value=float(node.value)))]
|
|
3588
3196
|
|
|
3589
|
-
def exit_int(self, node:
|
|
3590
|
-
"""Sub objects.
|
|
3591
|
-
|
|
3592
|
-
file_path: str,
|
|
3593
|
-
name: str,
|
|
3594
|
-
value: str,
|
|
3595
|
-
col_start: int,
|
|
3596
|
-
col_end: int,
|
|
3597
|
-
pos_start: int,
|
|
3598
|
-
pos_end: int,
|
|
3599
|
-
"""
|
|
3600
|
-
|
|
3197
|
+
def exit_int(self, node: uni.Int) -> None:
|
|
3601
3198
|
def handle_node_value(value: str) -> int:
|
|
3602
3199
|
if value.startswith(("0x", "0X")):
|
|
3603
3200
|
return int(value, 16)
|
|
@@ -3614,93 +3211,25 @@ class PyastGenPass(Pass):
|
|
|
3614
3211
|
)
|
|
3615
3212
|
]
|
|
3616
3213
|
|
|
3617
|
-
def exit_string(self, node:
|
|
3618
|
-
"""Sub objects.
|
|
3619
|
-
|
|
3620
|
-
file_path: str,
|
|
3621
|
-
name: str,
|
|
3622
|
-
value: str,
|
|
3623
|
-
col_start: int,
|
|
3624
|
-
col_end: int,
|
|
3625
|
-
pos_start: int,
|
|
3626
|
-
pos_end: int,
|
|
3627
|
-
"""
|
|
3214
|
+
def exit_string(self, node: uni.String) -> None:
|
|
3628
3215
|
node.gen.py_ast = [self.sync(ast3.Constant(value=node.lit_value))]
|
|
3629
3216
|
|
|
3630
|
-
def exit_bool(self, node:
|
|
3631
|
-
"""Sub objects.
|
|
3632
|
-
|
|
3633
|
-
file_path: str,
|
|
3634
|
-
name: str,
|
|
3635
|
-
value: str,
|
|
3636
|
-
col_start: int,
|
|
3637
|
-
col_end: int,
|
|
3638
|
-
pos_start: int,
|
|
3639
|
-
pos_end: int,
|
|
3640
|
-
"""
|
|
3217
|
+
def exit_bool(self, node: uni.Bool) -> None:
|
|
3641
3218
|
node.gen.py_ast = [self.sync(ast3.Constant(value=node.value == "True"))]
|
|
3642
3219
|
|
|
3643
|
-
def exit_builtin_type(self, node:
|
|
3644
|
-
"""Sub objects.
|
|
3645
|
-
|
|
3646
|
-
file_path: str,
|
|
3647
|
-
name: str,
|
|
3648
|
-
value: str,
|
|
3649
|
-
col_start: int,
|
|
3650
|
-
col_end: int,
|
|
3651
|
-
pos_start: int,
|
|
3652
|
-
pos_end: int,
|
|
3653
|
-
"""
|
|
3220
|
+
def exit_builtin_type(self, node: uni.BuiltinType) -> None:
|
|
3654
3221
|
node.gen.py_ast = [
|
|
3655
3222
|
self.sync(ast3.Name(id=node.sym_name, ctx=node.py_ctx_func()))
|
|
3656
3223
|
]
|
|
3657
3224
|
|
|
3658
|
-
def exit_null(self, node:
|
|
3659
|
-
"""Sub objects.
|
|
3660
|
-
|
|
3661
|
-
file_path: str,
|
|
3662
|
-
name: str,
|
|
3663
|
-
value: str,
|
|
3664
|
-
col_start: int,
|
|
3665
|
-
col_end: int,
|
|
3666
|
-
pos_start: int,
|
|
3667
|
-
pos_end: int,
|
|
3668
|
-
"""
|
|
3225
|
+
def exit_null(self, node: uni.Null) -> None:
|
|
3669
3226
|
node.gen.py_ast = [self.sync(ast3.Constant(value=None))]
|
|
3670
3227
|
|
|
3671
|
-
def exit_ellipsis(self, node:
|
|
3672
|
-
"""Sub objects.
|
|
3673
|
-
|
|
3674
|
-
file_path: str,
|
|
3675
|
-
name: str,
|
|
3676
|
-
value: str,
|
|
3677
|
-
col_start: int,
|
|
3678
|
-
col_end: int,
|
|
3679
|
-
pos_start: int,
|
|
3680
|
-
pos_end: int,
|
|
3681
|
-
"""
|
|
3228
|
+
def exit_ellipsis(self, node: uni.Ellipsis) -> None:
|
|
3682
3229
|
node.gen.py_ast = [self.sync(ast3.Constant(value=...))]
|
|
3683
3230
|
|
|
3684
|
-
def exit_semi(self, node:
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
file_path: str,
|
|
3688
|
-
name: str,
|
|
3689
|
-
value: str,
|
|
3690
|
-
col_start: int,
|
|
3691
|
-
col_end: int,
|
|
3692
|
-
pos_start: int,
|
|
3693
|
-
pos_end: int,
|
|
3694
|
-
"""
|
|
3695
|
-
|
|
3696
|
-
def exit_comment_token(self, node: ast.CommentToken) -> None:
|
|
3697
|
-
"""Sub objects.
|
|
3231
|
+
def exit_semi(self, node: uni.Semi) -> None:
|
|
3232
|
+
pass
|
|
3698
3233
|
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
value: str,
|
|
3702
|
-
col_start: int,
|
|
3703
|
-
col_end: int,
|
|
3704
|
-
pos_start: int,
|
|
3705
|
-
pos_end: int,
|
|
3706
|
-
"""
|
|
3234
|
+
def exit_comment_token(self, node: uni.CommentToken) -> None:
|
|
3235
|
+
pass
|