jaclang 0.5.4__py3-none-any.whl → 0.5.6__py3-none-any.whl

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

Potentially problematic release.


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

jaclang/core/construct.py CHANGED
@@ -44,15 +44,12 @@ class NodeAnchor(ObjectAnchor):
44
44
  def get_edges(
45
45
  self,
46
46
  dir: EdgeDir,
47
- filter_type: Optional[type],
48
47
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
49
48
  target_obj: Optional[list[NodeArchitype]],
50
49
  ) -> list[EdgeArchitype]:
51
50
  """Get edges connected to this node."""
52
51
  edge_list: list[EdgeArchitype] = [*self.edges]
53
52
  ret_edges: list[EdgeArchitype] = []
54
- if filter_type:
55
- edge_list = [e for e in edge_list if isinstance(e, filter_type)]
56
53
  edge_list = filter_func(edge_list) if filter_func else edge_list
57
54
  for e in edge_list:
58
55
  if (
@@ -75,15 +72,12 @@ class NodeAnchor(ObjectAnchor):
75
72
  def edges_to_nodes(
76
73
  self,
77
74
  dir: EdgeDir,
78
- filter_type: Optional[type],
79
75
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
80
76
  target_obj: Optional[list[NodeArchitype]],
81
77
  ) -> list[NodeArchitype]:
82
78
  """Get set of nodes connected to this node."""
83
79
  edge_list: list[EdgeArchitype] = [*self.edges]
84
80
  node_list: list[NodeArchitype] = []
85
- if filter_type:
86
- edge_list = [e for e in edge_list if isinstance(e, filter_type)]
87
81
  edge_list = filter_func(edge_list) if filter_func else edge_list
88
82
  for e in edge_list:
89
83
  if e._jac_.target and e._jac_.source:
jaclang/plugin/default.py CHANGED
@@ -262,7 +262,6 @@ class JacFeatureDefaults:
262
262
  node_obj: NodeArchitype | list[NodeArchitype],
263
263
  target_obj: Optional[NodeArchitype | list[NodeArchitype]],
264
264
  dir: EdgeDir,
265
- filter_type: Optional[type],
266
265
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
267
266
  edges_only: bool,
268
267
  ) -> list[NodeArchitype] | list[EdgeArchitype]:
@@ -278,16 +277,14 @@ class JacFeatureDefaults:
278
277
  connected_edges: list[EdgeArchitype] = []
279
278
  for node in node_obj:
280
279
  connected_edges += node._jac_.get_edges(
281
- dir, filter_type, filter_func, target_obj=targ_obj_set
280
+ dir, filter_func, target_obj=targ_obj_set
282
281
  )
283
282
  return list(set(connected_edges))
284
283
  else:
285
284
  connected_nodes: list[NodeArchitype] = []
286
285
  for node in node_obj:
287
286
  connected_nodes.extend(
288
- node._jac_.edges_to_nodes(
289
- dir, filter_type, filter_func, target_obj=targ_obj_set
290
- )
287
+ node._jac_.edges_to_nodes(dir, filter_func, target_obj=targ_obj_set)
291
288
  )
292
289
  return list(set(connected_nodes))
293
290
 
@@ -319,7 +316,6 @@ class JacFeatureDefaults:
319
316
  left: NodeArchitype | list[NodeArchitype],
320
317
  right: NodeArchitype | list[NodeArchitype],
321
318
  dir: EdgeDir,
322
- filter_type: Optional[type],
323
319
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
324
320
  ) -> bool: # noqa: ANN401
325
321
  """Jac's disconnect operator feature."""
@@ -329,17 +325,11 @@ class JacFeatureDefaults:
329
325
  for i in left:
330
326
  for j in right:
331
327
  edge_list: list[EdgeArchitype] = [*i._jac_.edges]
332
- if filter_type:
333
- edge_list = [e for e in edge_list if isinstance(e, filter_type)]
334
328
  edge_list = filter_func(edge_list) if filter_func else edge_list
