jaclang 0.7.34__py3-none-any.whl → 0.8.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jaclang might be problematic. Click here for more details.

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