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 +5 -10
- jaclang/cli/cli.py +4 -1
- jaclang/compiler/passes/main/type_check_pass.py +8 -6
- jaclang/plugin/builtin.py +3 -3
- jaclang/plugin/default.py +582 -206
- jaclang/plugin/feature.py +273 -98
- jaclang/plugin/spec.py +229 -85
- jaclang/plugin/tests/fixtures/other_root_access.jac +9 -9
- jaclang/plugin/tests/test_features.py +2 -2
- jaclang/runtimelib/architype.py +1 -370
- jaclang/runtimelib/constructs.py +2 -0
- jaclang/runtimelib/context.py +0 -4
- jaclang/runtimelib/machine.py +57 -0
- jaclang/runtimelib/memory.py +2 -4
- jaclang/tests/fixtures/arch_create_util.jac +7 -0
- jaclang/tests/fixtures/arch_rel_import_creation.jac +30 -0
- jaclang/tests/fixtures/create_dynamic_architype.jac +35 -0
- jaclang/tests/fixtures/edge_node_walk.jac +1 -1
- jaclang/tests/fixtures/edges_walk.jac +1 -1
- jaclang/tests/fixtures/gendot_bubble_sort.jac +1 -1
- jaclang/tests/fixtures/visit_order.jac +20 -0
- jaclang/tests/test_language.py +53 -0
- {jaclang-0.7.22.dist-info → jaclang-0.7.23.dist-info}/METADATA +1 -1
- {jaclang-0.7.22.dist-info → jaclang-0.7.23.dist-info}/RECORD +26 -22
- {jaclang-0.7.22.dist-info → jaclang-0.7.23.dist-info}/WHEEL +0 -0
- {jaclang-0.7.22.dist-info → jaclang-0.7.23.dist-info}/entry_points.txt +0 -0
jaclang/__init__.py
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"""The Jac Programming Language."""
|
|
2
2
|
|
|
3
|
-
from jaclang.plugin.default import
|
|
4
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|
|
22
|
+
from jaclang.plugin.feature import JacFeature as Jac
|
|
23
23
|
|
|
24
|
-
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
|
|
32
|
+
return Jac.dotgen(
|
|
33
33
|
edge_type=edge_type,
|
|
34
34
|
node=node,
|
|
35
35
|
depth=depth,
|