jaclang 0.7.14__py3-none-any.whl → 0.7.15__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 (43) hide show
  1. jaclang/cli/cli.py +11 -8
  2. jaclang/cli/cmdreg.py +9 -12
  3. jaclang/compiler/__init__.py +0 -2
  4. jaclang/compiler/absyntree.py +3 -8
  5. jaclang/compiler/passes/ir_pass.py +3 -12
  6. jaclang/compiler/passes/main/fuse_typeinfo_pass.py +4 -5
  7. jaclang/compiler/passes/main/import_pass.py +4 -2
  8. jaclang/compiler/passes/main/pyast_gen_pass.py +32 -31
  9. jaclang/compiler/passes/main/registry_pass.py +1 -1
  10. jaclang/compiler/passes/tool/jac_formatter_pass.py +3 -20
  11. jaclang/compiler/passes/transform.py +4 -0
  12. jaclang/compiler/semtable.py +5 -3
  13. jaclang/compiler/tests/test_importer.py +3 -0
  14. jaclang/langserve/engine.py +210 -69
  15. jaclang/langserve/server.py +6 -10
  16. jaclang/langserve/tests/fixtures/base_module_structure.jac +1 -1
  17. jaclang/langserve/tests/fixtures/import_include_statements.jac +1 -1
  18. jaclang/langserve/tests/test_sem_tokens.py +277 -0
  19. jaclang/langserve/tests/test_server.py +4 -4
  20. jaclang/langserve/utils.py +128 -95
  21. jaclang/plugin/builtin.py +1 -1
  22. jaclang/plugin/default.py +23 -16
  23. jaclang/plugin/feature.py +4 -5
  24. jaclang/plugin/spec.py +2 -2
  25. jaclang/{core → runtimelib}/architype.py +1 -1
  26. jaclang/{core → runtimelib}/context.py +4 -1
  27. jaclang/runtimelib/importer.py +414 -0
  28. jaclang/runtimelib/machine.py +19 -0
  29. jaclang/{core → runtimelib}/utils.py +1 -1
  30. jaclang/tests/fixtures/deep/one_lev.jac +3 -3
  31. jaclang/tests/fixtures/deep/one_lev_dup.jac +2 -3
  32. jaclang/tests/test_cli.py +1 -1
  33. jaclang/tests/test_language.py +7 -0
  34. jaclang/utils/treeprinter.py +0 -4
  35. {jaclang-0.7.14.dist-info → jaclang-0.7.15.dist-info}/METADATA +1 -1
  36. {jaclang-0.7.14.dist-info → jaclang-0.7.15.dist-info}/RECORD +42 -40
  37. jaclang/core/importer.py +0 -344
  38. /jaclang/{core → runtimelib}/__init__.py +0 -0
  39. /jaclang/{core → runtimelib}/constructs.py +0 -0
  40. /jaclang/{core → runtimelib}/memory.py +0 -0
  41. /jaclang/{core → runtimelib}/test.py +0 -0
  42. {jaclang-0.7.14.dist-info → jaclang-0.7.15.dist-info}/WHEEL +0 -0
  43. {jaclang-0.7.14.dist-info → jaclang-0.7.15.dist-info}/entry_points.txt +0 -0
@@ -2,30 +2,30 @@ jaclang/__init__.py,sha256=quKqbhKk5CQ0k798jIXMbeAKzQxD0yhOpQGSvYD6TD8,399
2
2
  jaclang/cli/.gitignore,sha256=NYuons2lzuCpCdefMnztZxeSMgtPVJF6R6zSgVDOV20,27
3
3
  jaclang/cli/__init__.py,sha256=7aaPgYddIAHBvkdv36ngbfwsimMnfGaTDcaHYMg_vf4,23
4
4
  jaclang/cli/cli.md,sha256=4BPJGdcyvs_rXgd_DPEGjkKSGe5ureXXYaQsf-_z_LU,5939
5
- jaclang/cli/cli.py,sha256=tBAUZkY5x8rPCWGbTHDlu4mnAXEThrjCk_K7pFYfWzg,13911
6
- jaclang/cli/cmdreg.py,sha256=u0jAd6A8czt7tBgPBBKBhYAG4By1FrjEGaTU2XFKeYs,8372
5
+ jaclang/cli/cli.py,sha256=MVWy7AWBWzLx8Uc98_tw81YNQdGjmKl_y4bz7gp6jv0,14072
6
+ jaclang/cli/cmdreg.py,sha256=5mhzLJnpHfc0Z22qKQgcEOICgBaC95G9gSJZ-R7GqvU,8282
7
7
  jaclang/compiler/.gitignore,sha256=n1k2_xXTorp9PY8hhYM4psHircn-NMaFx95bSgDKopo,10
8
- jaclang/compiler/__init__.py,sha256=P8h-q53h-MTK8Wmvpb7sP5R6Ojz94Y2F9nqMwIUt0d4,3064
9
- jaclang/compiler/absyntree.py,sha256=9fFGMNZNwUiwOSxyR8v7I5IX4gHvpyBWC0shvOE585w,135093
8
+ jaclang/compiler/__init__.py,sha256=bQE2z6wyuMqhPI31QYEBq__2fSrAtcKThjBRkTSwnPA,3038
9
+ jaclang/compiler/absyntree.py,sha256=fjNGlj0gqUMJhxy6jbbC2J-NlrrZPaRICcRgbYIqiJs,134966
10
10
  jaclang/compiler/codeloc.py,sha256=YhJcHjhMCOT6mV1qLehwriuFgW0H2-ntq68k_r8yBs4,2800
11
11
  jaclang/compiler/compile.py,sha256=0d8p4i2LXg2RCu1XfWx_Jq_dx7pK2Zn2VIj-apvX_nI,3389
12
12
  jaclang/compiler/constant.py,sha256=n4KaEkvnb9-KVJJVvxiWimhjbrOiknBvLHAVDBFbF7Y,8991
