jaclang 0.7.22__py3-none-any.whl → 0.7.23__py3-none-any.whl

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

Potentially problematic release.


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

jaclang/__init__.py CHANGED
@@ -1,17 +1,12 @@
1
1
  """The Jac Programming Language."""
2
2
 
3
- from jaclang.plugin.default import ( # noqa: E402
4
- JacBuiltin,
5
- JacCmdDefaults,
6
- JacFeatureDefaults,
7
- )
8
- from jaclang.plugin.feature import JacFeature, pm # noqa: E402
3
+ from jaclang.plugin.default import JacFeatureImpl
4
+ from jaclang.plugin.feature import JacFeature, plugin_manager
9
5
 
10
6
  jac_import = JacFeature.jac_import
11
7
 
12
- pm.register(JacFeatureDefaults)
13
- pm.register(JacBuiltin)
14
- pm.register(JacCmdDefaults)
15
- pm.load_setuptools_entrypoints("jac")
8
+
9
+ plugin_manager.register(JacFeatureImpl)
10
+ plugin_manager.load_setuptools_entrypoints("jac")
16
11
 
17
12
  __all__ = ["jac_import"]
jaclang/cli/cli.py CHANGED
@@ -28,6 +28,7 @@ from jaclang.utils.lang_tools import AstTool
28
28
 
29
29
 
30
30
  Cmd.create_cmd()
31
+ Jac.setup()
31
32
 
32
33
 
33
34
  @cmd_registry.register
@@ -283,7 +284,9 @@ def enter(
283
284
 
284
285
  jctx.set_entry_node(node)
285
286
 
286
- if isinstance(architype, WalkerArchitype) and jctx.validate_access():
287
+ if isinstance(architype, WalkerArchitype) and Jac.check_read_access(
288
+ jctx.entry_node
289
+ ):
287
290
  Jac.spawn_call(jctx.entry_node.architype, architype)
288
291
 
289
292
  jctx.close()
@@ -50,12 +50,6 @@ class JacTypeCheckPass(Pass):
50
50
  options = myab.myb.Options()
51
51
  options.ignore_missing_imports = True
52
52
  options.cache_dir = Con.JAC_MYPY_CACHE
53
- options.mypy_path = [
54
- # str( # TODO: Remove me, this was the wrong way to point to stubs
55
- # pathlib.Path(os.path.dirname(__file__)).parent.parent.parent.parent
56
- # / "stubs"
57
- # )
58
- ]
59
53
  if top_module_path != "":
60
54
  options.mypy_path.append(top_module_path)
61
55
 
@@ -116,6 +110,14 @@ class JacTypeCheckPass(Pass):
116
110
  old_graph=mypy_graph,
117
111
  new_modules=new_modules, # To parse the dependancies of modules
118
112
  )
113
+ mypy_graph = {
114
+ k: v
115
+ for k, v in mypy_graph.items()
116
+ if (
117
+ k.startswith("jaclang.plugin")
118
+ or not (k.startswith("jaclang.") or k.startswith("mypy."))
119
+ )
120
+ }
119
121
  for i in mypy_graph:
120
122
  self.ir.py_mod_dep_map[i] = mypy_graph[i].xpath
121
123
  for j in mypy_graph[i].dependencies:
jaclang/plugin/builtin.py CHANGED
@@ -19,9 +19,9 @@ def dotgen(
19
19
  dot_file: Optional[str] = None,
20
20
  ) -> str:
21
21
  """Print the dot graph."""
22
- from jaclang.plugin.feature import pm
22
+ from jaclang.plugin.feature import JacFeature as Jac
23
23
 
24
- root = pm.hook.get_root()
24
+ root = Jac.get_root()
25
25
  node = node if node is not None else root
26
26
  depth = depth if depth is not None else -1
27
27
  traverse = traverse if traverse is not None else False
@@ -29,7 +29,7 @@ def dotgen(
29
29
  edge_limit = edge_limit if edge_limit is not None else 512
30
30
  node_limit = node_limit if node_limit is not None else 512
31
31
 
32
- return pm.hook.dotgen(
32
+ return Jac.dotgen(
33
33
  edge_type=edge_type,
34
34
  node=node,
35
35
  depth=depth,