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,2389 +0,0 @@
1
- """A "low-level" IR builder class.
2
-
3
- LowLevelIRBuilder provides core abstractions we use for constructing
4
- IR as well as a number of higher-level ones (accessing attributes,
5
- calling functions and methods, and coercing between types, for
6
- example). The core principle of the low-level IR builder is that all
7
- of its facilities operate solely on the IR level and not the AST
8
- level---it has *no knowledge* of mypy types or expressions.
9
- """
10
-
11
- from __future__ import annotations
12
-
13
- from typing import Callable, Final, Optional, Sequence, Tuple
14
-
15
- from mypy.argmap import map_actuals_to_formals
16
- from mypy.nodes import ARG_POS, ARG_STAR, ARG_STAR2, ArgKind
17
- from mypy.operators import op_methods
18
- from mypy.types import AnyType, TypeOfAny
19
- from mypyc.common import (
20
- BITMAP_BITS,
21
- FAST_ISINSTANCE_MAX_SUBCLASSES,
22
- MAX_LITERAL_SHORT_INT,
23
- MAX_SHORT_INT,
24
- MIN_LITERAL_SHORT_INT,
25
- MIN_SHORT_INT,
26
- PLATFORM_SIZE,
27
- use_method_vectorcall,
28
- use_vectorcall,
29
- )
30
- from mypyc.errors import Errors
31
- from mypyc.ir.class_ir import ClassIR, all_concrete_classes
32
- from mypyc.ir.func_ir import FuncDecl, FuncSignature
33
- from mypyc.ir.ops import (
34
- ERR_FALSE,
35
- ERR_NEVER,
36
- NAMESPACE_MODULE,
37
- NAMESPACE_STATIC,
38
- NAMESPACE_TYPE,
39
- Assign,
40
- AssignMulti,
41
- BasicBlock,
42
- Box,
43
- Branch,
44
- Call,
45
- CallC,
46
- Cast,
47
- ComparisonOp,
48
- Extend,
49
- Float,
50
- FloatComparisonOp,
51
- FloatNeg,
52
- FloatOp,
53
- GetAttr,
54
- GetElementPtr,
55
- Goto,
56
- Integer,
57
- IntOp,
58
- KeepAlive,
59
- LoadAddress,
60
- LoadErrorValue,
61
- LoadLiteral,
62
- LoadMem,
63
- LoadStatic,
64
- MethodCall,
65
- Op,
66
- PrimitiveDescription,
67
- PrimitiveOp,
68
- RaiseStandardError,
69
- Register,
70
- Truncate,
71
- TupleGet,
72
- TupleSet,
73
- Unbox,
74
- Unreachable,
75
- Value,
76
- float_comparison_op_to_id,
77
- float_op_to_id,
78
- int_op_to_id,
79
- )
80
- from mypyc.ir.rtypes import (
81
- PyObject,
82
- PySetObject,
83
- RArray,
84
- RInstance,
85
- RPrimitive,
86
- RTuple,
87
- RType,
88
- RUnion,
89
- bit_rprimitive,
90
- bitmap_rprimitive,
91
- bool_rprimitive,
92
- bytes_rprimitive,
93
- c_int_rprimitive,
94
- c_pointer_rprimitive,
95
- c_pyssize_t_rprimitive,
96
- c_size_t_rprimitive,
97
- check_native_int_range,
98
- dict_rprimitive,
99
- float_rprimitive,
100
- int_rprimitive,
101
- is_bit_rprimitive,
102
- is_bool_rprimitive,
103
- is_bytes_rprimitive,
104
- is_dict_rprimitive,
105
- is_fixed_width_rtype,
106
- is_float_rprimitive,
107
- is_int16_rprimitive,
108
- is_int32_rprimitive,
109
- is_int64_rprimitive,
110
- is_int_rprimitive,
111
- is_list_rprimitive,
112
- is_none_rprimitive,
113
- is_set_rprimitive,
114
- is_short_int_rprimitive,
115
- is_str_rprimitive,
116
- is_tagged,
117
- is_tuple_rprimitive,
118
- is_uint8_rprimitive,
119
- list_rprimitive,
120
- none_rprimitive,
121
- object_pointer_rprimitive,
122
- object_rprimitive,
123
- optional_value_type,
124
- pointer_rprimitive,
125
- short_int_rprimitive,
126
- str_rprimitive,
127
- )
128
- from mypyc.irbuild.util import concrete_arg_kind
129
- from mypyc.options import CompilerOptions
130
- from mypyc.primitives.bytes_ops import bytes_compare
131
- from mypyc.primitives.dict_ops import (
132
- dict_build_op,
133
- dict_new_op,
134
- dict_ssize_t_size_op,
135
- dict_update_in_display_op,
136
- )
137
- from mypyc.primitives.exc_ops import err_occurred_op, keep_propagating_op
138
- from mypyc.primitives.float_ops import copysign_op, int_to_float_op
139
- from mypyc.primitives.generic_ops import (
140
- generic_len_op,
141
- generic_ssize_t_len_op,
142
- py_call_op,
143
- py_call_with_kwargs_op,
144
- py_getattr_op,
145
- py_method_call_op,
146
- py_vectorcall_method_op,
147
- py_vectorcall_op,
148
- )
149
- from mypyc.primitives.int_ops import (
150
- int16_divide_op,
151
- int16_mod_op,
152
- int16_overflow,
153
- int32_divide_op,
154
- int32_mod_op,
155
- int32_overflow,
156
- int64_divide_op,
157
- int64_mod_op,
158
- int64_to_int_op,
159
- int_to_int32_op,
160
- int_to_int64_op,
161
- ssize_t_to_int_op,
162
- uint8_overflow,
163
- )
164
- from mypyc.primitives.list_ops import list_build_op, list_extend_op, list_items, new_list_op
165
- from mypyc.primitives.misc_ops import (
166
- bool_op,
167
- buf_init_item,
168
- fast_isinstance_op,
169
- none_object_op,
170
- var_object_size,
171
- )
172
- from mypyc.primitives.registry import (
173
- ERR_NEG_INT,
174
- CFunctionDescription,
175
- binary_ops,
176
- method_call_ops,
177
- unary_ops,
178
- )
179
- from mypyc.primitives.set_ops import new_set_op
180
- from mypyc.primitives.str_ops import str_check_if_true, str_ssize_t_size_op, unicode_compare
181
- from mypyc.primitives.tuple_ops import list_tuple_op, new_tuple_op, new_tuple_with_length_op
182
- from mypyc.rt_subtype import is_runtime_subtype
183
- from mypyc.sametype import is_same_type
184
- from mypyc.subtype import is_subtype
185
-
186
- DictEntry = Tuple[Optional[Value], Value]
187
-
188
- # If the number of items is less than the threshold when initializing
189
- # a list, we would inline the generate IR using SetMem and expanded
190
- # for-loop. Otherwise, we would call `list_build_op` for larger lists.
191
- # TODO: The threshold is a randomly chosen number which needs further
192
- # study on real-world projects for a better balance.
193
- LIST_BUILDING_EXPANSION_THRESHOLD = 10
194
-
195
- # From CPython
196
- PY_VECTORCALL_ARGUMENTS_OFFSET: Final = 1 << (PLATFORM_SIZE * 8 - 1)
197
-
198
- FIXED_WIDTH_INT_BINARY_OPS: Final = {
199
- "+",
200
- "-",
201
- "*",
202
- "//",
203
- "%",
204
- "&",
205
- "|",
206
- "^",
207
- "<<",
208
- ">>",
209
- "+=",
210
- "-=",
211
- "*=",
212
- "//=",
213
- "%=",
214
- "&=",
215
- "|=",
216
- "^=",
217
- "<<=",
218
- ">>=",
219
- }
220
-
221
- # Binary operations on bools that are specialized and don't just promote operands to int
222
- BOOL_BINARY_OPS: Final = {"&", "&=", "|", "|=", "^", "^=", "==", "!=", "<", "<=", ">", ">="}
223
-
224
-
225
- class LowLevelIRBuilder:
226
- def __init__(self, errors: Errors | None, options: CompilerOptions) -> None:
227
- self.errors = errors
228
- self.options = options
229
- self.args: list[Register] = []
230
- self.blocks: list[BasicBlock] = []
231
- # Stack of except handler entry blocks
232
- self.error_handlers: list[BasicBlock | None] = [None]
233
- # Values that we need to keep alive as long as we have borrowed
234
- # temporaries. Use flush_keep_alives() to mark the end of the live range.
235
- self.keep_alives: list[Value] = []
236
-
237
- def set_module(self, module_name: str, module_path: str) -> None:
238
- """Set the name and path of the current module."""
239
- self.module_name = module_name
240
- self.module_path = module_path
241
-
242
- # Basic operations
243
-
244
- def add(self, op: Op) -> Value:
245
- """Add an op."""
246
- assert not self.blocks[-1].terminated, "Can't add to finished block"
247
- self.blocks[-1].ops.append(op)
248
- return op
249
-
250
- def goto(self, target: BasicBlock) -> None:
251
- """Add goto to a basic block."""
252
- if not self.blocks[-1].terminated:
253
- self.add(Goto(target))
254
-
255
- def activate_block(self, block: BasicBlock) -> None:
256
- """Add a basic block and make it the active one (target of adds)."""
257
- if self.blocks:
258
- assert self.blocks[-1].terminated
259
-
260
- block.error_handler = self.error_handlers[-1]
261
- self.blocks.append(block)
262
-
263
- def goto_and_activate(self, block: BasicBlock) -> None:
264
- """Add goto a block and make it the active block."""
265
- self.goto(block)
266
- self.activate_block(block)
267
-
268
- def keep_alive(self, values: list[Value], *, steal: bool = False) -> None:
269
- self.add(KeepAlive(values, steal=steal))
270
-
271
- def push_error_handler(self, handler: BasicBlock | None) -> None:
272
- self.error_handlers.append(handler)
273
-
274
- def pop_error_handler(self) -> BasicBlock | None:
275
- return self.error_handlers.pop()
276
-
277
- def self(self) -> Register:
278
- """Return reference to the 'self' argument.
279
-
280
- This only works in a method.
281
- """
282
- return self.args[0]
283
-
284
- def flush_keep_alives(self) -> None:
285
- if self.keep_alives:
286
- self.add(KeepAlive(self.keep_alives.copy()))
287
- self.keep_alives = []
288
-
289
- # Type conversions
290
-
291
- def box(self, src: Value) -> Value:
292
- if src.type.is_unboxed:
293
- if isinstance(src, Integer) and is_tagged(src.type):
294
- return self.add(LoadLiteral(src.value >> 1, rtype=object_rprimitive))
295
- return self.add(Box(src))
296
- else:
297
- return src
298
-
299
- def unbox_or_cast(
300
- self, src: Value, target_type: RType, line: int, *, can_borrow: bool = False
301
- ) -> Value:
302
- if target_type.is_unboxed:
303
- return self.add(Unbox(src, target_type, line))
304
- else:
305
- if can_borrow:
306
- self.keep_alives.append(src)
307
- return self.add(Cast(src, target_type, line, borrow=can_borrow))
308
-
309
- def coerce(
310
- self,
311
- src: Value,
312
- target_type: RType,
313
- line: int,
314
- force: bool = False,
315
- *,
316
- can_borrow: bool = False,
317
- ) -> Value:
318
- """Generate a coercion/cast from one type to other (only if needed).
319
-
320
- For example, int -> object boxes the source int; int -> int emits nothing;
321
- object -> int unboxes the object. All conversions preserve object value.
322
-
323
- If force is true, always generate an op (even if it is just an assignment) so
324
- that the result will have exactly target_type as the type.
325
-
326
- Returns the register with the converted value (may be same as src).
327
- """
328
- src_type = src.type
329
- if src_type.is_unboxed and not target_type.is_unboxed:
330
- # Unboxed -> boxed
331
- return self.box(src)
332
- if (src_type.is_unboxed and target_type.is_unboxed) and not is_runtime_subtype(
333
- src_type, target_type
334
- ):
335
- if (
336
- isinstance(src, Integer)
337
- and is_short_int_rprimitive(src_type)
338
- and is_fixed_width_rtype(target_type)
339
- ):
340
- value = src.numeric_value()
341
- if not check_native_int_range(target_type, value):
342
- self.error(f'Value {value} is out of range for "{target_type}"', line)
343
- return Integer(src.value >> 1, target_type)
344
- elif is_int_rprimitive(src_type) and is_fixed_width_rtype(target_type):
345
- return self.coerce_int_to_fixed_width(src, target_type, line)
346
- elif is_fixed_width_rtype(src_type) and is_int_rprimitive(target_type):
347
- return self.coerce_fixed_width_to_int(src, line)
348
- elif is_short_int_rprimitive(src_type) and is_fixed_width_rtype(target_type):
349
- return self.coerce_short_int_to_fixed_width(src, target_type, line)
350
- elif (
351
- isinstance(src_type, RPrimitive)
352
- and isinstance(target_type, RPrimitive)
353
- and src_type.is_native_int
354
- and target_type.is_native_int
355
- and src_type.size == target_type.size
356
- and src_type.is_signed == target_type.is_signed
357
- ):
358
- # Equivalent types
359
- return src
360
- elif (is_bool_rprimitive(src_type) or is_bit_rprimitive(src_type)) and is_tagged(
361
- target_type
362
- ):
363
- shifted = self.int_op(
364
- bool_rprimitive, src, Integer(1, bool_rprimitive), IntOp.LEFT_SHIFT
365
- )
366
- return self.add(Extend(shifted, target_type, signed=False))
367
- elif (
368
- is_bool_rprimitive(src_type) or is_bit_rprimitive(src_type)
369
- ) and is_fixed_width_rtype(target_type):
370
- return self.add(Extend(src, target_type, signed=False))
371
- elif isinstance(src, Integer) and is_float_rprimitive(target_type):
372
- if is_tagged(src_type):
373
- return Float(float(src.value // 2))
374
- return Float(float(src.value))
375
- elif is_tagged(src_type) and is_float_rprimitive(target_type):
376
- return self.int_to_float(src, line)
377
- elif (
378
- isinstance(src_type, RTuple)
379
- and isinstance(target_type, RTuple)
380
- and len(src_type.types) == len(target_type.types)
381
- ):
382
- # Coerce between two tuple types by coercing each item separately
383
- values = []
384
- for i in range(len(src_type.types)):
385
- v = None
386
- if isinstance(src, TupleSet):
387
- item = src.items[i]
388
- # We can't reuse register values, since they can be modified.
389
- if not isinstance(item, Register):
390
- v = item
391
- if v is None:
392
- v = TupleGet(src, i)
393
- self.add(v)
394
- values.append(v)
395
- return self.add(
396
- TupleSet(
397
- [self.coerce(v, t, line) for v, t in zip(values, target_type.types)], line
398
- )
399
- )
400
- # To go between any other unboxed types, we go through a boxed
401
- # in-between value, for simplicity.
402
- tmp = self.box(src)
403
- return self.unbox_or_cast(tmp, target_type, line)
404
- if (not src_type.is_unboxed and target_type.is_unboxed) or not is_subtype(
405
- src_type, target_type
406
- ):
407
- return self.unbox_or_cast(src, target_type, line, can_borrow=can_borrow)
408
- elif force:
409
- tmp = Register(target_type)
410
- self.add(Assign(tmp, src))
411
- return tmp
412
- return src
413
-
414
- def coerce_int_to_fixed_width(self, src: Value, target_type: RType, line: int) -> Value:
415
- assert is_fixed_width_rtype(target_type), target_type
416
- assert isinstance(target_type, RPrimitive)
417
-
418
- res = Register(target_type)
419
-
420
- fast, slow, end = BasicBlock(), BasicBlock(), BasicBlock()
421
-
422
- check = self.check_tagged_short_int(src, line)
423
- self.add(Branch(check, fast, slow, Branch.BOOL))
424
-
425
- self.activate_block(fast)
426
-
427
- size = target_type.size
428
- if size < int_rprimitive.size:
429
- # Add a range check when the target type is smaller than the source tyoe
430
- fast2, fast3 = BasicBlock(), BasicBlock()
431
- upper_bound = 1 << (size * 8 - 1)
432
- if not target_type.is_signed:
433
- upper_bound *= 2
434
- check2 = self.add(ComparisonOp(src, Integer(upper_bound, src.type), ComparisonOp.SLT))
435
- self.add(Branch(check2, fast2, slow, Branch.BOOL))
436
- self.activate_block(fast2)
437
- if target_type.is_signed:
438
- lower_bound = -upper_bound
439
- else:
440
- lower_bound = 0
441
- check3 = self.add(ComparisonOp(src, Integer(lower_bound, src.type), ComparisonOp.SGE))
442
- self.add(Branch(check3, fast3, slow, Branch.BOOL))
443
- self.activate_block(fast3)
444
- tmp = self.int_op(
445
- c_pyssize_t_rprimitive,
446
- src,
447
- Integer(1, c_pyssize_t_rprimitive),
448
- IntOp.RIGHT_SHIFT,
449
- line,
450
- )
451
- tmp = self.add(Truncate(tmp, target_type))
452
- else:
453
- if size > int_rprimitive.size:
454
- tmp = self.add(Extend(src, target_type, signed=True))
455
- else:
456
- tmp = src
457
- tmp = self.int_op(target_type, tmp, Integer(1, target_type), IntOp.RIGHT_SHIFT, line)
458
-
459
- self.add(Assign(res, tmp))
460
- self.goto(end)
461
-
462
- self.activate_block(slow)
463
- if is_int64_rprimitive(target_type) or (
464
- is_int32_rprimitive(target_type) and size == int_rprimitive.size
465
- ):
466
- # Slow path calls a library function that handles more complex logic
467
- ptr = self.int_op(
468
- pointer_rprimitive, src, Integer(1, pointer_rprimitive), IntOp.XOR, line
469
- )
470
- ptr2 = Register(c_pointer_rprimitive)
471
- self.add(Assign(ptr2, ptr))
472
- if is_int64_rprimitive(target_type):
473
- conv_op = int_to_int64_op
474
- else:
475
- conv_op = int_to_int32_op
476
- tmp = self.call_c(conv_op, [ptr2], line)
477
- self.add(Assign(res, tmp))
478
- self.add(KeepAlive([src]))
479
- self.goto(end)
480
- elif is_int32_rprimitive(target_type):
481
- # Slow path just always generates an OverflowError
482
- self.call_c(int32_overflow, [], line)
483
- self.add(Unreachable())
484
- elif is_int16_rprimitive(target_type):
485
- # Slow path just always generates an OverflowError
486
- self.call_c(int16_overflow, [], line)
487
- self.add(Unreachable())
488
- elif is_uint8_rprimitive(target_type):
489
- # Slow path just always generates an OverflowError
490
- self.call_c(uint8_overflow, [], line)
491
- self.add(Unreachable())
492
- else:
493
- assert False, target_type
494
-
495
- self.activate_block(end)
496
- return res
497
-
498
- def coerce_short_int_to_fixed_width(self, src: Value, target_type: RType, line: int) -> Value:
499
- if is_int64_rprimitive(target_type):
500
- return self.int_op(target_type, src, Integer(1, target_type), IntOp.RIGHT_SHIFT, line)
501
- # TODO: i32
502
- assert False, (src.type, target_type)
503
-
504
- def coerce_fixed_width_to_int(self, src: Value, line: int) -> Value:
505
- if (
506
- (is_int32_rprimitive(src.type) and PLATFORM_SIZE == 8)
507
- or is_int16_rprimitive(src.type)
508
- or is_uint8_rprimitive(src.type)
509
- ):
510
- # Simple case -- just sign extend and shift.
511
- extended = self.add(Extend(src, c_pyssize_t_rprimitive, signed=src.type.is_signed))
512
- return self.int_op(
513
- int_rprimitive,
514
- extended,
515
- Integer(1, c_pyssize_t_rprimitive),
516
- IntOp.LEFT_SHIFT,
517
- line,
518
- )
519
-
520
- assert is_fixed_width_rtype(src.type)
521
- assert isinstance(src.type, RPrimitive)
522
- src_type = src.type
523
-
524
- res = Register(int_rprimitive)
525
-
526
- fast, fast2, slow, end = BasicBlock(), BasicBlock(), BasicBlock(), BasicBlock()
527
-
528
- c1 = self.add(ComparisonOp(src, Integer(MAX_SHORT_INT, src_type), ComparisonOp.SLE))
529
- self.add(Branch(c1, fast, slow, Branch.BOOL))
530
-
531
- self.activate_block(fast)
532
- c2 = self.add(ComparisonOp(src, Integer(MIN_SHORT_INT, src_type), ComparisonOp.SGE))
533
- self.add(Branch(c2, fast2, slow, Branch.BOOL))
534
-
535
- self.activate_block(slow)
536
- if is_int64_rprimitive(src_type):
537
- conv_op = int64_to_int_op
538
- elif is_int32_rprimitive(src_type):
539
- assert PLATFORM_SIZE == 4
540
- conv_op = ssize_t_to_int_op
541
- else:
542
- assert False, src_type
543
- x = self.call_c(conv_op, [src], line)
544
- self.add(Assign(res, x))
545
- self.goto(end)
546
-
547
- self.activate_block(fast2)
548
- if int_rprimitive.size < src_type.size:
549
- tmp = self.add(Truncate(src, c_pyssize_t_rprimitive))
550
- else:
551
- tmp = src
552
- s = self.int_op(int_rprimitive, tmp, Integer(1, tmp.type), IntOp.LEFT_SHIFT, line)
553
- self.add(Assign(res, s))
554
- self.goto(end)
555
-
556
- self.activate_block(end)
557
- return res
558
-
559
- def coerce_nullable(self, src: Value, target_type: RType, line: int) -> Value:
560
- """Generate a coercion from a potentially null value."""
561
- if src.type.is_unboxed == target_type.is_unboxed and (
562
- (target_type.is_unboxed and is_runtime_subtype(src.type, target_type))
563
- or (not target_type.is_unboxed and is_subtype(src.type, target_type))
564
- ):
565
- return src
566
-
567
- target = Register(target_type)
568
-
569
- valid, invalid, out = BasicBlock(), BasicBlock(), BasicBlock()
570
- self.add(Branch(src, invalid, valid, Branch.IS_ERROR))
571
-
572
- self.activate_block(valid)
573
- coerced = self.coerce(src, target_type, line)
574
- self.add(Assign(target, coerced, line))
575
- self.goto(out)
576
-
577
- self.activate_block(invalid)
578
- error = self.add(LoadErrorValue(target_type))
579
- self.add(Assign(target, error, line))
580
-
581
- self.goto_and_activate(out)
582
- return target
583
-
584
- # Attribute access
585
-
586
- def get_attr(
587
- self, obj: Value, attr: str, result_type: RType, line: int, *, borrow: bool = False
588
- ) -> Value:
589
- """Get a native or Python attribute of an object."""
590
- if (
591
- isinstance(obj.type, RInstance)
592
- and obj.type.class_ir.is_ext_class
593
- and obj.type.class_ir.has_attr(attr)
594
- ):
595
- op = GetAttr(obj, attr, line, borrow=borrow)
596
- # For non-refcounted attribute types, the borrow might be
597
- # disabled even if requested, so don't check 'borrow'.
598
- if op.is_borrowed:
599
- self.keep_alives.append(obj)
600
- return self.add(op)
601
- elif isinstance(obj.type, RUnion):
602
- return self.union_get_attr(obj, obj.type, attr, result_type, line)
603
- else:
604
- return self.py_get_attr(obj, attr, line)
605
-
606
- def union_get_attr(
607
- self, obj: Value, rtype: RUnion, attr: str, result_type: RType, line: int
608
- ) -> Value:
609
- """Get an attribute of an object with a union type."""
610
-
611
- def get_item_attr(value: Value) -> Value:
612
- return self.get_attr(value, attr, result_type, line)
613
-
614
- return self.decompose_union_helper(obj, rtype, result_type, get_item_attr, line)
615
-
616
- def py_get_attr(self, obj: Value, attr: str, line: int) -> Value:
617
- """Get a Python attribute (slow).
618
-
619
- Prefer get_attr() which generates optimized code for native classes.
620
- """
621
- key = self.load_str(attr)
622
- return self.call_c(py_getattr_op, [obj, key], line)
623
-
624
- # isinstance() checks
625
-
626
- def isinstance_helper(self, obj: Value, class_irs: list[ClassIR], line: int) -> Value:
627
- """Fast path for isinstance() that checks against a list of native classes."""
628
- if not class_irs:
629
- return self.false()
630
- ret = self.isinstance_native(obj, class_irs[0], line)
631
- for class_ir in class_irs[1:]:
632
-
633
- def other() -> Value:
634
- return self.isinstance_native(obj, class_ir, line)
635
-
636
- ret = self.shortcircuit_helper("or", bool_rprimitive, lambda: ret, other, line)
637
- return ret
638
-
639
- def get_type_of_obj(self, obj: Value, line: int) -> Value:
640
- ob_type_address = self.add(GetElementPtr(obj, PyObject, "ob_type", line))
641
- ob_type = self.add(LoadMem(object_rprimitive, ob_type_address))
642
- self.add(KeepAlive([obj]))
643
- return ob_type
644
-
645
- def type_is_op(self, obj: Value, type_obj: Value, line: int) -> Value:
646
- typ = self.get_type_of_obj(obj, line)
647
- return self.add(ComparisonOp(typ, type_obj, ComparisonOp.EQ, line))
648
-
649
- def isinstance_native(self, obj: Value, class_ir: ClassIR, line: int) -> Value:
650
- """Fast isinstance() check for a native class.
651
-
652
- If there are three or fewer concrete (non-trait) classes among the class
653
- and all its children, use even faster type comparison checks `type(obj)
654
- is typ`.
655
- """
656
- concrete = all_concrete_classes(class_ir)
657
- if concrete is None or len(concrete) > FAST_ISINSTANCE_MAX_SUBCLASSES + 1:
658
- return self.call_c(fast_isinstance_op, [obj, self.get_native_type(class_ir)], line)
659
- if not concrete:
660
- # There can't be any concrete instance that matches this.
661
- return self.false()
662
- type_obj = self.get_native_type(concrete[0])
663
- ret = self.type_is_op(obj, type_obj, line)
664
- for c in concrete[1:]:
665
-
666
- def other() -> Value:
667
- return self.type_is_op(obj, self.get_native_type(c), line)
668
-
669
- ret = self.shortcircuit_helper("or", bool_rprimitive, lambda: ret, other, line)
670
- return ret
671
-
672
- # Calls
673
-
674
- def _construct_varargs(
675
- self,
676
- args: Sequence[tuple[Value, ArgKind, str | None]],
677
- line: int,
678
- *,
679
- has_star: bool,
680
- has_star2: bool,
681
- ) -> tuple[Value | None, Value | None]:
682
- """Construct *args and **kwargs from a collection of arguments
683
-
684
- This is pretty complicated, and almost all of the complication here stems from
685
- one of two things (but mostly the second):
686
- * The handling of ARG_STAR/ARG_STAR2. We want to create as much of the args/kwargs
687
- values in one go as we can, so we collect values until our hand is forced, and
688
- then we emit creation of the list/tuple, and expand it from there if needed.
689
-
690
- * Support potentially nullable argument values. This has very narrow applicability,
691
- as this will never be done by our compiled Python code, but is critically used
692
- by gen_glue_method when generating glue methods to mediate between the function
693
- signature of a parent class and its subclasses.
694
-
695
- For named-only arguments, this is quite simple: if it is
696
- null, don't put it in the dict.
697
-
698
- For positional-or-named arguments, things are much more complicated.
699
- * First, anything that was passed as a positional arg
700
- must be forwarded along as a positional arg. It *must
701
- not* be converted to a named arg. This is because mypy
702
- does not enforce that positional-or-named arguments
703
- have the same name in subclasses, and it is not
704
- uncommon for code to have different names in
705
- subclasses (a bunch of mypy's visitors do this, for
706
- example!). This is arguably a bug in both mypy and code doing
707
- this, and they ought to be using positional-only arguments, but
708
- positional-only arguments are new and ugly.
709
-
710
- * On the flip side, we're willing to accept the
711
- infelicity of sometimes turning an argument that was
712
- passed by keyword into a positional argument. It's wrong,
713
- but it's very marginal, and avoiding it would require passing
714
- a bitmask of which arguments were named with every function call,
715
- or something similar.
716
- (See some discussion of this in testComplicatedArgs)
717
-
718
- Thus, our strategy for positional-or-named arguments is to
719
- always pass them as positional, except in the one
720
- situation where we can not, and where we can be absolutely
721
- sure they were passed by name: when an *earlier*
722
- positional argument was missing its value.
723
-
724
- This means that if we have a method `f(self, x: int=..., y: object=...)`:
725
- * x and y present: args=(x, y), kwargs={}
726
- * x present, y missing: args=(x,), kwargs={}
727
- * x missing, y present: args=(), kwargs={'y': y}
728
-
729
- To implement this, when we have multiple optional
730
- positional arguments, we maintain a flag in a register
731
- that tracks whether an argument has been missing, and for
732
- each such optional argument (except the first), we check
733
- the flag to determine whether to append the argument to
734
- the *args list or add it to the **kwargs dict. What a
735
- mess!
736
-
737
- This is what really makes everything here such a tangle;
738
- otherwise the *args and **kwargs code could be separated.
739
-
740
- The arguments has_star and has_star2 indicate whether the target function
741
- takes an ARG_STAR and ARG_STAR2 argument, respectively.
742
- (These will always be true when making a pycall, and be based
743
- on the actual target signature for a native call.)
744
- """
745
-
746
- star_result: Value | None = None
747
- star2_result: Value | None = None
748
- # We aggregate values that need to go into *args and **kwargs
749
- # in these lists. Once all arguments are processed (in the
750
- # happiest case), or we encounter an ARG_STAR/ARG_STAR2 or a
751
- # nullable arg, then we create the list and/or dict.
752
- star_values: list[Value] = []
753
- star2_keys: list[Value] = []
754
- star2_values: list[Value] = []
755
-
756
- seen_empty_reg: Register | None = None
757
-
758
- for value, kind, name in args:
759
- if kind == ARG_STAR:
760
- if star_result is None:
761
- star_result = self.new_list_op(star_values, line)
762
- self.call_c(list_extend_op, [star_result, value], line)
763
- elif kind == ARG_STAR2:
764
- if star2_result is None:
765
- star2_result = self._create_dict(star2_keys, star2_values, line)
766
-
767
- self.call_c(dict_update_in_display_op, [star2_result, value], line=line)
768
- else:
769
- nullable = kind.is_optional()
770
- maybe_pos = kind.is_positional() and has_star
771
- maybe_named = kind.is_named() or (kind.is_optional() and name and has_star2)
772
-
773
- # If the argument is nullable, we need to create the
774
- # relevant args/kwargs objects so that we can
775
- # conditionally modify them.
776
- if nullable:
777
- if maybe_pos and star_result is None:
778
- star_result = self.new_list_op(star_values, line)
779
- if maybe_named and star2_result is None:
780
- star2_result = self._create_dict(star2_keys, star2_values, line)
781
-
782
- # Easy cases: just collect the argument.
783
- if maybe_pos and star_result is None:
784
- star_values.append(value)
785
- continue
786
-
787
- if maybe_named and star2_result is None:
788
- assert name is not None
789
- key = self.load_str(name)
790
- star2_keys.append(key)
791
- star2_values.append(value)
792
- continue
793
-
794
- # OK, anything that is nullable or *after* a nullable arg needs to be here
795
- # TODO: We could try harder to avoid creating basic blocks in the common case
796
- new_seen_empty_reg = seen_empty_reg
797
-
798
- out = BasicBlock()
799
- if nullable:
800
- # If this is the first nullable positional arg we've seen, create
801
- # a register to track whether anything has been null.
802
- # (We won't *check* the register until the next argument, though.)
803
- if maybe_pos and not seen_empty_reg:
804
- new_seen_empty_reg = Register(bool_rprimitive)
805
- self.add(Assign(new_seen_empty_reg, self.false(), line))
806
-
807
- skip = BasicBlock() if maybe_pos else out
808
- keep = BasicBlock()
809
- self.add(Branch(value, skip, keep, Branch.IS_ERROR))
810
- self.activate_block(keep)
811
-
812
- # If this could be positional or named and we /might/ have seen a missing
813
- # positional arg, then we need to compile *both* a positional and named
814
- # version! What a pain!
815
- if maybe_pos and maybe_named and seen_empty_reg:
816
- pos_block, named_block = BasicBlock(), BasicBlock()
817
- self.add(Branch(seen_empty_reg, named_block, pos_block, Branch.BOOL))
818
- else:
819
- pos_block = named_block = BasicBlock()
820
- self.goto(pos_block)
821
-
822
- if maybe_pos:
823
- self.activate_block(pos_block)
824
- assert star_result
825
- self.translate_special_method_call(
826
- star_result, "append", [value], result_type=None, line=line
827
- )
828
- self.goto(out)
829
-
830
- if maybe_named and (not maybe_pos or seen_empty_reg):
831
- self.activate_block(named_block)
832
- assert name is not None
833
- key = self.load_str(name)
834
- assert star2_result
835
- self.translate_special_method_call(
836
- star2_result, "__setitem__", [key, value], result_type=None, line=line
837
- )
838
- self.goto(out)
839
-
840
- if nullable and maybe_pos and new_seen_empty_reg:
841
- assert skip is not out
842
- self.activate_block(skip)
843
- self.add(Assign(new_seen_empty_reg, self.true(), line))
844
- self.goto(out)
845
-
846
- self.activate_block(out)
847
-
848
- seen_empty_reg = new_seen_empty_reg
849
-
850
- assert not (star_result or star_values) or has_star
851
- assert not (star2_result or star2_values) or has_star2
852
- if has_star:
853
- # If we managed to make it this far without creating a
854
- # *args list, then we can directly create a
855
- # tuple. Otherwise create the tuple from the list.
856
- if star_result is None:
857
- star_result = self.new_tuple(star_values, line)
858
- else:
859
- star_result = self.call_c(list_tuple_op, [star_result], line)
860
- if has_star2 and star2_result is None:
861
- star2_result = self._create_dict(star2_keys, star2_values, line)
862
-
863
- return star_result, star2_result
864
-
865
- def py_call(
866
- self,
867
- function: Value,
868
- arg_values: list[Value],
869
- line: int,
870
- arg_kinds: list[ArgKind] | None = None,
871
- arg_names: Sequence[str | None] | None = None,
872
- ) -> Value:
873
- """Call a Python function (non-native and slow).
874
-
875
- Use py_call_op or py_call_with_kwargs_op for Python function call.
876
- """
877
- if use_vectorcall(self.options.capi_version):
878
- # More recent Python versions support faster vectorcalls.
879
- result = self._py_vector_call(function, arg_values, line, arg_kinds, arg_names)
880
- if result is not None:
881
- return result
882
-
883
- # If all arguments are positional, we can use py_call_op.
884
- if arg_kinds is None or all(kind == ARG_POS for kind in arg_kinds):
885
- return self.call_c(py_call_op, [function] + arg_values, line)
886
-
887
- # Otherwise fallback to py_call_with_kwargs_op.
888
- assert arg_names is not None
889
-
890
- pos_args_tuple, kw_args_dict = self._construct_varargs(
891
- list(zip(arg_values, arg_kinds, arg_names)), line, has_star=True, has_star2=True
892
- )
893
- assert pos_args_tuple and kw_args_dict
894
-
895
- return self.call_c(py_call_with_kwargs_op, [function, pos_args_tuple, kw_args_dict], line)
896
-
897
- def _py_vector_call(
898
- self,
899
- function: Value,
900
- arg_values: list[Value],
901
- line: int,
902
- arg_kinds: list[ArgKind] | None = None,
903
- arg_names: Sequence[str | None] | None = None,
904
- ) -> Value | None:
905
- """Call function using the vectorcall API if possible.
906
-
907
- Return the return value if successful. Return None if a non-vectorcall
908
- API should be used instead.
909
- """
910
- # We can do this if all args are positional or named (no *args or **kwargs, not optional).
911
- if arg_kinds is None or all(
912
- not kind.is_star() and not kind.is_optional() for kind in arg_kinds
913
- ):
914
- if arg_values:
915
- # Create a C array containing all arguments as boxed values.
916
- coerced_args = [self.coerce(arg, object_rprimitive, line) for arg in arg_values]
917
- arg_ptr = self.setup_rarray(object_rprimitive, coerced_args, object_ptr=True)
918
- else:
919
- arg_ptr = Integer(0, object_pointer_rprimitive)
920
- num_pos = num_positional_args(arg_values, arg_kinds)
921
- keywords = self._vectorcall_keywords(arg_names)
922
- value = self.call_c(
923
- py_vectorcall_op,
924
- [function, arg_ptr, Integer(num_pos, c_size_t_rprimitive), keywords],
925
- line,
926
- )
927
- if arg_values:
928
- # Make sure arguments won't be freed until after the call.
929
- # We need this because RArray doesn't support automatic
930
- # memory management.
931
- self.add(KeepAlive(coerced_args))
932
- return value
933
- return None
934
-
935
- def _vectorcall_keywords(self, arg_names: Sequence[str | None] | None) -> Value:
936
- """Return a reference to a tuple literal with keyword argument names.
937
-
938
- Return null pointer if there are no keyword arguments.
939
- """
940
- if arg_names:
941
- kw_list = [name for name in arg_names if name is not None]
942
- if kw_list:
943
- return self.add(LoadLiteral(tuple(kw_list), object_rprimitive))
944
- return Integer(0, object_rprimitive)
945
-
946
- def py_method_call(
947
- self,
948
- obj: Value,
949
- method_name: str,
950
- arg_values: list[Value],
951
- line: int,
952
- arg_kinds: list[ArgKind] | None,
953
- arg_names: Sequence[str | None] | None,
954
- ) -> Value:
955
- """Call a Python method (non-native and slow)."""
956
- if use_method_vectorcall(self.options.capi_version):
957
- # More recent Python versions support faster vectorcalls.
958
- result = self._py_vector_method_call(
959
- obj, method_name, arg_values, line, arg_kinds, arg_names
960
- )
961
- if result is not None:
962
- return result
963
-
964
- if arg_kinds is None or all(kind == ARG_POS for kind in arg_kinds):
965
- # Use legacy method call API
966
- method_name_reg = self.load_str(method_name)
967
- return self.call_c(py_method_call_op, [obj, method_name_reg] + arg_values, line)
968
- else:
969
- # Use py_call since it supports keyword arguments (and vectorcalls).
970
- method = self.py_get_attr(obj, method_name, line)
971
- return self.py_call(method, arg_values, line, arg_kinds=arg_kinds, arg_names=arg_names)
972
-
973
- def _py_vector_method_call(
974
- self,
975
- obj: Value,
976
- method_name: str,
977
- arg_values: list[Value],
978
- line: int,
979
- arg_kinds: list[ArgKind] | None,
980
- arg_names: Sequence[str | None] | None,
981
- ) -> Value | None:
982
- """Call method using the vectorcall API if possible.
983
-
984
- Return the return value if successful. Return None if a non-vectorcall
985
- API should be used instead.
986
- """
987
- if arg_kinds is None or all(
988
- not kind.is_star() and not kind.is_optional() for kind in arg_kinds
989
- ):
990
- method_name_reg = self.load_str(method_name)
991
- coerced_args = [
992
- self.coerce(arg, object_rprimitive, line) for arg in [obj] + arg_values
993
- ]
994
- arg_ptr = self.setup_rarray(object_rprimitive, coerced_args, object_ptr=True)
995
- num_pos = num_positional_args(arg_values, arg_kinds)
996
- keywords = self._vectorcall_keywords(arg_names)
997
- value = self.call_c(
998
- py_vectorcall_method_op,
999
- [
1000
- method_name_reg,
1001
- arg_ptr,
1002
- Integer((num_pos + 1) | PY_VECTORCALL_ARGUMENTS_OFFSET, c_size_t_rprimitive),
1003
- keywords,
1004
- ],
1005
- line,
1006
- )
1007
- # Make sure arguments won't be freed until after the call.
1008
- # We need this because RArray doesn't support automatic
1009
- # memory management.
1010
- self.add(KeepAlive(coerced_args))
1011
- return value
1012
- return None
1013
-
1014
- def call(
1015
- self,
1016
- decl: FuncDecl,
1017
- args: Sequence[Value],
1018
- arg_kinds: list[ArgKind],
1019
- arg_names: Sequence[str | None],
1020
- line: int,
1021
- *,
1022
- bitmap_args: list[Register] | None = None,
1023
- ) -> Value:
1024
- """Call a native function.
1025
-
1026
- If bitmap_args is given, they override the values of (some) of the bitmap
1027
- arguments used to track the presence of values for certain arguments. By
1028
- default, the values of the bitmap arguments are inferred from args.
1029
- """
1030
- # Normalize args to positionals.
1031
- args = self.native_args_to_positional(
1032
- args, arg_kinds, arg_names, decl.sig, line, bitmap_args=bitmap_args
1033
- )
1034
- return self.add(Call(decl, args, line))
1035
-
1036
- def native_args_to_positional(
1037
- self,
1038
- args: Sequence[Value],
1039
- arg_kinds: list[ArgKind],
1040
- arg_names: Sequence[str | None],
1041
- sig: FuncSignature,
1042
- line: int,
1043
- *,
1044
- bitmap_args: list[Register] | None = None,
1045
- ) -> list[Value]:
1046
- """Prepare arguments for a native call.
1047
-
1048
- Given args/kinds/names and a target signature for a native call, map
1049
- keyword arguments to their appropriate place in the argument list,
1050
- fill in error values for unspecified default arguments,
1051
- package arguments that will go into *args/**kwargs into a tuple/dict,
1052
- and coerce arguments to the appropriate type.
1053
- """
1054
-
1055
- sig_args = sig.args
1056
- n = sig.num_bitmap_args
1057
- if n:
1058
- sig_args = sig_args[:-n]
1059
-
1060
- sig_arg_kinds = [arg.kind for arg in sig_args]
1061
- sig_arg_names = [arg.name for arg in sig_args]
1062
-
1063
- concrete_kinds = [concrete_arg_kind(arg_kind) for arg_kind in arg_kinds]
1064
- formal_to_actual = map_actuals_to_formals(
1065
- concrete_kinds,
1066
- arg_names,
1067
- sig_arg_kinds,
1068
- sig_arg_names,
1069
- lambda n: AnyType(TypeOfAny.special_form),
1070
- )
1071
-
1072
- # First scan for */** and construct those
1073
- has_star = has_star2 = False
1074
- star_arg_entries = []
1075
- for lst, arg in zip(formal_to_actual, sig_args):
1076
- if arg.kind.is_star():
1077
- star_arg_entries.extend([(args[i], arg_kinds[i], arg_names[i]) for i in lst])
1078
- has_star = has_star or arg.kind == ARG_STAR
1079
- has_star2 = has_star2 or arg.kind == ARG_STAR2
1080
-
1081
- star_arg, star2_arg = self._construct_varargs(
1082
- star_arg_entries, line, has_star=has_star, has_star2=has_star2
1083
- )
1084
-
1085
- # Flatten out the arguments, loading error values for default
1086
- # arguments, constructing tuples/dicts for star args, and
1087
- # coercing everything to the expected type.
1088
- output_args: list[Value] = []
1089
- for lst, arg in zip(formal_to_actual, sig_args):
1090
- if arg.kind == ARG_STAR:
1091
- assert star_arg
1092
- output_arg = star_arg
1093
- elif arg.kind == ARG_STAR2:
1094
- assert star2_arg
1095
- output_arg = star2_arg
1096
- elif not lst:
1097
- if is_fixed_width_rtype(arg.type):
1098
- output_arg = Integer(0, arg.type)
1099
- elif is_float_rprimitive(arg.type):
1100
- output_arg = Float(0.0)
1101
- else:
1102
- output_arg = self.add(LoadErrorValue(arg.type, is_borrowed=True))
1103
- else:
1104
- base_arg = args[lst[0]]
1105
-
1106
- if arg_kinds[lst[0]].is_optional():
1107
- output_arg = self.coerce_nullable(base_arg, arg.type, line)
1108
- else:
1109
- output_arg = self.coerce(base_arg, arg.type, line)
1110
-
1111
- output_args.append(output_arg)
1112
-
1113
- for i in reversed(range(n)):
1114
- if bitmap_args and i < len(bitmap_args):
1115
- # Use override provided by caller
1116
- output_args.append(bitmap_args[i])
1117
- continue
1118
- # Infer values of bitmap args
1119
- bitmap = 0
1120
- c = 0
1121
- for lst, arg in zip(formal_to_actual, sig_args):
1122
- if arg.kind.is_optional() and arg.type.error_overlap:
1123
- if i * BITMAP_BITS <= c < (i + 1) * BITMAP_BITS:
1124
- if lst:
1125
- bitmap |= 1 << (c & (BITMAP_BITS - 1))
1126
- c += 1
1127
- output_args.append(Integer(bitmap, bitmap_rprimitive))
1128
-
1129
- return output_args
1130
-
1131
- def gen_method_call(
1132
- self,
1133
- base: Value,
1134
- name: str,
1135
- arg_values: list[Value],
1136
- result_type: RType | None,
1137
- line: int,
1138
- arg_kinds: list[ArgKind] | None = None,
1139
- arg_names: list[str | None] | None = None,
1140
- can_borrow: bool = False,
1141
- ) -> Value:
1142
- """Generate either a native or Python method call."""
1143
- # If we have *args, then fallback to Python method call.
1144
- if arg_kinds is not None and any(kind.is_star() for kind in arg_kinds):
1145
- return self.py_method_call(base, name, arg_values, base.line, arg_kinds, arg_names)
1146
-
1147
- # If the base type is one of ours, do a MethodCall
1148
- if (
1149
- isinstance(base.type, RInstance)
1150
- and base.type.class_ir.is_ext_class
1151
- and not base.type.class_ir.builtin_base
1152
- ):
1153
- if base.type.class_ir.has_method(name):
1154
- decl = base.type.class_ir.method_decl(name)
1155
- if arg_kinds is None:
1156
- assert arg_names is None, "arg_kinds not present but arg_names is"
1157
- arg_kinds = [ARG_POS for _ in arg_values]
1158
- arg_names = [None for _ in arg_values]
1159
- else:
1160
- assert arg_names is not None, "arg_kinds present but arg_names is not"
1161
-
1162
- # Normalize args to positionals.
1163
- assert decl.bound_sig
1164
- arg_values = self.native_args_to_positional(
1165
- arg_values, arg_kinds, arg_names, decl.bound_sig, line
1166
- )
1167
- return self.add(MethodCall(base, name, arg_values, line))
1168
- elif base.type.class_ir.has_attr(name):
1169
- function = self.add(GetAttr(base, name, line))
1170
- return self.py_call(
1171
- function, arg_values, line, arg_kinds=arg_kinds, arg_names=arg_names
1172
- )
1173
-
1174
- elif isinstance(base.type, RUnion):
1175
- return self.union_method_call(
1176
- base, base.type, name, arg_values, result_type, line, arg_kinds, arg_names
1177
- )
1178
-
1179
- # Try to do a special-cased method call
1180
- if not arg_kinds or arg_kinds == [ARG_POS] * len(arg_values):
1181
- target = self.translate_special_method_call(
1182
- base, name, arg_values, result_type, line, can_borrow=can_borrow
1183
- )
1184
- if target:
1185
- return target
1186
-
1187
- # Fall back to Python method call
1188
- return self.py_method_call(base, name, arg_values, line, arg_kinds, arg_names)
1189
-
1190
- def union_method_call(
1191
- self,
1192
- base: Value,
1193
- obj_type: RUnion,
1194
- name: str,
1195
- arg_values: list[Value],
1196
- return_rtype: RType | None,
1197
- line: int,
1198
- arg_kinds: list[ArgKind] | None,
1199
- arg_names: list[str | None] | None,
1200
- ) -> Value:
1201
- """Generate a method call with a union type for the object."""
1202
- # Union method call needs a return_rtype for the type of the output register.
1203
- # If we don't have one, use object_rprimitive.
1204
- return_rtype = return_rtype or object_rprimitive
1205
-
1206
- def call_union_item(value: Value) -> Value:
1207
- return self.gen_method_call(
1208
- value, name, arg_values, return_rtype, line, arg_kinds, arg_names
1209
- )
1210
-
1211
- return self.decompose_union_helper(base, obj_type, return_rtype, call_union_item, line)
1212
-
1213
- # Loading various values
1214
-
1215
- def none(self) -> Value:
1216
- """Load unboxed None value (type: none_rprimitive)."""
1217
- return Integer(1, none_rprimitive)
1218
-
1219
- def true(self) -> Value:
1220
- """Load unboxed True value (type: bool_rprimitive)."""
1221
- return Integer(1, bool_rprimitive)
1222
-
1223
- def false(self) -> Value:
1224
- """Load unboxed False value (type: bool_rprimitive)."""
1225
- return Integer(0, bool_rprimitive)
1226
-
1227
- def none_object(self) -> Value:
1228
- """Load Python None value (type: object_rprimitive)."""
1229
- return self.add(LoadAddress(none_object_op.type, none_object_op.src, line=-1))
1230
-
1231
- def load_int(self, value: int) -> Value:
1232
- """Load a tagged (Python) integer literal value."""
1233
- if value > MAX_LITERAL_SHORT_INT or value < MIN_LITERAL_SHORT_INT:
1234
- return self.add(LoadLiteral(value, int_rprimitive))
1235
- else:
1236
- return Integer(value)
1237
-
1238
- def load_float(self, value: float) -> Value:
1239
- """Load a float literal value."""
1240
- return Float(value)
1241
-
1242
- def load_str(self, value: str) -> Value:
1243
- """Load a str literal value.
1244
-
1245
- This is useful for more than just str literals; for example, method calls
1246
- also require a PyObject * form for the name of the method.
1247
- """
1248
- return self.add(LoadLiteral(value, str_rprimitive))
1249
-
1250
- def load_bytes(self, value: bytes) -> Value:
1251
- """Load a bytes literal value."""
1252
- return self.add(LoadLiteral(value, bytes_rprimitive))
1253
-
1254
- def load_complex(self, value: complex) -> Value:
1255
- """Load a complex literal value."""
1256
- return self.add(LoadLiteral(value, object_rprimitive))
1257
-
1258
- def load_static_checked(
1259
- self,
1260
- typ: RType,
1261
- identifier: str,
1262
- module_name: str | None = None,
1263
- namespace: str = NAMESPACE_STATIC,
1264
- line: int = -1,
1265
- error_msg: str | None = None,
1266
- ) -> Value:
1267
- if error_msg is None:
1268
- error_msg = f'name "{identifier}" is not defined'
1269
- ok_block, error_block = BasicBlock(), BasicBlock()
1270
- value = self.add(LoadStatic(typ, identifier, module_name, namespace, line=line))
1271
- self.add(Branch(value, error_block, ok_block, Branch.IS_ERROR, rare=True))
1272
- self.activate_block(error_block)
1273
- self.add(RaiseStandardError(RaiseStandardError.NAME_ERROR, error_msg, line))
1274
- self.add(Unreachable())
1275
- self.activate_block(ok_block)
1276
- return value
1277
-
1278
- def load_module(self, name: str) -> Value:
1279
- return self.add(LoadStatic(object_rprimitive, name, namespace=NAMESPACE_MODULE))
1280
-
1281
- def get_native_type(self, cls: ClassIR) -> Value:
1282
- """Load native type object."""
1283
- fullname = f"{cls.module_name}.{cls.name}"
1284
- return self.load_native_type_object(fullname)
1285
-
1286
- def load_native_type_object(self, fullname: str) -> Value:
1287
- module, name = fullname.rsplit(".", 1)
1288
- return self.add(LoadStatic(object_rprimitive, name, module, NAMESPACE_TYPE))
1289
-
1290
- # Other primitive operations
1291
-
1292
- def binary_op(self, lreg: Value, rreg: Value, op: str, line: int) -> Value:
1293
- """Perform a binary operation.
1294
-
1295
- Generate specialized operations based on operand types, with a fallback
1296
- to generic operations.
1297
- """
1298
- ltype = lreg.type
1299
- rtype = rreg.type
1300
-
1301
- # Special case tuple comparison here so that nested tuples can be supported
1302
- if isinstance(ltype, RTuple) and isinstance(rtype, RTuple) and op in ("==", "!="):
1303
- return self.compare_tuples(lreg, rreg, op, line)
1304
-
1305
- # Special case == and != when we can resolve the method call statically
1306
- if op in ("==", "!="):
1307
- value = self.translate_eq_cmp(lreg, rreg, op, line)
1308
- if value is not None:
1309
- return value
1310
-
1311
- # Special case various ops
1312
- if op in ("is", "is not"):
1313
- return self.translate_is_op(lreg, rreg, op, line)
1314
- # TODO: modify 'str' to use same interface as 'compare_bytes' as it avoids
1315
- # call to PyErr_Occurred()
1316
- if is_str_rprimitive(ltype) and is_str_rprimitive(rtype) and op in ("==", "!="):
1317
- return self.compare_strings(lreg, rreg, op, line)
1318
- if is_bytes_rprimitive(ltype) and is_bytes_rprimitive(rtype) and op in ("==", "!="):
1319
- return self.compare_bytes(lreg, rreg, op, line)
1320
- if is_bool_rprimitive(ltype) and is_bool_rprimitive(rtype) and op in BOOL_BINARY_OPS:
1321
- if op in ComparisonOp.signed_ops:
1322
- return self.bool_comparison_op(lreg, rreg, op, line)
1323
- else:
1324
- return self.bool_bitwise_op(lreg, rreg, op[0], line)
1325
- if isinstance(rtype, RInstance) and op in ("in", "not in"):
1326
- return self.translate_instance_contains(rreg, lreg, op, line)
1327
- if is_fixed_width_rtype(ltype):
1328
- if op in FIXED_WIDTH_INT_BINARY_OPS:
1329
- if op.endswith("="):
1330
- op = op[:-1]
1331
- if op != "//":
1332
- op_id = int_op_to_id[op]
1333
- else:
1334
- op_id = IntOp.DIV
1335
- if is_bool_rprimitive(rtype) or is_bit_rprimitive(rtype):
1336
- rreg = self.coerce(rreg, ltype, line)
1337
- rtype = ltype
1338
- if is_fixed_width_rtype(rtype) or is_tagged(rtype):
1339
- return self.fixed_width_int_op(ltype, lreg, rreg, op_id, line)
1340
- if isinstance(rreg, Integer):
1341
- return self.fixed_width_int_op(
1342
- ltype, lreg, self.coerce(rreg, ltype, line), op_id, line
1343
- )
1344
- elif op in ComparisonOp.signed_ops:
1345
- if is_int_rprimitive(rtype):
1346
- rreg = self.coerce_int_to_fixed_width(rreg, ltype, line)
1347
- elif is_bool_rprimitive(rtype) or is_bit_rprimitive(rtype):
1348
- rreg = self.coerce(rreg, ltype, line)
1349
- op_id = ComparisonOp.signed_ops[op]
1350
- if is_fixed_width_rtype(rreg.type):
1351
- return self.comparison_op(lreg, rreg, op_id, line)
1352
- if isinstance(rreg, Integer):
1353
- return self.comparison_op(lreg, self.coerce(rreg, ltype, line), op_id, line)
1354
- elif is_fixed_width_rtype(rtype):
1355
- if op in FIXED_WIDTH_INT_BINARY_OPS:
1356
- if op.endswith("="):
1357
- op = op[:-1]
1358
- if op != "//":
1359
- op_id = int_op_to_id[op]
1360
- else:
1361
- op_id = IntOp.DIV
1362
- if isinstance(lreg, Integer):
1363
- return self.fixed_width_int_op(
1364
- rtype, self.coerce(lreg, rtype, line), rreg, op_id, line
1365
- )
1366
- if is_tagged(ltype):
1367
- return self.fixed_width_int_op(rtype, lreg, rreg, op_id, line)
1368
- if is_bool_rprimitive(ltype) or is_bit_rprimitive(ltype):
1369
- lreg = self.coerce(lreg, rtype, line)
1370
- return self.fixed_width_int_op(rtype, lreg, rreg, op_id, line)
1371
- elif op in ComparisonOp.signed_ops:
1372
- if is_int_rprimitive(ltype):
1373
- lreg = self.coerce_int_to_fixed_width(lreg, rtype, line)
1374
- elif is_bool_rprimitive(ltype) or is_bit_rprimitive(ltype):
1375
- lreg = self.coerce(lreg, rtype, line)
1376
- op_id = ComparisonOp.signed_ops[op]
1377
- if isinstance(lreg, Integer):
1378
- return self.comparison_op(self.coerce(lreg, rtype, line), rreg, op_id, line)
1379
- if is_fixed_width_rtype(lreg.type):
1380
- return self.comparison_op(lreg, rreg, op_id, line)
1381
-
1382
- if is_float_rprimitive(ltype) or is_float_rprimitive(rtype):
1383
- if isinstance(lreg, Integer):
1384
- lreg = Float(float(lreg.numeric_value()))
1385
- elif isinstance(rreg, Integer):
1386
- rreg = Float(float(rreg.numeric_value()))
1387
- elif is_int_rprimitive(lreg.type):
1388
- lreg = self.int_to_float(lreg, line)
1389
- elif is_int_rprimitive(rreg.type):
1390
- rreg = self.int_to_float(rreg, line)
1391
- if is_float_rprimitive(lreg.type) and is_float_rprimitive(rreg.type):
1392
- if op in float_comparison_op_to_id:
1393
- return self.compare_floats(lreg, rreg, float_comparison_op_to_id[op], line)
1394
- if op.endswith("="):
1395
- base_op = op[:-1]
1396
- else:
1397
- base_op = op
1398
- if base_op in float_op_to_id:
1399
- return self.float_op(lreg, rreg, base_op, line)
1400
-
1401
- primitive_ops_candidates = binary_ops.get(op, [])
1402
- target = self.matching_primitive_op(primitive_ops_candidates, [lreg, rreg], line)
1403
- assert target, "Unsupported binary operation: %s" % op
1404
- return target
1405
-
1406
- def check_tagged_short_int(self, val: Value, line: int, negated: bool = False) -> Value:
1407
- """Check if a tagged integer is a short integer.
1408
-
1409
- Return the result of the check (value of type 'bit').
1410
- """
1411
- int_tag = Integer(1, c_pyssize_t_rprimitive, line)
1412
- bitwise_and = self.int_op(c_pyssize_t_rprimitive, val, int_tag, IntOp.AND, line)
1413
- zero = Integer(0, c_pyssize_t_rprimitive, line)
1414
- op = ComparisonOp.NEQ if negated else ComparisonOp.EQ
1415
- check = self.comparison_op(bitwise_and, zero, op, line)
1416
- return check
1417
-
1418
- def compare_strings(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:
1419
- """Compare two strings"""
1420
- compare_result = self.call_c(unicode_compare, [lhs, rhs], line)
1421
- error_constant = Integer(-1, c_int_rprimitive, line)
1422
- compare_error_check = self.add(
1423
- ComparisonOp(compare_result, error_constant, ComparisonOp.EQ, line)
1424
- )
1425
- exception_check, propagate, final_compare = BasicBlock(), BasicBlock(), BasicBlock()
1426
- branch = Branch(compare_error_check, exception_check, final_compare, Branch.BOOL)
1427
- branch.negated = False
1428
- self.add(branch)
1429
- self.activate_block(exception_check)
1430
- check_error_result = self.call_c(err_occurred_op, [], line)
1431
- null = Integer(0, pointer_rprimitive, line)
1432
- compare_error_check = self.add(
1433
- ComparisonOp(check_error_result, null, ComparisonOp.NEQ, line)
1434
- )
1435
- branch = Branch(compare_error_check, propagate, final_compare, Branch.BOOL)
1436
- branch.negated = False
1437
- self.add(branch)
1438
- self.activate_block(propagate)
1439
- self.call_c(keep_propagating_op, [], line)
1440
- self.goto(final_compare)
1441
- self.activate_block(final_compare)
1442
- op_type = ComparisonOp.EQ if op == "==" else ComparisonOp.NEQ
1443
- return self.add(ComparisonOp(compare_result, Integer(0, c_int_rprimitive), op_type, line))
1444
-
1445
- def compare_bytes(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:
1446
- compare_result = self.call_c(bytes_compare, [lhs, rhs], line)
1447
- op_type = ComparisonOp.EQ if op == "==" else ComparisonOp.NEQ
1448
- return self.add(ComparisonOp(compare_result, Integer(1, c_int_rprimitive), op_type, line))
1449
-
1450
- def compare_tuples(self, lhs: Value, rhs: Value, op: str, line: int = -1) -> Value:
1451
- """Compare two tuples item by item"""
1452
- # type cast to pass mypy check
1453
- assert isinstance(lhs.type, RTuple) and isinstance(rhs.type, RTuple)
1454
- equal = True if op == "==" else False
1455
- result = Register(bool_rprimitive)
1456
- # empty tuples
1457
- if len(lhs.type.types) == 0 and len(rhs.type.types) == 0:
1458
- self.add(Assign(result, self.true() if equal else self.false(), line))
1459
- return result
1460
- length = len(lhs.type.types)
1461
- false_assign, true_assign, out = BasicBlock(), BasicBlock(), BasicBlock()
1462
- check_blocks = [BasicBlock() for _ in range(length)]
1463
- lhs_items = [self.add(TupleGet(lhs, i, line)) for i in range(length)]
1464
- rhs_items = [self.add(TupleGet(rhs, i, line)) for i in range(length)]
1465
-
1466
- if equal:
1467
- early_stop, final = false_assign, true_assign
1468
- else:
1469
- early_stop, final = true_assign, false_assign
1470
-
1471
- for i in range(len(lhs.type.types)):
1472
- if i != 0:
1473
- self.activate_block(check_blocks[i])
1474
- lhs_item = lhs_items[i]
1475
- rhs_item = rhs_items[i]
1476
- compare = self.binary_op(lhs_item, rhs_item, op, line)
1477
- # Cast to bool if necessary since most types uses comparison returning a object type
1478
- # See generic_ops.py for more information
1479
- if not is_bool_rprimitive(compare.type):
1480
- compare = self.call_c(bool_op, [compare], line)
1481
- if i < len(lhs.type.types) - 1:
1482
- branch = Branch(compare, early_stop, check_blocks[i + 1], Branch.BOOL)
1483
- else:
1484
- branch = Branch(compare, early_stop, final, Branch.BOOL)
1485
- # if op is ==, we branch on false, else branch on true
1486
- branch.negated = equal
1487
- self.add(branch)
1488
- self.activate_block(false_assign)
1489
- self.add(Assign(result, self.false(), line))
1490
- self.goto(out)
1491
- self.activate_block(true_assign)
1492
- self.add(Assign(result, self.true(), line))
1493
- self.goto_and_activate(out)
1494
- return result
1495
-
1496
- def translate_instance_contains(self, inst: Value, item: Value, op: str, line: int) -> Value:
1497
- res = self.gen_method_call(inst, "__contains__", [item], None, line)
1498
- if not is_bool_rprimitive(res.type):
1499
- res = self.call_c(bool_op, [res], line)
1500
- if op == "not in":
1501
- res = self.bool_bitwise_op(res, Integer(1, rtype=bool_rprimitive), "^", line)
1502
- return res
1503
-
1504
- def bool_bitwise_op(self, lreg: Value, rreg: Value, op: str, line: int) -> Value:
1505
- if op == "&":
1506
- code = IntOp.AND
1507
- elif op == "|":
1508
- code = IntOp.OR
1509
- elif op == "^":
1510
- code = IntOp.XOR
1511
- else:
1512
- assert False, op
1513
- return self.add(IntOp(bool_rprimitive, lreg, rreg, code, line))
1514
-
1515
- def bool_comparison_op(self, lreg: Value, rreg: Value, op: str, line: int) -> Value:
1516
- op_id = ComparisonOp.signed_ops[op]
1517
- return self.comparison_op(lreg, rreg, op_id, line)
1518
-
1519
- def unary_not(self, value: Value, line: int) -> Value:
1520
- mask = Integer(1, value.type, line)
1521
- return self.int_op(value.type, value, mask, IntOp.XOR, line)
1522
-
1523
- def unary_op(self, value: Value, expr_op: str, line: int) -> Value:
1524
- typ = value.type
1525
- if is_bool_rprimitive(typ) or is_bit_rprimitive(typ):
1526
- if expr_op == "not":
1527
- return self.unary_not(value, line)
1528
- if expr_op == "+":
1529
- return value
1530
- if is_fixed_width_rtype(typ):
1531
- if expr_op == "-":
1532
- # Translate to '0 - x'
1533
- return self.int_op(typ, Integer(0, typ), value, IntOp.SUB, line)
1534
- elif expr_op == "~":
1535
- if typ.is_signed:
1536
- # Translate to 'x ^ -1'
1537
- return self.int_op(typ, value, Integer(-1, typ), IntOp.XOR, line)
1538
- else:
1539
- # Translate to 'x ^ 0xff...'
1540
- mask = (1 << (typ.size * 8)) - 1
1541
- return self.int_op(typ, value, Integer(mask, typ), IntOp.XOR, line)
1542
- elif expr_op == "+":
1543
- return value
1544
- if is_float_rprimitive(typ):
1545
- if expr_op == "-":
1546
- return self.add(FloatNeg(value, line))
1547
- elif expr_op == "+":
1548
- return value
1549
-
1550
- if isinstance(value, Integer):
1551
- # TODO: Overflow? Unsigned?
1552
- num = value.value
1553
- if is_short_int_rprimitive(typ):
1554
- num >>= 1
1555
- return Integer(-num, typ, value.line)
1556
- if is_tagged(typ) and expr_op == "+":
1557
- return value
1558
- if isinstance(value, Float):
1559
- return Float(-value.value, value.line)
1560
- if isinstance(typ, RInstance):
1561
- if expr_op == "-":
1562
- method = "__neg__"
1563
- elif expr_op == "+":
1564
- method = "__pos__"
1565
- elif expr_op == "~":
1566
- method = "__invert__"
1567
- else:
1568
- method = ""
1569
- if method and typ.class_ir.has_method(method):
1570
- return self.gen_method_call(value, method, [], None, line)
1571
- call_c_ops_candidates = unary_ops.get(expr_op, [])
1572
- target = self.matching_call_c(call_c_ops_candidates, [value], line)
1573
- assert target, "Unsupported unary operation: %s" % expr_op
1574
- return target
1575
-
1576
- def make_dict(self, key_value_pairs: Sequence[DictEntry], line: int) -> Value:
1577
- result: Value | None = None
1578
- keys: list[Value] = []
1579
- values: list[Value] = []
1580
- for key, value in key_value_pairs:
1581
- if key is not None:
1582
- # key:value
1583
- if result is None:
1584
- keys.append(key)
1585
- values.append(value)
1586
- continue
1587
-
1588
- self.translate_special_method_call(
1589
- result, "__setitem__", [key, value], result_type=None, line=line
1590
- )
1591
- else:
1592
- # **value
1593
- if result is None:
1594
- result = self._create_dict(keys, values, line)
1595
-
1596
- self.call_c(dict_update_in_display_op, [result, value], line=line)
1597
-
1598
- if result is None:
1599
- result = self._create_dict(keys, values, line)
1600
-
1601
- return result
1602
-
1603
- def new_list_op_with_length(self, length: Value, line: int) -> Value:
1604
- """This function returns an uninitialized list.
1605
-
1606
- If the length is non-zero, the caller must initialize the list, before
1607
- it can be made visible to user code -- otherwise the list object is broken.
1608
- You might need further initialization with `new_list_set_item_op` op.
1609
-
1610
- Args:
1611
- length: desired length of the new list. The rtype should be
1612
- c_pyssize_t_rprimitive
1613
- line: line number
1614
- """
1615
- return self.call_c(new_list_op, [length], line)
1616
-
1617
- def new_list_op(self, values: list[Value], line: int) -> Value:
1618
- length: list[Value] = [Integer(len(values), c_pyssize_t_rprimitive, line)]
1619
- if len(values) >= LIST_BUILDING_EXPANSION_THRESHOLD:
1620
- return self.call_c(list_build_op, length + values, line)
1621
-
1622
- # If the length of the list is less than the threshold,
1623
- # LIST_BUILDING_EXPANSION_THRESHOLD, we directly expand the
1624
- # for-loop and inline the SetMem operation, which is faster
1625
- # than list_build_op, however generates more code.
1626
- result_list = self.call_c(new_list_op, length, line)
1627
- if not values:
1628
- return result_list
1629
- args = [self.coerce(item, object_rprimitive, line) for item in values]
1630
- ob_item_base = self.add(PrimitiveOp([result_list], list_items, line))
1631
- for i in range(len(values)):
1632
- self.primitive_op(
1633
- buf_init_item, [ob_item_base, Integer(i, c_pyssize_t_rprimitive), args[i]], line
1634
- )
1635
- self.add(KeepAlive([result_list]))
1636
- return result_list
1637
-
1638
- def new_set_op(self, values: list[Value], line: int) -> Value:
1639
- return self.call_c(new_set_op, values, line)
1640
-
1641
- def setup_rarray(
1642
- self, item_type: RType, values: Sequence[Value], *, object_ptr: bool = False
1643
- ) -> Value:
1644
- """Declare and initialize a new RArray, returning its address."""
1645
- array = Register(RArray(item_type, len(values)))
1646
- self.add(AssignMulti(array, list(values)))
1647
- return self.add(
1648
- LoadAddress(object_pointer_rprimitive if object_ptr else c_pointer_rprimitive, array)
1649
- )
1650
-
1651
- def shortcircuit_helper(
1652
- self,
1653
- op: str,
1654
- expr_type: RType,
1655
- left: Callable[[], Value],
1656
- right: Callable[[], Value],
1657
- line: int,
1658
- ) -> Value:
1659
- # Having actual Phi nodes would be really nice here!
1660
- target = Register(expr_type)
1661
- # left_body takes the value of the left side, right_body the right
1662
- left_body, right_body, next_block = BasicBlock(), BasicBlock(), BasicBlock()
1663
- # true_body is taken if the left is true, false_body if it is false.
1664
- # For 'and' the value is the right side if the left is true, and for 'or'
1665
- # it is the right side if the left is false.
1666
- true_body, false_body = (right_body, left_body) if op == "and" else (left_body, right_body)
1667
-
1668
- left_value = left()
1669
- self.add_bool_branch(left_value, true_body, false_body)
1670
-
1671
- self.activate_block(left_body)
1672
- left_coerced = self.coerce(left_value, expr_type, line)
1673
- self.add(Assign(target, left_coerced))
1674
- self.goto(next_block)
1675
-
1676
- self.activate_block(right_body)
1677
- right_value = right()
1678
- right_coerced = self.coerce(right_value, expr_type, line)
1679
- self.add(Assign(target, right_coerced))
1680
- self.goto(next_block)
1681
-
1682
- self.activate_block(next_block)
1683
- return target
1684
-
1685
- def bool_value(self, value: Value) -> Value:
1686
- """Return bool(value).
1687
-
1688
- The result type can be bit_rprimitive or bool_rprimitive.
1689
- """
1690
- if is_bool_rprimitive(value.type) or is_bit_rprimitive(value.type):
1691
- result = value
1692
- elif is_runtime_subtype(value.type, int_rprimitive):
1693
- zero = Integer(0, short_int_rprimitive)
1694
- result = self.comparison_op(value, zero, ComparisonOp.NEQ, value.line)
1695
- elif is_fixed_width_rtype(value.type):
1696
- zero = Integer(0, value.type)
1697
- result = self.add(ComparisonOp(value, zero, ComparisonOp.NEQ))
1698
- elif is_same_type(value.type, str_rprimitive):
1699
- result = self.call_c(str_check_if_true, [value], value.line)
1700
- elif is_same_type(value.type, list_rprimitive) or is_same_type(
1701
- value.type, dict_rprimitive
1702
- ):
1703
- length = self.builtin_len(value, value.line)
1704
- zero = Integer(0)
1705
- result = self.binary_op(length, zero, "!=", value.line)
1706
- elif (
1707
- isinstance(value.type, RInstance)
1708
- and value.type.class_ir.is_ext_class
1709
- and value.type.class_ir.has_method("__bool__")
1710
- ):
1711
- # Directly call the __bool__ method on classes that have it.
1712
- result = self.gen_method_call(value, "__bool__", [], bool_rprimitive, value.line)
1713
- elif is_float_rprimitive(value.type):
1714
- result = self.compare_floats(value, Float(0.0), FloatComparisonOp.NEQ, value.line)
1715
- else:
1716
- value_type = optional_value_type(value.type)
1717
- if value_type is not None:
1718
- not_none = self.translate_is_op(value, self.none_object(), "is not", value.line)
1719
- always_truthy = False
1720
- if isinstance(value_type, RInstance):
1721
- # check whether X.__bool__ is always just the default (object.__bool__)
1722
- if not value_type.class_ir.has_method(
1723
- "__bool__"
1724
- ) and value_type.class_ir.is_method_final("__bool__"):
1725
- always_truthy = True
1726
-
1727
- if always_truthy:
1728
- result = not_none
1729
- else:
1730
- # "X | None" where X may be falsey and requires a check
1731
- result = Register(bit_rprimitive)
1732
- true, false, end = BasicBlock(), BasicBlock(), BasicBlock()
1733
- branch = Branch(not_none, true, false, Branch.BOOL)
1734
- self.add(branch)
1735
- self.activate_block(true)
1736
- # unbox_or_cast instead of coerce because we want the
1737
- # type to change even if it is a subtype.
1738
- remaining = self.unbox_or_cast(value, value_type, value.line)
1739
- as_bool = self.bool_value(remaining)
1740
- self.add(Assign(result, as_bool))
1741
- self.goto(end)
1742
- self.activate_block(false)
1743
- self.add(Assign(result, Integer(0, bit_rprimitive)))
1744
- self.goto(end)
1745
- self.activate_block(end)
1746
- else:
1747
- result = self.call_c(bool_op, [value], value.line)
1748
- return result
1749
-
1750
- def add_bool_branch(self, value: Value, true: BasicBlock, false: BasicBlock) -> None:
1751
- opt_value_type = optional_value_type(value.type)
1752
- if opt_value_type is None:
1753
- bool_value = self.bool_value(value)
1754
- self.add(Branch(bool_value, true, false, Branch.BOOL))
1755
- else:
1756
- # Special-case optional types
1757
- is_none = self.translate_is_op(value, self.none_object(), "is not", value.line)
1758
- branch = Branch(is_none, true, false, Branch.BOOL)
1759
- self.add(branch)
1760
- always_truthy = False
1761
- if isinstance(opt_value_type, RInstance):
1762
- # check whether X.__bool__ is always just the default (object.__bool__)
1763
- if not opt_value_type.class_ir.has_method(
1764
- "__bool__"
1765
- ) and opt_value_type.class_ir.is_method_final("__bool__"):
1766
- always_truthy = True
1767
-
1768
- if not always_truthy:
1769
- # Optional[X] where X may be falsey and requires a check
1770
- branch.true = BasicBlock()
1771
- self.activate_block(branch.true)
1772
- # unbox_or_cast instead of coerce because we want the
1773
- # type to change even if it is a subtype.
1774
- remaining = self.unbox_or_cast(value, opt_value_type, value.line)
1775
- self.add_bool_branch(remaining, true, false)
1776
-
1777
- def call_c(
1778
- self,
1779
- desc: CFunctionDescription,
1780
- args: list[Value],
1781
- line: int,
1782
- result_type: RType | None = None,
1783
- ) -> Value:
1784
- """Call function using C/native calling convention (not a Python callable)."""
1785
- # Handle void function via singleton RVoid instance
1786
- coerced = []
1787
- # Coerce fixed number arguments
1788
- for i in range(min(len(args), len(desc.arg_types))):
1789
- formal_type = desc.arg_types[i]
1790
- arg = args[i]
1791
- arg = self.coerce(arg, formal_type, line)
1792
- coerced.append(arg)
1793
- # Reorder args if necessary
1794
- if desc.ordering is not None:
1795
- assert desc.var_arg_type is None
1796
- coerced = [coerced[i] for i in desc.ordering]
1797
- # Coerce any var_arg
1798
- var_arg_idx = -1
1799
- if desc.var_arg_type is not None:
1800
- var_arg_idx = len(desc.arg_types)
1801
- for i in range(len(desc.arg_types), len(args)):
1802
- arg = args[i]
1803
- arg = self.coerce(arg, desc.var_arg_type, line)
1804
- coerced.append(arg)
1805
- # Add extra integer constant if any
1806
- for item in desc.extra_int_constants:
1807
- val, typ = item
1808
- extra_int_constant = Integer(val, typ, line)
1809
- coerced.append(extra_int_constant)
1810
- error_kind = desc.error_kind
1811
- if error_kind == ERR_NEG_INT:
1812
- # Handled with an explicit comparison
1813
- error_kind = ERR_NEVER
1814
- target = self.add(
1815
- CallC(
1816
- desc.c_function_name,
1817
- coerced,
1818
- desc.return_type,
1819
- desc.steals,
1820
- desc.is_borrowed,
1821
- error_kind,
1822
- line,
1823
- var_arg_idx,
1824
- )
1825
- )
1826
- if desc.is_borrowed:
1827
- # If the result is borrowed, force the arguments to be
1828
- # kept alive afterwards, as otherwise the result might be
1829
- # immediately freed, at the risk of a dangling pointer.
1830
- for arg in coerced:
1831
- if not isinstance(arg, (Integer, LoadLiteral)):
1832
- self.keep_alives.append(arg)
1833
- if desc.error_kind == ERR_NEG_INT:
1834
- comp = ComparisonOp(target, Integer(0, desc.return_type, line), ComparisonOp.SGE, line)
1835
- comp.error_kind = ERR_FALSE
1836
- self.add(comp)
1837
-
1838
- if desc.truncated_type is None:
1839
- result = target
1840
- else:
1841
- truncate = self.add(Truncate(target, desc.truncated_type))
1842
- result = truncate
1843
- if result_type and not is_runtime_subtype(result.type, result_type):
1844
- if is_none_rprimitive(result_type):
1845
- # Special case None return. The actual result may actually be a bool
1846
- # and so we can't just coerce it.
1847
- result = self.none()
1848
- else:
1849
- result = self.coerce(target, result_type, line, can_borrow=desc.is_borrowed)
1850
- return result
1851
-
1852
- def matching_call_c(
1853
- self,
1854
- candidates: list[CFunctionDescription],
1855
- args: list[Value],
1856
- line: int,
1857
- result_type: RType | None = None,
1858
- can_borrow: bool = False,
1859
- ) -> Value | None:
1860
- matching: CFunctionDescription | None = None
1861
- for desc in candidates:
1862
- if len(desc.arg_types) != len(args):
1863
- continue
1864
- if all(
1865
- is_subtype(actual.type, formal) for actual, formal in zip(args, desc.arg_types)
1866
- ) and (not desc.is_borrowed or can_borrow):
1867
- if matching:
1868
- assert matching.priority != desc.priority, "Ambiguous:\n1) {}\n2) {}".format(
1869
- matching, desc
1870
- )
1871
- if desc.priority > matching.priority:
1872
- matching = desc
1873
- else:
1874
- matching = desc
1875
- if matching:
1876
- target = self.call_c(matching, args, line, result_type)
1877
- return target
1878
- return None
1879
-
1880
- def primitive_op(
1881
- self,
1882
- desc: PrimitiveDescription,
1883
- args: list[Value],
1884
- line: int,
1885
- result_type: RType | None = None,
1886
- ) -> Value:
1887
- """Add a primitive op."""
1888
- # Does this primitive map into calling a Python C API
1889
- # or an internal mypyc C API function?
1890
- if desc.c_function_name:
1891
- # TODO: Generate PrimitiOps here and transform them into CallC
1892
- # ops only later in the lowering pass
1893
- c_desc = CFunctionDescription(
1894
- desc.name,
1895
- desc.arg_types,
1896
- desc.return_type,
1897
- desc.var_arg_type,
1898
- desc.truncated_type,
1899
- desc.c_function_name,
1900
- desc.error_kind,
1901
- desc.steals,
1902
- desc.is_borrowed,
1903
- desc.ordering,
1904
- desc.extra_int_constants,
1905
- desc.priority,
1906
- )
1907
- return self.call_c(c_desc, args, line, result_type)
1908
-
1909
- # This primitve gets transformed in a lowering pass to
1910
- # lower-level IR ops using a custom transform function.
1911
-
1912
- coerced = []
1913
- # Coerce fixed number arguments
1914
- for i in range(min(len(args), len(desc.arg_types))):
1915
- formal_type = desc.arg_types[i]
1916
- arg = args[i]
1917
- assert formal_type is not None # TODO
1918
- arg = self.coerce(arg, formal_type, line)
1919
- coerced.append(arg)
1920
- assert desc.ordering is None
1921
- assert desc.var_arg_type is None
1922
- assert not desc.extra_int_constants
1923
- target = self.add(PrimitiveOp(coerced, desc, line=line))
1924
- if desc.is_borrowed:
1925
- # If the result is borrowed, force the arguments to be
1926
- # kept alive afterwards, as otherwise the result might be
1927
- # immediately freed, at the risk of a dangling pointer.
1928
- for arg in coerced:
1929
- if not isinstance(arg, (Integer, LoadLiteral)):
1930
- self.keep_alives.append(arg)
1931
- if desc.error_kind == ERR_NEG_INT:
1932
- comp = ComparisonOp(target, Integer(0, desc.return_type, line), ComparisonOp.SGE, line)
1933
- comp.error_kind = ERR_FALSE
1934
- self.add(comp)
1935
-
1936
- assert desc.truncated_type is None
1937
- result = target
1938
- if result_type and not is_runtime_subtype(result.type, result_type):
1939
- if is_none_rprimitive(result_type):
1940
- # Special case None return. The actual result may actually be a bool
1941
- # and so we can't just coerce it.
1942
- result = self.none()
1943
- else:
1944
- result = self.coerce(result, result_type, line, can_borrow=desc.is_borrowed)
1945
- return result
1946
-
1947
- def matching_primitive_op(
1948
- self,
1949
- candidates: list[PrimitiveDescription],
1950
- args: list[Value],
1951
- line: int,
1952
- result_type: RType | None = None,
1953
- can_borrow: bool = False,
1954
- ) -> Value | None:
1955
- matching: PrimitiveDescription | None = None
1956
- for desc in candidates:
1957
- if len(desc.arg_types) != len(args):
1958
- continue
1959
- if all(
1960
- # formal is not None and # TODO
1961
- is_subtype(actual.type, formal)
1962
- for actual, formal in zip(args, desc.arg_types)
1963
- ) and (not desc.is_borrowed or can_borrow):
1964
- if matching:
1965
- assert matching.priority != desc.priority, "Ambiguous:\n1) {}\n2) {}".format(
1966
- matching, desc
1967
- )
1968
- if desc.priority > matching.priority:
1969
- matching = desc
1970
- else:
1971
- matching = desc
1972
- if matching:
1973
- return self.primitive_op(matching, args, line=line)
1974
- return None
1975
-
1976
- def int_op(self, type: RType, lhs: Value, rhs: Value, op: int, line: int = -1) -> Value:
1977
- """Generate a native integer binary op.
1978
-
1979
- Use native/C semantics, which sometimes differ from Python
1980
- semantics.
1981
-
1982
- Args:
1983
- type: Either int64_rprimitive or int32_rprimitive
1984
- op: IntOp.* constant (e.g. IntOp.ADD)
1985
- """
1986
- return self.add(IntOp(type, lhs, rhs, op, line))
1987
-
1988
- def float_op(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:
1989
- """Generate a native float binary arithmetic operation.
1990
-
1991
- This follows Python semantics (e.g. raise exception on division by zero).
1992
- Add a FloatOp directly if you want low-level semantics.
1993
-
1994
- Args:
1995
- op: Binary operator (e.g. '+' or '*')
1996
- """
1997
- op_id = float_op_to_id[op]
1998
- if op_id in (FloatOp.DIV, FloatOp.MOD):
1999
- if not (isinstance(rhs, Float) and rhs.value != 0.0):
2000
- c = self.compare_floats(rhs, Float(0.0), FloatComparisonOp.EQ, line)
2001
- err, ok = BasicBlock(), BasicBlock()
2002
- self.add(Branch(c, err, ok, Branch.BOOL, rare=True))
2003
- self.activate_block(err)
2004
- if op_id == FloatOp.DIV:
2005
- msg = "float division by zero"
2006
- else:
2007
- msg = "float modulo"
2008
- self.add(RaiseStandardError(RaiseStandardError.ZERO_DIVISION_ERROR, msg, line))
2009
- self.add(Unreachable())
2010
- self.activate_block(ok)
2011
- if op_id == FloatOp.MOD:
2012
- # Adjust the result to match Python semantics (FloatOp follows C semantics).
2013
- return self.float_mod(lhs, rhs, line)
2014
- else:
2015
- return self.add(FloatOp(lhs, rhs, op_id, line))
2016
-
2017
- def float_mod(self, lhs: Value, rhs: Value, line: int) -> Value:
2018
- """Perform x % y on floats using Python semantics."""
2019
- mod = self.add(FloatOp(lhs, rhs, FloatOp.MOD, line))
2020
- res = Register(float_rprimitive)
2021
- self.add(Assign(res, mod))
2022
- tricky, adjust, copysign, done = BasicBlock(), BasicBlock(), BasicBlock(), BasicBlock()
2023
- is_zero = self.add(FloatComparisonOp(res, Float(0.0), FloatComparisonOp.EQ, line))
2024
- self.add(Branch(is_zero, copysign, tricky, Branch.BOOL))
2025
- self.activate_block(tricky)
2026
- same_signs = self.is_same_float_signs(lhs, rhs, line)
2027
- self.add(Branch(same_signs, done, adjust, Branch.BOOL))
2028
- self.activate_block(adjust)
2029
- adj = self.float_op(res, rhs, "+", line)
2030
- self.add(Assign(res, adj))
2031
- self.add(Goto(done))
2032
- self.activate_block(copysign)
2033
- # If the remainder is zero, CPython ensures the result has the
2034
- # same sign as the denominator.
2035
- adj = self.call_c(copysign_op, [Float(0.0), rhs], line)
2036
- self.add(Assign(res, adj))
2037
- self.add(Goto(done))
2038
- self.activate_block(done)
2039
- return res
2040
-
2041
- def compare_floats(self, lhs: Value, rhs: Value, op: int, line: int) -> Value:
2042
- return self.add(FloatComparisonOp(lhs, rhs, op, line))
2043
-
2044
- def fixed_width_int_op(
2045
- self, type: RPrimitive, lhs: Value, rhs: Value, op: int, line: int
2046
- ) -> Value:
2047
- """Generate a binary op using Python fixed-width integer semantics.
2048
-
2049
- These may differ in overflow/rounding behavior from native/C ops.
2050
-
2051
- Args:
2052
- type: Either int64_rprimitive or int32_rprimitive
2053
- op: IntOp.* constant (e.g. IntOp.ADD)
2054
- """
2055
- lhs = self.coerce(lhs, type, line)
2056
- rhs = self.coerce(rhs, type, line)
2057
- if op == IntOp.DIV:
2058
- if isinstance(rhs, Integer) and rhs.value not in (-1, 0):
2059
- if not type.is_signed:
2060
- return self.int_op(type, lhs, rhs, IntOp.DIV, line)
2061
- else:
2062
- # Inline simple division by a constant, so that C
2063
- # compilers can optimize more
2064
- return self.inline_fixed_width_divide(type, lhs, rhs, line)
2065
- if is_int64_rprimitive(type):
2066
- prim = int64_divide_op
2067
- elif is_int32_rprimitive(type):
2068
- prim = int32_divide_op
2069
- elif is_int16_rprimitive(type):
2070
- prim = int16_divide_op
2071
- elif is_uint8_rprimitive(type):
2072
- self.check_for_zero_division(rhs, type, line)
2073
- return self.int_op(type, lhs, rhs, op, line)
2074
- else:
2075
- assert False, type
2076
- return self.call_c(prim, [lhs, rhs], line)
2077
- if op == IntOp.MOD:
2078
- if isinstance(rhs, Integer) and rhs.value not in (-1, 0):
2079
- if not type.is_signed:
2080
- return self.int_op(type, lhs, rhs, IntOp.MOD, line)
2081
- else:
2082
- # Inline simple % by a constant, so that C
2083
- # compilers can optimize more
2084
- return self.inline_fixed_width_mod(type, lhs, rhs, line)
2085
- if is_int64_rprimitive(type):
2086
- prim = int64_mod_op
2087
- elif is_int32_rprimitive(type):
2088
- prim = int32_mod_op
2089
- elif is_int16_rprimitive(type):
2090
- prim = int16_mod_op
2091
- elif is_uint8_rprimitive(type):
2092
- self.check_for_zero_division(rhs, type, line)
2093
- return self.int_op(type, lhs, rhs, op, line)
2094
- else:
2095
- assert False, type
2096
- return self.call_c(prim, [lhs, rhs], line)
2097
- return self.int_op(type, lhs, rhs, op, line)
2098
-
2099
- def check_for_zero_division(self, rhs: Value, type: RType, line: int) -> None:
2100
- err, ok = BasicBlock(), BasicBlock()
2101
- is_zero = self.binary_op(rhs, Integer(0, type), "==", line)
2102
- self.add(Branch(is_zero, err, ok, Branch.BOOL))
2103
- self.activate_block(err)
2104
- self.add(
2105
- RaiseStandardError(
2106
- RaiseStandardError.ZERO_DIVISION_ERROR, "integer division or modulo by zero", line
2107
- )
2108
- )
2109
- self.add(Unreachable())
2110
- self.activate_block(ok)
2111
-
2112
- def inline_fixed_width_divide(self, type: RType, lhs: Value, rhs: Value, line: int) -> Value:
2113
- # Perform floor division (native division truncates)
2114
- res = Register(type)
2115
- div = self.int_op(type, lhs, rhs, IntOp.DIV, line)
2116
- self.add(Assign(res, div))
2117
- same_signs = self.is_same_native_int_signs(type, lhs, rhs, line)
2118
- tricky, adjust, done = BasicBlock(), BasicBlock(), BasicBlock()
2119
- self.add(Branch(same_signs, done, tricky, Branch.BOOL))
2120
- self.activate_block(tricky)
2121
- mul = self.int_op(type, res, rhs, IntOp.MUL, line)
2122
- mul_eq = self.add(ComparisonOp(mul, lhs, ComparisonOp.EQ, line))
2123
- self.add(Branch(mul_eq, done, adjust, Branch.BOOL))
2124
- self.activate_block(adjust)
2125
- adj = self.int_op(type, res, Integer(1, type), IntOp.SUB, line)
2126
- self.add(Assign(res, adj))
2127
- self.add(Goto(done))
2128
- self.activate_block(done)
2129
- return res
2130
-
2131
- def inline_fixed_width_mod(self, type: RType, lhs: Value, rhs: Value, line: int) -> Value:
2132
- # Perform floor modulus
2133
- res = Register(type)
2134
- mod = self.int_op(type, lhs, rhs, IntOp.MOD, line)
2135
- self.add(Assign(res, mod))
2136
- same_signs = self.is_same_native_int_signs(type, lhs, rhs, line)
2137
- tricky, adjust, done = BasicBlock(), BasicBlock(), BasicBlock()
2138
- self.add(Branch(same_signs, done, tricky, Branch.BOOL))
2139
- self.activate_block(tricky)
2140
- is_zero = self.add(ComparisonOp(res, Integer(0, type), ComparisonOp.EQ, line))
2141
- self.add(Branch(is_zero, done, adjust, Branch.BOOL))
2142
- self.activate_block(adjust)
2143
- adj = self.int_op(type, res, rhs, IntOp.ADD, line)
2144
- self.add(Assign(res, adj))
2145
- self.add(Goto(done))
2146
- self.activate_block(done)
2147
- return res
2148
-
2149
- def is_same_native_int_signs(self, type: RType, a: Value, b: Value, line: int) -> Value:
2150
- neg1 = self.add(ComparisonOp(a, Integer(0, type), ComparisonOp.SLT, line))
2151
- neg2 = self.add(ComparisonOp(b, Integer(0, type), ComparisonOp.SLT, line))
2152
- return self.add(ComparisonOp(neg1, neg2, ComparisonOp.EQ, line))
2153
-
2154
- def is_same_float_signs(self, a: Value, b: Value, line: int) -> Value:
2155
- neg1 = self.add(FloatComparisonOp(a, Float(0.0), FloatComparisonOp.LT, line))
2156
- neg2 = self.add(FloatComparisonOp(b, Float(0.0), FloatComparisonOp.LT, line))
2157
- return self.add(ComparisonOp(neg1, neg2, ComparisonOp.EQ, line))
2158
-
2159
- def comparison_op(self, lhs: Value, rhs: Value, op: int, line: int) -> Value:
2160
- return self.add(ComparisonOp(lhs, rhs, op, line))
2161
-
2162
- def builtin_len(self, val: Value, line: int, use_pyssize_t: bool = False) -> Value:
2163
- """Generate len(val).
2164
-
2165
- Return short_int_rprimitive by default.
2166
- Return c_pyssize_t if use_pyssize_t is true (unshifted).
2167
- """
2168
- typ = val.type
2169
- size_value = None
2170
- if is_list_rprimitive(typ) or is_tuple_rprimitive(typ) or is_bytes_rprimitive(typ):
2171
- size_value = self.primitive_op(var_object_size, [val], line)
2172
- elif is_set_rprimitive(typ):
2173
- elem_address = self.add(GetElementPtr(val, PySetObject, "used"))
2174
- size_value = self.add(LoadMem(c_pyssize_t_rprimitive, elem_address))
2175
- self.add(KeepAlive([val]))
2176
- elif is_dict_rprimitive(typ):
2177
- size_value = self.call_c(dict_ssize_t_size_op, [val], line)
2178
- elif is_str_rprimitive(typ):
2179
- size_value = self.call_c(str_ssize_t_size_op, [val], line)
2180
-
2181
- if size_value is not None:
2182
- if use_pyssize_t:
2183
- return size_value
2184
- offset = Integer(1, c_pyssize_t_rprimitive, line)
2185
- return self.int_op(short_int_rprimitive, size_value, offset, IntOp.LEFT_SHIFT, line)
2186
-
2187
- if isinstance(typ, RInstance):
2188
- # TODO: Support use_pyssize_t
2189
- assert not use_pyssize_t
2190
- length = self.gen_method_call(val, "__len__", [], int_rprimitive, line)
2191
- length = self.coerce(length, int_rprimitive, line)
2192
- ok, fail = BasicBlock(), BasicBlock()
2193
- cond = self.binary_op(length, Integer(0), ">=", line)
2194
- self.add_bool_branch(cond, ok, fail)
2195
- self.activate_block(fail)
2196
- self.add(
2197
- RaiseStandardError(
2198
- RaiseStandardError.VALUE_ERROR, "__len__() should return >= 0", line
2199
- )
2200
- )
2201
- self.add(Unreachable())
2202
- self.activate_block(ok)
2203
- return length
2204
-
2205
- # generic case
2206
- if use_pyssize_t:
2207
- return self.call_c(generic_ssize_t_len_op, [val], line)
2208
- else:
2209
- return self.call_c(generic_len_op, [val], line)
2210
-
2211
- def new_tuple(self, items: list[Value], line: int) -> Value:
2212
- size: Value = Integer(len(items), c_pyssize_t_rprimitive)
2213
- return self.call_c(new_tuple_op, [size] + items, line)
2214
-
2215
- def new_tuple_with_length(self, length: Value, line: int) -> Value:
2216
- """This function returns an uninitialized tuple.
2217
-
2218
- If the length is non-zero, the caller must initialize the tuple, before
2219
- it can be made visible to user code -- otherwise the tuple object is broken.
2220
- You might need further initialization with `new_tuple_set_item_op` op.
2221
-
2222
- Args:
2223
- length: desired length of the new tuple. The rtype should be
2224
- c_pyssize_t_rprimitive
2225
- line: line number
2226
- """
2227
- return self.call_c(new_tuple_with_length_op, [length], line)
2228
-
2229
- def int_to_float(self, n: Value, line: int) -> Value:
2230
- return self.call_c(int_to_float_op, [n], line)
2231
-
2232
- # Internal helpers
2233
-
2234
- def decompose_union_helper(
2235
- self,
2236
- obj: Value,
2237
- rtype: RUnion,
2238
- result_type: RType,
2239
- process_item: Callable[[Value], Value],
2240
- line: int,
2241
- ) -> Value:
2242
- """Generate isinstance() + specialized operations for union items.
2243
-
2244
- Say, for Union[A, B] generate ops resembling this (pseudocode):
2245
-
2246
- if isinstance(obj, A):
2247
- result = <result of process_item(cast(A, obj)>
2248
- else:
2249
- result = <result of process_item(cast(B, obj)>
2250
-
2251
- Args:
2252
- obj: value with a union type
2253
- rtype: the union type
2254
- result_type: result of the operation
2255
- process_item: callback to generate op for a single union item (arg is coerced
2256
- to union item type)
2257
- line: line number
2258
- """
2259
- # TODO: Optimize cases where a single operation can handle multiple union items
2260
- # (say a method is implemented in a common base class)
2261
- fast_items = []
2262
- rest_items = []
2263
- for item in rtype.items:
2264
- if isinstance(item, RInstance):
2265
- fast_items.append(item)
2266
- else:
2267
- # For everything but RInstance we fall back to C API
2268
- rest_items.append(item)
2269
- exit_block = BasicBlock()
2270
- result = Register(result_type)
2271
- for i, item in enumerate(fast_items):
2272
- more_types = i < len(fast_items) - 1 or rest_items
2273
- if more_types:
2274
- # We are not at the final item so we need one more branch
2275
- op = self.isinstance_native(obj, item.class_ir, line)
2276
- true_block, false_block = BasicBlock(), BasicBlock()
2277
- self.add_bool_branch(op, true_block, false_block)
2278
- self.activate_block(true_block)
2279
- coerced = self.coerce(obj, item, line)
2280
- temp = process_item(coerced)
2281
- temp2 = self.coerce(temp, result_type, line)
2282
- self.add(Assign(result, temp2))
2283
- self.goto(exit_block)
2284
- if more_types:
2285
- self.activate_block(false_block)
2286
- if rest_items:
2287
- # For everything else we use generic operation. Use force=True to drop the
2288
- # union type.
2289
- coerced = self.coerce(obj, object_rprimitive, line, force=True)
2290
- temp = process_item(coerced)
2291
- temp2 = self.coerce(temp, result_type, line)
2292
- self.add(Assign(result, temp2))
2293
- self.goto(exit_block)
2294
- self.activate_block(exit_block)
2295
- return result
2296
-
2297
- def translate_special_method_call(
2298
- self,
2299
- base_reg: Value,
2300
- name: str,
2301
- args: list[Value],
2302
- result_type: RType | None,
2303
- line: int,
2304
- can_borrow: bool = False,
2305
- ) -> Value | None:
2306
- """Translate a method call which is handled nongenerically.
2307
-
2308
- These are special in the sense that we have code generated specifically for them.
2309
- They tend to be method calls which have equivalents in C that are more direct
2310
- than calling with the PyObject api.
2311
-
2312
- Return None if no translation found; otherwise return the target register.
2313
- """
2314
- call_c_ops_candidates = method_call_ops.get(name, [])
2315
- call_c_op = self.matching_call_c(
2316
- call_c_ops_candidates, [base_reg] + args, line, result_type, can_borrow=can_borrow
2317
- )
2318
- return call_c_op
2319
-
2320
- def translate_eq_cmp(self, lreg: Value, rreg: Value, expr_op: str, line: int) -> Value | None:
2321
- """Add a equality comparison operation.
2322
-
2323
- Args:
2324
- expr_op: either '==' or '!='
2325
- """
2326
- ltype = lreg.type
2327
- rtype = rreg.type
2328
- if not (isinstance(ltype, RInstance) and ltype == rtype):
2329
- return None
2330
-
2331
- class_ir = ltype.class_ir
2332
- # Check whether any subclasses of the operand redefines __eq__
2333
- # or it might be redefined in a Python parent class or by
2334
- # dataclasses
2335
- cmp_varies_at_runtime = (
2336
- not class_ir.is_method_final("__eq__")
2337
- or not class_ir.is_method_final("__ne__")
2338
- or class_ir.inherits_python
2339
- or class_ir.is_augmented
2340
- )
2341
-
2342
- if cmp_varies_at_runtime:
2343
- # We might need to call left.__eq__(right) or right.__eq__(left)
2344
- # depending on which is the more specific type.
2345
- return None
2346
-
2347
- if not class_ir.has_method("__eq__"):
2348
- # There's no __eq__ defined, so just use object identity.
2349
- identity_ref_op = "is" if expr_op == "==" else "is not"
2350
- return self.translate_is_op(lreg, rreg, identity_ref_op, line)
2351
-
2352
- return self.gen_method_call(lreg, op_methods[expr_op], [rreg], ltype, line)
2353
-
2354
- def translate_is_op(self, lreg: Value, rreg: Value, expr_op: str, line: int) -> Value:
2355
- """Create equality comparison operation between object identities
2356
-
2357
- Args:
2358
- expr_op: either 'is' or 'is not'
2359
- """
2360
- op = ComparisonOp.EQ if expr_op == "is" else ComparisonOp.NEQ
2361
- lhs = self.coerce(lreg, object_rprimitive, line)
2362
- rhs = self.coerce(rreg, object_rprimitive, line)
2363
- return self.add(ComparisonOp(lhs, rhs, op, line))
2364
-
2365
- def _create_dict(self, keys: list[Value], values: list[Value], line: int) -> Value:
2366
- """Create a dictionary(possibly empty) using keys and values"""
2367
- # keys and values should have the same number of items
2368
- size = len(keys)
2369
- if size > 0:
2370
- size_value: Value = Integer(size, c_pyssize_t_rprimitive)
2371
- # merge keys and values
2372
- items = [i for t in list(zip(keys, values)) for i in t]
2373
- return self.call_c(dict_build_op, [size_value] + items, line)
2374
- else:
2375
- return self.call_c(dict_new_op, [], line)
2376
-
2377
- def error(self, msg: str, line: int) -> None:
2378
- assert self.errors is not None, "cannot generate errors in this compiler phase"
2379
- self.errors.error(msg, self.module_path, line)
2380
-
2381
-
2382
- def num_positional_args(arg_values: list[Value], arg_kinds: list[ArgKind] | None) -> int:
2383
- if arg_kinds is None:
2384
- return len(arg_values)
2385
- num_pos = 0
2386
- for kind in arg_kinds:
2387
- if kind == ARG_POS:
2388
- num_pos += 1
2389
- return num_pos