335
329
  for e in edge_list:
336
- if (
337
- e._jac_.target
338
- and e._jac_.source
339
- and (not filter_type or isinstance(e, filter_type))
340
- ):
330
+ if e._jac_.target and e._jac_.source:
341
331
  if (
342
- dir in ["OUT", "ANY"]
332
+ dir in ["OUT", "ANY"] # TODO: Not ideal
343
333
  and i._jac_.obj == e._jac_.source
344
334
  and e._jac_.target == j._jac_.obj
345
335
  ):
@@ -404,3 +394,13 @@ class JacBuiltin:
404
394
  def dotgen(node: NodeArchitype, radius: int = 0) -> str:
405
395
  """Print the dot graph."""
406
396
  return dotgen(node, radius)
397
+
398
+
399
+ class JacCmdDefaults:
400
+ """Jac CLI command."""
401
+
402
+ @staticmethod
403
+ @hookimpl
404
+ def create_cmd() -> None:
405
+ """Create Jac CLI cmds."""
406
+ pass
jaclang/plugin/feature.py CHANGED
@@ -13,12 +13,13 @@ from jaclang.core.construct import (
13
13
  Root,
14
14
  WalkerArchitype,
15
15
  )
16
- from jaclang.plugin.spec import JacFeatureSpec, T
16
+ from jaclang.plugin.spec import JacCmdSpec, JacFeatureSpec, T
17
17
 
18
18
  import pluggy
19
19
 
20
20
  pm = pluggy.PluginManager("jac")
21
21
  pm.add_hookspecs(JacFeatureSpec)
22
+ pm.add_hookspecs(JacCmdSpec)
22
23
 
23
24
 
24
25
  class JacFeature:
@@ -143,7 +144,6 @@ class JacFeature:
143
144
  node_obj: NodeArchitype | list[NodeArchitype],
144
145
  target_obj: Optional[NodeArchitype | list[NodeArchitype]],
145
146
  dir: EdgeDir,
146
- filter_type: Optional[type],
147
147
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
148
148
  edges_only: bool = False,
149
149
  ) -> list[NodeArchitype] | list[EdgeArchitype]:
@@ -152,7 +152,6 @@ class JacFeature:
152
152
  node_obj=node_obj,
153
153
  target_obj=target_obj,
154
154
  dir=dir,
155
- filter_type=filter_type,
156
155
  filter_func=filter_func,
157
156
  edges_only=edges_only,
158
157
  )
@@ -177,7 +176,6 @@ class JacFeature:
177
176
  left: NodeArchitype | list[NodeArchitype],
178
177
  right: NodeArchitype | list[NodeArchitype],
179
178
  dir: EdgeDir,
180
- filter_type: Optional[type],
181
179
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
182
180
  ) -> bool:
183
181
  """Jac's disconnect operator feature."""
@@ -185,7 +183,6 @@ class JacFeature:
185
183
  left=left,
186
184
  right=right,
187
185
  dir=dir,
188
- filter_type=filter_type,
189
186
  filter_func=filter_func,
190
187
  )
191
188
 
@@ -220,3 +217,12 @@ class JacBuiltin:
220
217
  def dotgen(node: NodeArchitype, radius: int = 0) -> str:
221
218
  """Print the dot graph."""
222
219
  return pm.hook.dotgen(node=node, radius=radius)
220
+
221
+
222
+ class JacCmd:
223
+ """Jac CLI command."""
224
+
225
+ @staticmethod
226
+ def create_cmd() -> None:
227
+ """Create Jac CLI cmds."""
228
+ return pm.hook.create_cmd()
jaclang/plugin/spec.py CHANGED
@@ -149,7 +149,6 @@ class JacFeatureSpec:
149
149
  node_obj: NodeArchitype | list[NodeArchitype],
150
150
  target_obj: Optional[NodeArchitype | list[NodeArchitype]],
151
151
  dir: EdgeDir,