13
13
  jaclang/compiler/jac.lark,sha256=Vu14pEa9HObGQCHCGFhIdq__yA3W0-cKAX53NZc--xM,17204
14
14
  jaclang/compiler/parser.py,sha256=T7ntURGUAEtOi7nTRSBER5Nkh7SxeNxoerYmnFFsAFc,140448
15
15
  jaclang/compiler/passes/__init__.py,sha256=0Tw0d130ZjzA05jVcny9cf5NfLjlaM70PKqFnY4zqn4,69
16
- jaclang/compiler/passes/ir_pass.py,sha256=rNB3aHffPkX6HOeVAZgXwabNY1t9dWFr1xp6XgfNSok,5823
16
+ jaclang/compiler/passes/ir_pass.py,sha256=KMlrp2aLcUjoHw55p-h8d1Fg5w71GBj7mMqRoBjkAlc,5553
17
17
  jaclang/compiler/passes/main/__init__.py,sha256=YSWVNkgnJKF32LpJwX__FwvYrpTSoxFqvnw410WrhkA,947
18
18
  jaclang/compiler/passes/main/access_modifier_pass.py,sha256=fvmvU_V72Zby8fiBnVESinAYFII5qJWKYXtmn4JAChA,5140
19
19
  jaclang/compiler/passes/main/def_impl_match_pass.py,sha256=yAkwLQm2NBJycJVSmG88Shq0r2GSxTH8goINDfGIHek,4583
20
20
  jaclang/compiler/passes/main/def_use_pass.py,sha256=68Uts_v-R-9mzBXC9EfXpcBEQwqnVcpL2JD0sri88AY,9674
21
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py,sha256=-Ubaxk_5Tm4e09pDiTk0U-vZqUIZRzffLBw4yT2pOVo,18187
22
- jaclang/compiler/passes/main/import_pass.py,sha256=TEiysRX_86tqSx4Ot-SPMTYYDik3pnWxHh6wwCvz5Cg,10974
23
- jaclang/compiler/passes/main/pyast_gen_pass.py,sha256=xvcbAtng5SqXt5Aru_CFBkRkatGQzPIDr-uWbTgZcA0,151725
21
+ jaclang/compiler/passes/main/fuse_typeinfo_pass.py,sha256=0zuBLMDj-EYzBfWVqJNoM3nXfh4NvI8F22xIYGkSZ8s,18166
22
+ jaclang/compiler/passes/main/import_pass.py,sha256=fFMbJCcF_JXm6olmRHzr2Xi31y46opBFKSKL6tPC_zU,10982
23
+ jaclang/compiler/passes/main/pyast_gen_pass.py,sha256=HJWsF_aEArFCz7G0sZHRQ2vlym5WLotBGRxCfQHfKVQ,152061
24
24
  jaclang/compiler/passes/main/pyast_load_pass.py,sha256=NzMwqYLbKLQha8McmTM3HT5ytk_e8xQVMHgIPbzYQd4,93266
25
25
  jaclang/compiler/passes/main/pybc_gen_pass.py,sha256=CjA9AqyMO3Pv_b5Hh0YI6JmCqIru2ASonO6rhrkau-M,1336
26
26
  jaclang/compiler/passes/main/pyjac_ast_link_pass.py,sha256=dnx_MvrVIks9hpUbiF2m3ao_xrfCwPajPJec7Bis_bA,8338
27
27
  jaclang/compiler/passes/main/pyout_pass.py,sha256=QWVB-AyVBha3OespP89LMuslRsdG2niZErwtnRPiURM,3191
28
- jaclang/compiler/passes/main/registry_pass.py,sha256=yc5ua5iyYTGizJewhP-AcXKvDZ0ilzy9hH1MIQzsy_0,4573
28
+ jaclang/compiler/passes/main/registry_pass.py,sha256=1KdkX1WA5PSeBjPL2mhjox9GEk8iMWJlexg-gpF4_x8,4579
29
29
  jaclang/compiler/passes/main/schedules.py,sha256=cu3-AIckvbKGe3C-DbtDwwAdvnX25CdDP6j9QLps9Kg,1298
30
30
  jaclang/compiler/passes/main/sub_node_tab_pass.py,sha256=25HEJGBbDlJibyW5MV4ShXQ2vmzG3LDreknV-u2nQjk,1184
31
31
  jaclang/compiler/passes/main/sym_tab_build_pass.py,sha256=_EYyPOS2_CMgO2znCJck3NLgg6kx7lfiQGhY3Fy9JnI,34689
@@ -65,7 +65,7 @@ jaclang/compiler/passes/main/tests/test_typeinfo_pass.py,sha256=ehC0_giLg7NwB7fR
65
65
  jaclang/compiler/passes/main/type_check_pass.py,sha256=oPXSlTkxPge8H5fvKpFt80V_5ft5It56wLftG7HjS2Y,3458
66
66
  jaclang/compiler/passes/tool/__init__.py,sha256=xekCOXysHIcthWm8NRmQoA1Ah1XV8vFbkfeHphJtUdc,223
67
67
  jaclang/compiler/passes/tool/fuse_comments_pass.py,sha256=CSnuWy4gZfTcWKe0Q7LBikBgWe1zJr0QmNUkgrZ7B38,3657
68
- jaclang/compiler/passes/tool/jac_formatter_pass.py,sha256=yHqHjjCj08BN8kBqpA2rTcNL33Nl3SqqRyJpEIDw83o,87880
68
+ jaclang/compiler/passes/tool/jac_formatter_pass.py,sha256=tI9crvlxvU-a0K3uF3F8uRMQZYb2VpUN7mgy0TzPW-g,87106
69
69
  jaclang/compiler/passes/tool/schedules.py,sha256=kmbsCazAMizGAdQuZpFky5BPlYlMXqNw7wOUzdi_wBo,432
