jaclang 0.3.3__py3-none-any.whl → 0.3.5__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/cli/__jac_gen__/cli.jbc +0 -0
- jaclang/cli/__jac_gen__/cli_impl.jbc +0 -0
- jaclang/cli/__jac_gen__/cmds.jbc +0 -0
- jaclang/cli/__jac_gen__/cmds_impl.jbc +0 -0
- jaclang/core/__jac_gen__/corelib.jbc +0 -0
- jaclang/jac/__jac_gen__/jac_parser.py +1 -1
- jaclang/jac/importer.py +1 -1
- jaclang/jac/passes/main/pyout_pass.py +1 -1
- jaclang/jac/passes/main/tests/test_jac_format_pass.py +10 -2
- jaclang/jac/passes/tool/jac_formatter_pass.py +283 -75
- jaclang/jac/plugin/feature.py +1 -2
- jaclang/jac/tests/fixtures/__jac_gen__/__init__.py +0 -0
- jaclang/jac/tests/fixtures/__jac_gen__/hello_world.jbc +0 -0
- jaclang/jac/tests/fixtures/__jac_gen__/hello_world.py +5 -0
- {jaclang-0.3.3.dist-info → jaclang-0.3.5.dist-info}/METADATA +1 -1
- {jaclang-0.3.3.dist-info → jaclang-0.3.5.dist-info}/RECORD +19 -11
- {jaclang-0.3.3.dist-info → jaclang-0.3.5.dist-info}/WHEEL +0 -0
- {jaclang-0.3.3.dist-info → jaclang-0.3.5.dist-info}/entry_points.txt +0 -0
- {jaclang-0.3.3.dist-info → jaclang-0.3.5.dist-info}/top_level.txt +0 -0
jaclang/jac/importer.py
CHANGED
|
@@ -40,7 +40,7 @@ def jac_import(
|
|
|
40
40
|
full_target = path.normpath(path.join(caller_dir, file_name))
|
|
41
41
|
|
|
42
42
|
py_file_path = path.join(gen_dir, module_name + ".py")
|
|
43
|
-
pyc_file_path = path.join(gen_dir, module_name + ".
|
|
43
|
+
pyc_file_path = path.join(gen_dir, module_name + ".jbc")
|
|
44
44
|
if (
|
|
45
45
|
cachable
|
|
46
46
|
and path.exists(py_file_path)
|
|
@@ -75,5 +75,5 @@ class PyOutPass(Pass):
|
|
|
75
75
|
out_dir = os.path.join(gen_path, mod_dir)
|
|
76
76
|
os.makedirs(out_dir, exist_ok=True)
|
|
77
77
|
out_path_py = os.path.join(out_dir, f"{base_name}.py")
|
|
78
|
-
out_path_pyc = os.path.join(out_dir, f"{base_name}.
|
|
78
|
+
out_path_pyc = os.path.join(out_dir, f"{base_name}.jbc")
|
|
79
79
|
return node.loc.mod_path, out_path_py, out_path_pyc
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Test ast build pass module."""
|
|
2
2
|
import ast as ast3
|
|
3
|
+
from difflib import unified_diff
|
|
3
4
|
|
|
4
5
|
import jaclang.jac.absyntree as ast
|
|
5
6
|
from jaclang.jac.passes.main import PyastGenPass
|
|
@@ -71,16 +72,23 @@ class JacFormatPassTests(TestCaseMicroSuite, AstSyncTestMixin):
|
|
|
71
72
|
len(code_gen_pure.ir.source.comments),
|
|
72
73
|
len(code_gen_jac.ir.source.comments),
|
|
73
74
|
)
|
|
75
|
+
before = ast3.dump(code_gen_pure.ir.gen.py_ast, indent=2)
|
|
76
|
+
after = ast3.dump(code_gen_jac.ir.gen.py_ast, indent=2)
|
|
74
77
|
self.assertEqual(
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
len(
|
|
79
|
+
"\n".join(unified_diff(before.splitlines(), after.splitlines()))
|
|
80
|
+
),
|
|
81
|
+
0,
|
|
77
82
|
)
|
|
83
|
+
|
|
78
84
|
except Exception:
|
|
79
85
|
from jaclang.utils.helpers import add_line_numbers
|
|
80
86
|
|
|
81
87
|
print(add_line_numbers(code_gen_pure.ir.source.code))
|
|
82
88
|
print("\n+++++++++++++++++++++++++++++++++++++++\n")
|
|
83
89
|
print(add_line_numbers(code_gen_format.ir.gen.jac))
|
|
90
|
+
print("\n+++++++++++++++++++++++++++++++++++++++\n")
|
|
91
|
+
print("\n".join(unified_diff(before.splitlines(), after.splitlines())))
|
|
84
92
|
self.skipTest("Test failed, but skipping instead of failing.")
|
|
85
93
|
# raise e
|
|
86
94
|
|