Skip to content

Commit

Permalink
cleanup and migration
Browse files Browse the repository at this point in the history
  • Loading branch information
amadolid committed Sep 11, 2024
1 parent 1f4c4c2 commit dcf4083
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 68 deletions.
17 changes: 11 additions & 6 deletions jac/jaclang/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
"""The Jac Programming Language."""

from jaclang.plugin.default import ( # noqa: E402
from jaclang.plugin.default import (
JacAccessValidation,
JacBuiltin,
JacCmdDefaults,
JacFeatureDefaults,
JacNode,
)
from jaclang.plugin.feature import JacFeature, pm # noqa: E402
from jaclang.plugin.feature import JacFeature, hookmanager

jac_import = JacFeature.jac_import

pm.register(JacFeatureDefaults)
pm.register(JacBuiltin)
pm.register(JacCmdDefaults)
pm.load_setuptools_entrypoints("jac")

hookmanager.register(JacFeatureDefaults)
hookmanager.register(JacBuiltin)
hookmanager.register(JacCmdDefaults)
hookmanager.register(JacAccessValidation)
hookmanager.register(JacNode)
hookmanager.load_setuptools_entrypoints("jac")

__all__ = ["jac_import"]
6 changes: 3 additions & 3 deletions jac/jaclang/plugin/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ def dotgen(
dot_file: Optional[str] = None,
) -> str:
"""Print the dot graph."""
from jaclang.plugin.feature import pm
from jaclang.plugin.feature import JacBuiltin as JacB, JacFeature as Jac

root = pm.hook.get_root()
root = Jac.get_root()
node = node if node is not None else root
depth = depth if depth is not None else -1
traverse = traverse if traverse is not None else False
bfs = bfs if bfs is not None else True
edge_limit = edge_limit if edge_limit is not None else 512
node_limit = node_limit if node_limit is not None else 512

return pm.hook.dotgen(
return JacB.dotgen(
edge_type=edge_type,
node=node,
depth=depth,
Expand Down
2 changes: 1 addition & 1 deletion jac/jaclang/plugin/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def dotgen(
node: NodeArchitype,
depth: int,
traverse: bool,
edge_type: list[str],
edge_type: Optional[list[str]],
bfs: bool,
edge_limit: int,
node_limit: int,
Expand Down
Loading

0 comments on commit dcf4083

Please sign in to comment.