70
70
  jaclang/compiler/passes/tool/tests/__init__.py,sha256=AeOaZjA1rf6VAr0JqIit6jlcmOzW7pxGr4U1fOwgK_Y,24
71
71
  jaclang/compiler/passes/tool/tests/fixtures/corelib.jac,sha256=fNJJWnT_MiyYuN0exec1JTAkh4VKkAcEPFtFYLw3JKk,12712
@@ -101,10 +101,10 @@ jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac,sha256=6jwYKXxJ1
101
101
  jaclang/compiler/passes/tool/tests/test_fuse_comments_pass.py,sha256=ZeWHsm7VIyyS8KKpoB2SdlHM4jF22fMfSrfTfxt2MQw,398
102
102
  jaclang/compiler/passes/tool/tests/test_jac_format_pass.py,sha256=AKGBEz02bS9REJuryZlPvY2avE_XWqKV8sRrnh5hu2g,6101
103
103
  jaclang/compiler/passes/tool/tests/test_unparse_validate.py,sha256=rySW9ppDvnOqgF_B6kC4qRvXwfGErs6rOGXl4iULw-U,2674
104
- jaclang/compiler/passes/transform.py,sha256=GEHK3zFWrEjbAQ3mIl3D59jBuIrA8DRbw9t_IlUqg3M,2297
104
+ jaclang/compiler/passes/transform.py,sha256=h84ZfyctT_hKVvGtFeO87vqN6p50DqJh94Dk827Alw8,2394
105
105
  jaclang/compiler/passes/utils/__init__.py,sha256=UsI5rUopTUiStAzup4kbPwIwrnC5ofCrqWBCBbM2-k4,35
106
106
  jaclang/compiler/passes/utils/mypy_ast_build.py,sha256=aPvvdGSwbOGHYiK5kY665bqtfjj7s2YfTONV4EuLai8,26162
107
- jaclang/compiler/semtable.py,sha256=tW0vY1N377w_WgKalqXe2VR8FJDwd9CpI6jDJi1jhEU,4152
107
+ jaclang/compiler/semtable.py,sha256=S7AJbuOGzjcBkgh2Cipz6bVqNTw2HvMvxcB7NlLnhRw,4212
108
108
  jaclang/compiler/symtable.py,sha256=oYdYS1PUnNCGPPZsZZOduiDtTYyLVd6tXWAoUyCupUc,9275
109
109
  jaclang/compiler/tests/__init__.py,sha256=qiXa5UNRBanGOcplFKTT9a_9GEyiv7goq1OzuCjDCFE,27
110
110
  jaclang/compiler/tests/fixtures/__init__.py,sha256=udQ0T6rajpW_nMiYKJNckqP8izZ-pH3P4PNTJEln2NU,36
@@ -115,22 +115,14 @@ jaclang/compiler/tests/fixtures/kwesc.jac,sha256=OXxVL_fwiFuvYO1YX1RHa2hpETSpb0Q
115
115
  jaclang/compiler/tests/fixtures/mod_doc_test.jac,sha256=aFZpjn7V5lvCHp0lPoGXtdkcY3CK8_-SKeZGruutv4Y,35
116
116
  jaclang/compiler/tests/fixtures/staticcheck.jac,sha256=t849--dTkSSjCJX1OiMV-lgao_hIDSKwKVs-aS6IwK8,342
117
117
  jaclang/compiler/tests/fixtures/stuff.jac,sha256=qOq6WOwhlprMmJpiqQudgqnr4qTd9uhulQSDGQ3o6sY,82
118
- jaclang/compiler/tests/test_importer.py,sha256=U8rji5DQc-AKLH8JJGW4UZcb7AzC0qdfIGDtjNXbl2I,1742
118
+ jaclang/compiler/tests/test_importer.py,sha256=OehpSN7_s0mbwJWz3OwRyxkSqBXAumiftzskQGzbEAc,1949
119
119
  jaclang/compiler/tests/test_parser.py,sha256=Sj9Kz1FghESaPpyx_kEvScs4xvz-vgEdH8yyQJ0iB7M,4820
120
- jaclang/core/__init__.py,sha256=jDDYBCV82qPhmcDVk3NIvHbhng0ebSrXD3xrojg0-eo,34
121
- jaclang/core/architype.py,sha256=qBH0W-ALxmK6DALc4_S7gx-3R7C_6o-PGKb3f4RbWbE,16781
122
- jaclang/core/constructs.py,sha256=ogWc95DEZxQWoxqsfbRrcmt9ldGDqW7zQVu3DWuIAKs,848
123
- jaclang/core/context.py,sha256=AxGsra9EqokVdOhwIxR9RuAcnm0HmobUnMBezUBY1_s,4774
124
- jaclang/core/importer.py,sha256=Rj7OzuwSAn-ig5pdFhqgjb5H5KyC8YFcur4VAyk1qLI,12712
125
- jaclang/core/memory.py,sha256=7QukfL6wDBXrdpRn01yu4RMNkmIMNqFiKrI0zfpGSy4,2947
126
- jaclang/core/test.py,sha256=HRCl3cf0uPTe58Kcx_sBUb6ow8J53rnmpFOhA7g9oAA,2851
127
- jaclang/core/utils.py,sha256=uzEsRSuNSMMo7dlvCozGv0TnpUmHEjGNzUTZt1Df2gQ,7741
128
120
  jaclang/langserve/__init__.py,sha256=3qbnivBBcLZCfmDYRMIeKkG08Lx7XQsJJg-qG8TU8yc,51
129
- jaclang/langserve/engine.py,sha256=4hyu5etdKqLtC8DphxozspYlEZ6GcDcQMmR2_d2l4M4,18766
130
- jaclang/langserve/server.py,sha256=CyvVmj4G0Y6mJZNxpUDd7dKUm6pvBXZ2mh_DfQ0kI_Y,4968
121
+ jaclang/langserve/engine.py,sha256=-RnqaUA6HsJVpYSTiJQeL6I7EbpAaHCyknarr1jTLBs,25363
122
+ jaclang/langserve/server.py,sha256=ay9DlsZY1JKPBWlPLKV7uFoeNerzLdhGcj1CzNr3k-o,4791
131
123
  jaclang/langserve/tests/__init__.py,sha256=iDM47k6c3vahaWhwxpbkdEOshbmX-Zl5x669VONjS2I,23