152
- filter_type: Optional[type],
153
152
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
154
153
  edges_only: bool,
155
154
  ) -> list[NodeArchitype] | list[EdgeArchitype]:
@@ -176,7 +175,6 @@ class JacFeatureSpec:
176
175
  left: NodeArchitype | list[NodeArchitype],
177
176
  right: NodeArchitype | list[NodeArchitype],
178
177
  dir: EdgeDir,
179
- filter_type: Optional[type],
180
178
  filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
181
179
  ) -> bool: # noqa: ANN401
182
180
  """Jac's disconnect operator feature."""
@@ -215,3 +213,13 @@ class JacBuiltin:
215
213
  def dotgen(node: NodeArchitype, radius: int = 0) -> str:
216
214
  """Print the dot graph."""
217
215
  raise NotImplementedError
216
+
217
+
218
+ class JacCmdSpec:
219
+ """Jac CLI command."""
220
+
221
+ @staticmethod
222
+ @hookspec
223
+ def create_cmd() -> None:
224
+ """Create Jac CLI cmds."""
225
+ raise NotImplementedError
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaclang
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Home-page: https://github.com/Jaseci-Labs/jaclang
5
5
  Author: Jason Mars
6
6
  Author-email: jason@jaseci.org
@@ -1,17 +1,17 @@
1
- jaclang/__init__.py,sha256=jlX-Dhyb7sGC1AyRsK1njdCFrOHg4m6b5ip_MEeeC-s,596
1
+ jaclang/__init__.py,sha256=92Q6E1oxeYXTBn8LWwBHciEeQsYLr82lCwwCzzGn5yw,640
2
2
  jaclang/cli/__init__.py,sha256=7aaPgYddIAHBvkdv36ngbfwsimMnfGaTDcaHYMg_vf4,23
3
- jaclang/cli/cli.py,sha256=mji2LY83eGrsjOAcRd8uDRnb6Tco1rAAnTiEtfukijw,6547
4
- jaclang/cli/cmdreg.py,sha256=a_xurX21dfgVrxZgQDIQpbMGCHb11nttiUSp5b1AiHw,6641
3
+ jaclang/cli/cli.py,sha256=rSaSxUpyNUZ-HsBiS2iFMWtCeHkomsx5aIpuW9PrD-E,6578
4
+ jaclang/cli/cmdreg.py,sha256=Tmxa3oo1BNOBs605TSOOD-KcIOBhUuIn7ZQtEaEGmco,6676
5
5
  jaclang/compiler/__init__.py,sha256=B07SnAx4emUUZoosOsqNwt9JnHnpEvOtjh5z6jz4hII,845
6
- jaclang/compiler/absyntree.py,sha256=ij9_nfqnptv6birU-c2XLPkRs8BLOyDt_Ao98hDvOjs,63642
6
+ jaclang/compiler/absyntree.py,sha256=54ZmMNDP44oDn5KfJU9fjnEnYmH8U1_6QGpCU4ck2jg,63970
7
7
  jaclang/compiler/codeloc.py,sha256=M5kMZ0diqifcH3P0PE3yIvtZaUw8dbgaF_Hrl393ca8,2659
8
8
  jaclang/compiler/compile.py,sha256=9sgC1iOibTk0zWSuZMOnAvAxBj0KwUBeY4MVvrpcqz8,2738
9
9
  jaclang/compiler/constant.py,sha256=Yzzz1u3GiRcPYUaBNQ4j3kZFLlonv2OiKNdPQuTusf4,5794
10
- jaclang/compiler/parser.py,sha256=sX91ZAZOIvcO-swKSnJGY913cGAutgH2HakD5k_BlIA,131144
10
+ jaclang/compiler/parser.py,sha256=q8B6DAn3ngB2Dv4q5T7UaxijcvPjEr7XnZtWW6rWjBY,130853
11
11
  jaclang/compiler/symtable.py,sha256=mFSKBiTQIJyWAFknokPHSz-tPy19YLu7XW4kP6Hv9ZQ,5171