132
124
  jaclang/langserve/tests/defaults.py,sha256=8UWHuCHY-WatPcWFhyX9-4KLuJgODTlLNj0wNnKomIM,7608
133
- jaclang/langserve/tests/fixtures/base_module_structure.jac,sha256=87xx2Gmp0VtJmBFXY8xU50CVwWdSMVNM8uuRRv-n6A0,1009
125
+ jaclang/langserve/tests/fixtures/base_module_structure.jac,sha256=1cwJIhkm_6OJoUTOGOpiUpU2V2axhcidz_hQcHWFrkk,1010
134
126
  jaclang/langserve/tests/fixtures/circle.jac,sha256=AWzRxTBjvQwoLSOakjn0kKXWqKvDaUYGc1zmBk1Nd5c,1770
135
127
  jaclang/langserve/tests/fixtures/circle_err.jac,sha256=T22UiWpKJy6IhS-y0DrrZJMz95-8SAZnRAQUmT_kxO4,1732
136
128
  jaclang/langserve/tests/fixtures/circle_pure.impl.jac,sha256=rsXatY9a-wZONRPJ6VOuw7Bj9R_CrJO_TEwAVXj1PjU,702
@@ -139,7 +131,7 @@ jaclang/langserve/tests/fixtures/circle_pure.test.jac,sha256=QiOAUZ5xXPKDx_QQRCZ
139
131
  jaclang/langserve/tests/fixtures/circle_pure_err.impl.jac,sha256=rsXatY9a-wZONRPJ6VOuw7Bj9R_CrJO_TEwAVXj1PjU,702
140
132
  jaclang/langserve/tests/fixtures/circle_pure_err.jac,sha256=jQ5QX0G5khGACoY82CM-6LcOX57w4e29tHVicE2eMgw,608
141
133
  jaclang/langserve/tests/fixtures/hello.jac,sha256=iRMKtYVCw1zLvjOQbj3q__3Manj1Di1YeDTNMEvYtBc,36
142
- jaclang/langserve/tests/fixtures/import_include_statements.jac,sha256=LRbhmpNQagZCcF3aGaAhlaDYplnXbSRbtTlBVmoXxtA,300
134
+ jaclang/langserve/tests/fixtures/import_include_statements.jac,sha256=C7aW24QodYRHB0czqvpEZwR4A60ktYa4pGNWNXisL7s,300
143
135
  jaclang/langserve/tests/fixtures/py_import.py,sha256=BvNimsRmsbJWd-JNM31oJpl52bYvSdfQ6Np3DJNt7d0,320
144
136
  jaclang/langserve/tests/pylsp_jsonrpc/__init__.py,sha256=bDWxRjmELPCVGy243_0kNrG7PttyZsv_eZ9JTKQrU1E,105
145
137
  jaclang/langserve/tests/pylsp_jsonrpc/dispatchers.py,sha256=zEZWu6C2_n4lPoA8H8OO67746P93VhbYaXZMdtrD8Z0,1038
@@ -147,13 +139,14 @@ jaclang/langserve/tests/pylsp_jsonrpc/endpoint.py,sha256=TxDpWUd-8AGJwdRQN_iiCXY
147
139
  jaclang/langserve/tests/pylsp_jsonrpc/exceptions.py,sha256=NGHeFQawZcjoLUcgDmY3bF7BqZR83g7TmdKyzCmRaKM,2836
148
140
  jaclang/langserve/tests/pylsp_jsonrpc/streams.py,sha256=R80_FvICIkrbdGmNtlemWYaxrr7-XldPgLaASnyv0W8,3332
149
141
  jaclang/langserve/tests/session.py,sha256=3pIRoQjZnsnUWIYnO2SpK7c1PAiHMCFrrStNK2tawRM,9572
150
- jaclang/langserve/tests/test_server.py,sha256=zKxPkEdjowpfyCepzBzI7fkVUJCjEJIgBI4l1QVv1vw,12156
151
- jaclang/langserve/utils.py,sha256=gmN_2tdtavccNxNMjbCLdbde0pF_GDMB1aGUK27JqfE,19133
142
+ jaclang/langserve/tests/test_sem_tokens.py,sha256=zWoczkMfBBS9o9caeru359GmFfAksqaF3IWK4nl0uFw,9886
143
+ jaclang/langserve/tests/test_server.py,sha256=3Tq_pH4KNA4UXCMLCs2RjqRN7j-oZTJ9yz8_viBB4eY,12159
144
+ jaclang/langserve/utils.py,sha256=sZJkgZcuid6uO0eSgDmNVvJp63OBlpBHEyWfW5g5OfQ,20138
152
145
  jaclang/plugin/__init__.py,sha256=5t2krHKt_44PrCTGojzxEimxpNHYVQcn89jAiCSXE_k,165
153
- jaclang/plugin/builtin.py,sha256=MEMPUnj_rlwcCNmUkfH5S8iazMnQ6fpp6tls4fh5z7k,1188
154
- jaclang/plugin/default.py,sha256=1jrpQ-irbFrh38WX9_q2jHtgdFruIzryCfmD6mwkgV4,23761
155
- jaclang/plugin/feature.py,sha256=HJQjdUKPy0v1ypga4dj3KfIQDoc_TWo9qCwqHykgxbU,9802
156
- jaclang/plugin/spec.py,sha256=ov7iTMHL93VqM_m_n1LLwrQQFCmTbqDbocE_emk8-fI,8903
146
+ jaclang/plugin/builtin.py,sha256=zAypgY6GemiCmbFUyhj9g_0qNyQFLnDPHGlZ0BuA3RE,1194
147
+ jaclang/plugin/default.py,sha256=mEwDG7MYvuG-ddk7S_gMSy7Ojg2l0PUqJWr2yb5vr38,24060
148
+ jaclang/plugin/feature.py,sha256=dWMDgR5VjPXz60ypuqenmuRgKvbVP2tREU93arnDPRA,9813
149
+ jaclang/plugin/spec.py,sha256=SirNgIlzsGo4CMtRcwb36dMArDKEQapKmQNAmZjWdxU,8915
157
150
  jaclang/plugin/tests/__init__.py,sha256=rn_tNG8jCHWwBc_rx4yFkGc4N1GISb7aPuTFVRTvrTk,38