12
12
  jaclang/compiler/workspace.py,sha256=5f_8ShPPT3yY8_vVQhiBRPgyiP_crQhOLy8uEsj-D8k,6741
13
13
  jaclang/compiler/__jac_gen__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- jaclang/compiler/__jac_gen__/jac_parser.py,sha256=S2KsBTEHWu4OonYi1t-DCxK8e3u30VZPJCV5sy6Me3w,317930
14
+ jaclang/compiler/__jac_gen__/jac_parser.py,sha256=38dMVW8DITq1vudSB6kWMowybfNVuqjfuH50DWcU_kI,320594
15
15
  jaclang/compiler/passes/__init__.py,sha256=0Tw0d130ZjzA05jVcny9cf5NfLjlaM70PKqFnY4zqn4,69
16
16
  jaclang/compiler/passes/ir_pass.py,sha256=ZCcERZZfcOxRurJjOlW5UFj-C1mlp44qpDMsUCH2dUQ,4893
17
17
  jaclang/compiler/passes/transform.py,sha256=6t-bbX_s615i7_naOIBjT4wvAkvLFM4niRHYyF4my8A,2086
@@ -19,13 +19,13 @@ jaclang/compiler/passes/main/__init__.py,sha256=93aNqSyI2GyRBrzIkxVc7N8JENKPdwtV
19
19
  jaclang/compiler/passes/main/def_impl_match_pass.py,sha256=nFKwhbDkyeKldA1A9teON7zW1zJ9lMblGQ3oNF_nzBM,2579
20
20
  jaclang/compiler/passes/main/def_use_pass.py,sha256=1NGEfVLy1IsF0iYl6bda6CcrEuiFHTSZHj9pvZcMIFI,8575
21
21
  jaclang/compiler/passes/main/import_pass.py,sha256=zZ6E1awZLbOfhWRsHVZCPrS7XpjVmSy7rL4Bdo481rg,5983
22
- jaclang/compiler/passes/main/pyast_gen_pass.py,sha256=cqeiAYcx_gkXgTN1vMBjG2oWkT4gd2KniNFZsnovlKU,108109
22
+ jaclang/compiler/passes/main/pyast_gen_pass.py,sha256=ZBZKWfft1GYynvFpUoeEH6ZmmHUBNlpZ3TCe9A-pkDY,110371
23
23
  jaclang/compiler/passes/main/pyast_load_pass.py,sha256=vHgIYC5YOlv9TT8tXAZ5c7rsFzSBm8kw0AJEeEdY2C4,25332
24
24
  jaclang/compiler/passes/main/pybc_gen_pass.py,sha256=CjA9AqyMO3Pv_b5Hh0YI6JmCqIru2ASonO6rhrkau-M,1336
25
25
  jaclang/compiler/passes/main/pyout_pass.py,sha256=u2JlV8gF4VF25hIt2GForWqCIMmbSlxDkE24Ehl-Kcc,3016
26
26
  jaclang/compiler/passes/main/schedules.py,sha256=ODyLVItL-cXxw0lzwan5RJlWlki2a-mhlkrDUngGTZc,895
27
27
  jaclang/compiler/passes/main/sub_node_tab_pass.py,sha256=fGgK0CBWsuD6BS4BsLwXPl1b5UC2N2YEOGa6jNMu8N8,1332
28
- jaclang/compiler/passes/main/sym_tab_build_pass.py,sha256=ROCh6pVyRXP0kiiIxM-UgQySywcbl3OwgT-LMWOilus,41037
28
+ jaclang/compiler/passes/main/sym_tab_build_pass.py,sha256=g9UyCM1ZPsQ0Rzix3a2asdmstLTn3nZ0Zsp6gSJ363I,41194
29
29
  jaclang/compiler/passes/main/type_check_pass.py,sha256=Ithw0PTsEtf2OropKM4YP7XBRfe_bUk6kfn8XHX3NJc,3311
30
30
  jaclang/compiler/passes/main/tests/__init__.py,sha256=UBAATLUEH3yuBN4LYKnXXV79kokRc4XB-rX12qfu0ds,28
31
31
  jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py,sha256=xxwobYmRS7YbjDojR24F4kd13J3aMCVimxmKUqwCgiM,1358
@@ -39,7 +39,7 @@ jaclang/compiler/passes/main/tests/test_sym_tab_build_pass.py,sha256=XprSqlWlkq2
39
39
  jaclang/compiler/passes/main/tests/test_type_check_pass.py,sha256=bzrVcsBZra2HkQH2_qLdX0CY9wbx9gVxs-mSIeWGvqc,1553
40
40
  jaclang/compiler/passes/tool/__init__.py,sha256=xekCOXysHIcthWm8NRmQoA1Ah1XV8vFbkfeHphJtUdc,223
41
41
  jaclang/compiler/passes/tool/fuse_comments_pass.py,sha256=N9a84qArNuTXX1iaXsBzqcufx6A3zYq2p-1ieH6FmHc,3133
42
- jaclang/compiler/passes/tool/jac_formatter_pass.py,sha256=5gC23DrtxxNLcwr4la396GKtDJ8GL9A9b2cQlDIuFsY,77392
42
+ jaclang/compiler/passes/tool/jac_formatter_pass.py,sha256=f9VfWZ7SyL2Tz9r-lQYltzsZDTiw_NuxUjQWejsyGkE,77769
43
43
  jaclang/compiler/passes/tool/schedules.py,sha256=kmbsCazAMizGAdQuZpFky5BPlYlMXqNw7wOUzdi_wBo,432
44
44
  jaclang/compiler/passes/tool/tests/__init__.py,sha256=AeOaZjA1rf6VAr0JqIit6jlcmOzW7pxGr4U1fOwgK_Y,24
45
45
  jaclang/compiler/passes/tool/tests/test_fuse_comments_pass.py,sha256=ZeWHsm7VIyyS8KKpoB2SdlHM4jF22fMfSrfTfxt2MQw,398
@@ -52,15 +52,17 @@ jaclang/compiler/tests/test_parser.py,sha256=1FEm2bE8zfwuXbBidF2yOaGJm5StmHLFASG
52
52
  jaclang/compiler/tests/test_workspace.py,sha256=SEBcvz_daTbonrLHK9FbjiH86TUbOtVGH-iZ3xkJSMk,3184
53
53
  jaclang/compiler/tests/fixtures/__init__.py,sha256=udQ0T6rajpW_nMiYKJNckqP8izZ-pH3P4PNTJEln2NU,36
54
54
  jaclang/compiler/tests/fixtures/activity.py,sha256=fSvxYDKufsPeQIrbuh031zHw_hdbRv5iK9mS7dD8E54,263
55
+ jaclang/compiler/tests/fixtures/__jac_gen__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ jaclang/compiler/tests/fixtures/__jac_gen__/hello_world.py,sha256=KTrjDZb7nsRdlxY3Poc_ShDi_SfIfOQqaqG9SYU_6UA,117
55
57
  jaclang/core/__init__.py,sha256=jDDYBCV82qPhmcDVk3NIvHbhng0ebSrXD3xrojg0-eo,34
56
- jaclang/core/construct.py,sha256=ANa9R2-R-xebP7mJ2y5li_Tefgw8hd2df6v-CikVSKo,12081
58
+ jaclang/core/construct.py,sha256=iuDFWmJesyjt2WkMw8idvSrUtsEdXfZWZ4a5rZOoUHo,11805
57
59
  jaclang/core/importer.py,sha256=e1XAyplPOAwg1cQ5_HjRBLSXaQ_IQZ7nyoynUbLmryw,3378