158
151
  jaclang/plugin/tests/fixtures/impl_match.jac,sha256=WEhcA1GlovusITEFO2bOjYYqiiULyYGKhM17uK2GqnI,91
159
152
  jaclang/plugin/tests/fixtures/impl_match_impl.jac,sha256=k1385r7Hdlq6mUKxEHa3VOKJUIWH08hYg2kErhbYwFM,31
@@ -162,6 +155,15 @@ jaclang/plugin/tests/fixtures/simple_persistent.jac,sha256=o0TZTOJEZjFW8A2IGY8IC
162
155
  jaclang/plugin/tests/test_features.py,sha256=p0N5inZn92Cj0eqslmDR0-q6pVG8hkcQfA6CuQcfP3Y,2352
163
156
  jaclang/plugin/tests/test_jaseci.py,sha256=XcVL-FOZMTsjJEZqCa-rcYyEPl1dxdFFu9vhvm8kUaI,7956
164
157
  jaclang/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
+ jaclang/runtimelib/__init__.py,sha256=jDDYBCV82qPhmcDVk3NIvHbhng0ebSrXD3xrojg0-eo,34
159
+ jaclang/runtimelib/architype.py,sha256=UPcwYNkFQaewPrywTIYUT0DWm7I_V0kmFfQ8LamvZdY,16787
160
+ jaclang/runtimelib/constructs.py,sha256=ogWc95DEZxQWoxqsfbRrcmt9ldGDqW7zQVu3DWuIAKs,848
161
+ jaclang/runtimelib/context.py,sha256=EohVnWpidtQJf2i_KEIZobIC_QfgzHdfZ3SyurJzEY0,4916
162
+ jaclang/runtimelib/importer.py,sha256=0Ckc0IQE24A5uj9BbEKdJPRcSw_HwSk5eib8S4NJGIY,16225
163
+ jaclang/runtimelib/machine.py,sha256=X8QBBoVspXzg0yfgI3xeHFms_ztvj0Bx8XLSzWJooto,576
164
+ jaclang/runtimelib/memory.py,sha256=7QukfL6wDBXrdpRn01yu4RMNkmIMNqFiKrI0zfpGSy4,2947
165
+ jaclang/runtimelib/test.py,sha256=HRCl3cf0uPTe58Kcx_sBUb6ow8J53rnmpFOhA7g9oAA,2851
166
+ jaclang/runtimelib/utils.py,sha256=yXaHevMzs8nLqW6xuQHHL-3zW75yzDXhdGT0ZLUDU_o,7747
165
167
  jaclang/settings.py,sha256=woT2v-xh3Mh_haOoefQlRddOYDkalwGGlQJVSvBkmAc,3404
166
168
  jaclang/tests/fixtures/abc.jac,sha256=AWzRxTBjvQwoLSOakjn0kKXWqKvDaUYGc1zmBk1Nd5c,1770
167
169
  jaclang/tests/fixtures/access_checker.jac,sha256=6Inm14cZsyMfezFRs2zfnQEZSE_JRxVvytcZbox7BNw,375
@@ -180,8 +182,8 @@ jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac,sha256=omdlOBM0cuUAHhmx
180
182
  jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac,sha256=YlAclVAukzVeCNbXZU6iTl8Rj1uXpUJ1WR7Ei2vhbqc,252
181
183
  jaclang/tests/fixtures/deep/deeper/snd_lev.jac,sha256=SRp6Ic-MAgjcbYc090TwiFYsoVoJB4sLTA-Y5JPMpp8,82
182
184
  jaclang/tests/fixtures/deep/mycode.jac,sha256=XP6RdZP90ftdhe5vidttgZhjDcsO4S8rbaVC0cG-e0U,47
183
- jaclang/tests/fixtures/deep/one_lev.jac,sha256=HNDYbJQoC6v2on82doqg4L40umfhqlwRCpSAbVL5xOw,229
184
- jaclang/tests/fixtures/deep/one_lev_dup.jac,sha256=ViaR09OgKCfL-ANjELnfg7yhcXW16Oq1qqdpC62qO4E,113
185
+ jaclang/tests/fixtures/deep/one_lev.jac,sha256=EtevkN6ZhO4tl_kZ_r7nWCYh44RPKh9Eo2nPSuqCfWA,234
186
+ jaclang/tests/fixtures/deep/one_lev_dup.jac,sha256=fwe14Xd1dliw_FJrqWXEpqFMEYHkU0nHOd2vFFoV0ng,120
185
187
  jaclang/tests/fixtures/deep/one_lev_dup_py.py,sha256=G2k46o37mPhPSskYw7bYdbdq8r0xXVpNbGPWu2_os14,117
186
188
  jaclang/tests/fixtures/deep_convert.jac,sha256=AWmLuqhM8GlOZ5rP2THREzpIpL9v3L9sZWyx07nkeDE,71
187
189
  jaclang/tests/fixtures/deep_convo.py,sha256=sxU9RYsFIDlsbgNIQv6FBNgQHYEQ0Dwvx1f_qWvfZxE,96
@@ -244,8 +246,8 @@ jaclang/tests/fixtures/type_info.jac,sha256=4Cw31ef5gny6IS0kLzgeSO-7ArEH1HgFFFip
244
246
  jaclang/tests/fixtures/walker_override.jac,sha256=Ok58ZAgxuV6aECNxYrjbbyAWSiqIbnly3N3O6cD563o,271
245
247
  jaclang/tests/fixtures/with_context.jac,sha256=cDA_4YWe5UVmQRgcpktzkZ_zsswQpV_T2Otf_rFnPy8,466
246
248
  jaclang/tests/test_bugs.py,sha256=tBPsIlSPqZDIz4QaScNRT-WdGIdJ0uU-aRBWq1XUZ6o,555
247
- jaclang/tests/test_cli.py,sha256=ytSFNsKu_9FillP7AUMLBT5A6Ms9TGcPWrGrQFq7IV0,8656
248
- jaclang/tests/test_language.py,sha256=jBvfhpfapUB1OoY9mth8GXvxJVVei3P-jN8bvLfFtFA,34826
249
+ jaclang/tests/test_cli.py,sha256=Ea3IIbbqMcscJHtN7JLrMwsl7LPxEavw2xeuS9vwmek,8649
250
+ jaclang/tests/test_language.py,sha256=iws_4UKePGgUXAcE4gd7gSxQbd7NzR8G8ja6N5Wsutc,35276
249
251
  jaclang/tests/test_man_code.py,sha256=ZdNarlZVfT_-8Jv3FjLplHw76tsvkCuISyfX3M4qxPg,5027
250
252
  jaclang/tests/test_reference.py,sha256=FoZQS-U9teiag8mAmX5X6ak4fuCOv00mvOyqJ44Zkc8,3379
251
253
  jaclang/tests/test_settings.py,sha256=TIX5uiu8H9IpZN2__uFiclcdCpBpPpcAwtlEHyFC4kk,1999
@@ -256,7 +258,7 @@ jaclang/utils/log.py,sha256=G8Y_DnETgTh9xzvlW5gh9zqJ1ap4YY_MDTwIMu5Uc0Y,262
256
258
  jaclang/utils/test.py,sha256=l2CrsC0umDn0YKukuAO4oWxjOeeP5QK0LgHxjxCjxkY,5743
257
259
  jaclang/utils/tests/__init__.py,sha256=8uwVqMsc6cxBAM1DuHLuNuTnzLXqOqM-WRa4ixOMF6w,23
258
260
  jaclang/utils/tests/test_lang_tools.py,sha256=hFQzkzdmJIhP99xqjR5z7bqkefMLmE6kwldXYrfK--E,4831
259
- jaclang/utils/treeprinter.py,sha256=7YPWmtU-gHPN37m9eXqVSqjTy7X_xmUVmBaGcn3p5SM,12663
261
+ jaclang/utils/treeprinter.py,sha256=0Sm-rOldGSkF3FUzuzU-sp7qgFclhCZ5tNxm32W_FAI,12430
260
262
  jaclang/vendor/__init__.py,sha256=tEcp2kl3hMvF2d6X6WlJSAGuAMYOVCKCstXuPMQSR4Q,265
261
263
  jaclang/vendor/attr/__init__.py,sha256=WlXJN6ICB0Y_HZ0lmuTUgia0kuSdn2p67d4N6cYxNZM,3307
262
264
  jaclang/vendor/attr/__init__.pyi,sha256=u08EujYHy_rSyebNn-I9Xv2S_cXmtA9xWGc0cBsyl18,16976
@@ -1479,7 +1481,7 @@ jaclang/vendor/typing_extensions-4.12.2.dist-info/METADATA,sha256=BeUQIa8cnYbrjW
1479
1481
  jaclang/vendor/typing_extensions-4.12.2.dist-info/RECORD,sha256=XS4fBVrPI7kaNZ56Ggl2RGa76jySWLqTzcrUpZIQTVM,418
1480
1482
  jaclang/vendor/typing_extensions-4.12.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
1481
1483
  jaclang/vendor/typing_extensions.py,sha256=gwekpyG9DVG3lxWKX4ni8u7nk3We5slG98mA9F3DJQw,134451