58
60
  jaclang/core/jacbuiltins.py,sha256=DyQVrwMH_BL1Fep1lk_3663xHneGAqgBsv3chRXOFss,245
59
61
  jaclang/core/utils.py,sha256=ZtacZBZVt21-ZRbdloHIbzDnXuiBmoqlEhEM1kUhPdY,810
60
62
  jaclang/plugin/__init__.py,sha256=qLbQ2KjwyTvlV50Q7JTIznyIzuGDPjuwM_ZJjdk-avo,182
61
- jaclang/plugin/default.py,sha256=he926fZbvIMD5XMEIEdr2gmOz1h1qfZ8flIF95249Ok,12463
62
- jaclang/plugin/feature.py,sha256=Cvm3_VySnPg58Gtk1X3yLcBtjaEEfGUMeBIyYuTpE_4,6852
63
- jaclang/plugin/spec.py,sha256=QjJ1Yi_uD0woJbUY9hbc_DvoA7zBGGA2TsEYSS7RkEo,6208
63
+ jaclang/plugin/default.py,sha256=iqtTNUj9vDHG9c3eqS5oJyP2wwJDjUZ2fmuby-AO57E,12233
64
+ jaclang/plugin/feature.py,sha256=ZSMh0qrEia66Bn8g2vlGgq_H5OLKAkZ-gpguLrZsEJA,6908
65
+ jaclang/plugin/spec.py,sha256=SsGQOsVxdtwte9mgNklTQSkqn1Q3lG89AdUNBAGn6NA,6313
64
66
  jaclang/plugin/tests/__init__.py,sha256=rn_tNG8jCHWwBc_rx4yFkGc4N1GISb7aPuTFVRTvrTk,38
65
67
  jaclang/plugin/tests/test_features.py,sha256=uNQ52HHc0GiOGg5xUZk-ddafdtud0IHN4H_EUAs4er4,3547
66
68
  jaclang/utils/__init__.py,sha256=86LQ_LDyWV-JFkYBpeVHpLaVxkqwFDP60XpWXOFZIQk,46
@@ -396,8 +398,8 @@ jaclang/vendor/pluggy/_manager.py,sha256=fcYU7VER0CplRym4jAJ7RCFYl6cfDSeVM589YHH
396
398
  jaclang/vendor/pluggy/_result.py,sha256=wXDoVy68bOaOrBzQ0bWFb3HTbpqhvdQMgYwaZvfzxfA,3239
397
399
  jaclang/vendor/pluggy/_tracing.py,sha256=kSBr25F_rNklV2QhLD6h1jx6Z1kcKDRbuYvF5jv35pU,2089
398
400
  jaclang/vendor/pluggy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
399
- jaclang-0.5.4.dist-info/METADATA,sha256=WOf-iB5OD5fAl8qYl5uKNFq8LiQd2TSM7oHMilE_Qfs,152
400
- jaclang-0.5.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
401
- jaclang-0.5.4.dist-info/entry_points.txt,sha256=Z-snS3MDBdV1Z4znXDZTenyyndovaNjqRkDW1t2kYSs,50
402
- jaclang-0.5.4.dist-info/top_level.txt,sha256=ZOAoLpE67ozkUJd-v3C59wBNXiteRD8IWPbsYB3M08g,8
403
- jaclang-0.5.4.dist-info/RECORD,,
401
+ jaclang-0.5.6.dist-info/METADATA,sha256=ui3WOmmjnbfGHbLg4vAbKuzVbHfs4c5zkSMMuTM57ro,152
402
+ jaclang-0.5.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
403
+ jaclang-0.5.6.dist-info/entry_points.txt,sha256=Z-snS3MDBdV1Z4znXDZTenyyndovaNjqRkDW1t2kYSs,50
404
+ jaclang-0.5.6.dist-info/top_level.txt,sha256=ZOAoLpE67ozkUJd-v3C59wBNXiteRD8IWPbsYB3M08g,8
405
+ jaclang-0.5.6.dist-info/RECORD,,