1482
- jaclang-0.7.14.dist-info/METADATA,sha256=A77FFse_yDJYy5F_V7yNQIH5bs94ztGxToiPpg-4Eac,4822
1483
- jaclang-0.7.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1484
- jaclang-0.7.14.dist-info/entry_points.txt,sha256=8sMi4Tvi9f8tQDN2QAXsSA2icO27zQ4GgEdph6bNEZM,49
1485
- jaclang-0.7.14.dist-info/RECORD,,
1484
+ jaclang-0.7.15.dist-info/METADATA,sha256=I81V6-hfvkZ9T4VV6ZpaF2NmQO7bVmB4vDJuf_sT5cQ,4822
1485
+ jaclang-0.7.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1486
+ jaclang-0.7.15.dist-info/entry_points.txt,sha256=8sMi4Tvi9f8tQDN2QAXsSA2icO27zQ4GgEdph6bNEZM,49
1487
+ jaclang-0.7.15.dist-info/RECORD,,
jaclang/core/importer.py DELETED
@@ -1,344 +0,0 @@
1
- """Special Imports for Jac Code."""
2
-
3
- import importlib
4
- import marshal
5
- import os
6
- import sys
7
- import types
8
- from os import getcwd, path
9
- from typing import Optional, Union
10
-
11
- from jaclang.compiler.absyntree import Module
12
- from jaclang.compiler.compile import compile_jac
13
- from jaclang.compiler.constant import Constants as Con
14
- from jaclang.core.utils import sys_path_context
15
-
16
-
17
- def handle_directory(
18
- module_name: str, full_mod_path: str, mod_bundle: Optional[Module]
19
- ) -> types.ModuleType:
20
- """Import from a directory that potentially contains multiple Jac modules."""
21
- module = types.ModuleType(module_name)
22
- module.__name__ = module_name
23
- module.__path__ = [full_mod_path]
24
- module.__file__ = None
25
- module.__dict__["__jac_mod_bundle__"] = mod_bundle
26
- if module_name not in sys.modules:
27
- sys.modules[module_name] = module
28
- return module
29
-
30
-
31
- def process_items(
32
- module: types.ModuleType,
33
- items: dict[str, Union[str, Optional[str]]],
34
- caller_dir: str,
35
- lang: Optional[str],
36
- mod_bundle: Optional[Module] = None,
37
- cachable: bool = True,
38
- ) -> list:
39
- """Process items within a module by handling renaming and potentially loading missing attributes."""
40
- unique_loaded_items = []
41
-
42
- def handle_item_loading(item: str, alias: Union[str, Optional[str]]) -> None:
43
- if item:
44
- unique_loaded_items.append(item)
45
- setattr(module, name, item)
46
- if alias and alias != name and not isinstance(alias, bool):
47
- setattr(module, alias, item)
48
-
49
- for name, alias in items.items():
50
- try:
51
- item = getattr(module, name)
52
- handle_item_loading(item, alias)
53
- except AttributeError:
54
- if lang == "jac":
55
- jac_file_path = (
56
- os.path.join(module.__path__[0], f"{name}.jac")
57
- if hasattr(module, "__path__")
58
- else module.__file__
59
- )
60
- if jac_file_path and os.path.isfile(jac_file_path):
61
- item = load_jac_file(
62
- module=module,
63
- name=name,
64
- jac_file_path=jac_file_path,
65
- mod_bundle=mod_bundle,
66
- cachable=cachable,
67
- caller_dir=caller_dir,
68
- )
69
- handle_item_loading(item, alias)
70
- elif jac_file_path and os.path.isdir(jac_file_path[:-4]):
71
- item = handle_directory(name, jac_file_path[:-4], mod_bundle)
72
- handle_item_loading(item, alias)
73
- else:
74
- if hasattr(module, "__path__"):
75
- full_module_name = f"{module.__name__}.{name}"
76
- item = importlib.import_module(full_module_name)
77
- handle_item_loading(item, alias)
78
- return unique_loaded_items
79
-
80
-
81
- def load_jac_file(
82
- module: types.ModuleType,
83
- name: str,
84
- jac_file_path: str,
85
- mod_bundle: Optional[Module],
86
- cachable: bool,
87
- caller_dir: str,
88
- ) -> Optional[types.ModuleType]:
89
- """Load a single .jac file into the specified module component."""
90
- try:
91
- package_name = (
92
- f"{module.__name__}.{name}"
93
- if hasattr(module, "__path__")
94
- else module.__name__
95
- )
96
- new_module = sys.modules.get(
97
- package_name,
98
- create_jac_py_module(mod_bundle, name, module.__name__, jac_file_path),
99
- )
100
-
101
- codeobj = get_codeobj(
102
- full_target=jac_file_path,
103
- module_name=name,
104
- mod_bundle=mod_bundle,
105
- cachable=cachable,
106
- caller_dir=caller_dir,
107
- )
108
- if not codeobj:
109
- raise ImportError(f"No bytecode found for {jac_file_path}")
110
-
111
- exec(codeobj, new_module.__dict__)
112
- return getattr(new_module, name, new_module)
113
- except ImportError as e:
114
- print(
115
- f"Failed to load {name} from {jac_file_path} in {module.__name__}: {str(e)}"
116
- )
117
- return None
118
-
119
-
120
- def get_codeobj(
121
- full_target: str,
122
- module_name: str,
123
- mod_bundle: Optional[Module],
124
- cachable: bool,
125
- caller_dir: str,
126
- ) -> Optional[types.CodeType]:
127
- """Execcutes the code for a given module."""
128
- if mod_bundle:
129
- codeobj = mod_bundle.mod_deps[full_target].gen.py_bytecode
130
- return marshal.loads(codeobj) if isinstance(codeobj, bytes) else None
131
- gen_dir = os.path.join(caller_dir, Con.JAC_GEN_DIR)
132
- pyc_file_path = os.path.join(gen_dir, module_name + ".jbc")
133
- if cachable and os.path.exists(pyc_file_path):
134
- with open(pyc_file_path, "rb") as f:
135
- return marshal.load(f)
136
-
137
- result = compile_jac(full_target, cache_result=cachable)
138
- if result.errors_had or not result.ir.gen.py_bytecode:
139
- for e in result.errors_had:
140
- print(e)
141
- return None
142
- if result.ir.gen.py_bytecode is not None:
143
- return marshal.loads(result.ir.gen.py_bytecode)
144
- else:
145
- return None
146
-
147
-
148
- def jac_importer(
149
- target: str,
150
- base_path: str,
151
- absorb: bool = False,
152
- cachable: bool = True,
153
- mdl_alias: Optional[str] = None,
154
- override_name: Optional[str] = None,
155
- mod_bundle: Optional[Module | str] = None,
156
- lng: Optional[str] = "jac",
157
- items: Optional[dict[str, Union[str, Optional[str]]]] = None,
158
- ) -> tuple[types.ModuleType, ...]:
159
- """Core Import Process."""
160
- unique_loaded_items = []
161
- dir_path, file_name = path.split(path.join(*(target.split("."))))
162
- module_name = path.splitext(file_name)[0]
163
- package_path = dir_path.replace(path.sep, ".")
164
- if (
165
- not override_name
166
- and package_path
167
- and f"{package_path}.{module_name}" in sys.modules
168
- ):
169
- module = sys.modules[f"{package_path}.{module_name}"]
170
- elif not override_name and not package_path and module_name in sys.modules:
171
- module = sys.modules[module_name]
172
- else:
173
- module = None
174
- valid_mod_bundle = (
175
- sys.modules[mod_bundle].__jac_mod_bundle__
176
- if isinstance(mod_bundle, str)
177
- and mod_bundle in sys.modules
178
- and "__jac_mod_bundle__" in sys.modules[mod_bundle].__dict__
179
- else None
180
- )
181
-
182
- caller_dir = get_caller_dir(target, base_path, dir_path)
183
- full_target = path.normpath(path.join(caller_dir, file_name))
184
- if not module:
185
- if os.path.isdir(full_target):
186
- module = handle_directory(module_name, full_target, valid_mod_bundle)
187
- else:
188
- full_target += ".jac" if lng == "jac" else ".py"
189
- module_name = path.splitext(file_name)[0]
190
- package_path = dir_path.replace(path.sep, ".")
191
-
192
- if lng == "py":
193
- module, *unique_loaded_items = py_import(
194
- target=target,
195
- items=items,
196
- absorb=absorb,
197
- mdl_alias=mdl_alias,
198
- caller_dir=caller_dir,
199
- )
200
- else:
201
- module_name = override_name if override_name else module_name
202
- module = create_jac_py_module(
203
- valid_mod_bundle,
204
- module_name,
205
- package_path,
206
- full_target,
207
- )
208
- codeobj = get_codeobj(
209
- full_target,
210
- module_name,
211
- valid_mod_bundle,
212
- cachable,
213
- caller_dir=caller_dir,
214
- )
215
- try:
216
- if not codeobj:
217
- raise ImportError(f"No bytecode found for {full_target}")
218
- with sys_path_context(caller_dir):
219
- exec(codeobj, module.__dict__)
220
- except Exception as e:
221
- raise ImportError(f"Error importing {full_target}: {str(e)}")
222
- unique_loaded_items = (
223
- process_items(
224
- module=module,
225
- items=items,
226
- caller_dir=caller_dir,
227
- mod_bundle=valid_mod_bundle,
228
- cachable=cachable,
229
- lang=lng,
230
- )
231
- if items
232
- else []
233
- )
234
- return (module,) if absorb or not items else tuple(unique_loaded_items)
235
-
236
-
237
- def create_jac_py_module(
238
- mod_bundle: Optional[Module],
239
- module_name: str,
240
- package_path: str,
241
- full_target: str,
242
- ) -> types.ModuleType:
243
- """Create a module."""
244
- module = types.ModuleType(module_name)
245
- module.__file__ = full_target
246
- module.__name__ = module_name
247
- module.__dict__["__jac_mod_bundle__"] = mod_bundle
248
- if package_path:
249
- parts = package_path.split(".")
250
- base_path = full_target.split(package_path.replace(".", path.sep))[0]
251
- for i in range(len(parts)):
252
- package_name = ".".join(parts[: i + 1])
253
- if package_name not in sys.modules:
254
- full_mod_path = path.join(
255
- base_path, package_name.replace(".", path.sep)
256
- )
257
- handle_directory(
258
- module_name=package_name,
259
- full_mod_path=full_mod_path,
260
- mod_bundle=mod_bundle,
261
- )
262
-
263
- setattr(sys.modules[package_path], module_name, module)
264
- sys.modules[f"{package_path}.{module_name}"] = module
265
- sys.modules[module_name] = module
266
- return module
267
-
268
-
269
- def get_caller_dir(target: str, base_path: str, dir_path: str) -> str:
270
- """Get the directory of the caller."""
271
- caller_dir = base_path if path.isdir(base_path) else path.dirname(base_path)
272
- caller_dir = caller_dir if caller_dir else getcwd()
273
- chomp_target = target
274
- if chomp_target.startswith("."):
275
- chomp_target = chomp_target[1:]
276
- while chomp_target.startswith("."):
277
- caller_dir = path.dirname(caller_dir)
278
- chomp_target = chomp_target[1:]
279
- caller_dir = path.join(caller_dir, dir_path)
280
- return caller_dir
281
-
282
-
283
- def py_import(
284
- target: str,
285
- caller_dir: str,
286
- items: Optional[dict[str, Union[str, Optional[str]]]] = None,
287
- absorb: bool = False,
288
- mdl_alias: Optional[str] = None,
289
- ) -> tuple[types.ModuleType, ...]:
290
- """Import a Python module."""
291
- try:
292
- loaded_items: list = []
293
- if target.startswith("."):
294
- target = target.lstrip(".")
295
- full_target = path.normpath(path.join(caller_dir, target))
296
- spec = importlib.util.spec_from_file_location(target, full_target + ".py")
297
- if spec and spec.loader:
298
- imported_module = importlib.util.module_from_spec(spec)
299
- sys.modules[spec.name] = imported_module
300
- spec.loader.exec_module(imported_module)
301
- else:
302
- raise ImportError(f"Cannot find module {target} at {full_target}")
303
- else:
304
- imported_module = importlib.import_module(name=target)
305
- main_module = __import__("__main__")
306
- if absorb:
307
- for name in dir(imported_module):
308
- if not name.startswith("_"):
309
- setattr(main_module, name, getattr(imported_module, name))
310
-
311
- elif items:
312
- for name, alias in items.items():
313
- if isinstance(alias, bool):
314
- alias = name
315
- try:
316
- item = getattr(imported_module, name)
317
- if item not in loaded_items:
318
- setattr(
319
- main_module, alias if isinstance(alias, str) else name, item
320
- )
321
- loaded_items.append(item)
322
- except AttributeError as e:
323
- if hasattr(imported_module, "__path__"):
324
- item = importlib.import_module(f"{target}.{name}")
325
- if item not in loaded_items:
326
- setattr(
327
- main_module,
328
- alias if isinstance(alias, str) else name,
329
- item,
330
- )
331
- loaded_items.append(item)
332
- else:
333
- raise e
334
-
335
- else:
336
- setattr(
337
- __import__("__main__"),
338
- mdl_alias if isinstance(mdl_alias, str) else target,
339
- imported_module,
340
- )
341
- return (imported_module, *loaded_items)
342
-
343
- except ImportError as e:
344
- raise e
File without changes
File without changes
File without changes
File without changes