jaclang 0.8.0__py3-none-any.whl → 0.8.1__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/cli.py +11 -9
- jaclang/compiler/jac.lark +2 -12
- jaclang/compiler/larkparse/jac_parser.py +1 -1
- jaclang/compiler/parser.py +360 -521
- jaclang/compiler/passes/main/cfg_build_pass.py +2 -2
- jaclang/compiler/passes/main/def_impl_match_pass.py +14 -13
- jaclang/compiler/passes/main/def_use_pass.py +4 -7
- jaclang/compiler/passes/main/import_pass.py +3 -3
- jaclang/compiler/passes/main/inheritance_pass.py +2 -2
- jaclang/compiler/passes/main/pyast_gen_pass.py +196 -218
- jaclang/compiler/passes/main/pyast_load_pass.py +115 -311
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +8 -7
- jaclang/compiler/passes/main/sym_tab_build_pass.py +3 -3
- jaclang/compiler/passes/main/sym_tab_link_pass.py +4 -4
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/action/actions.jac +1 -5
- jaclang/compiler/passes/main/tests/fixtures/symtab_link_tests/main.jac +1 -8
- jaclang/compiler/passes/main/tests/test_cfg_build_pass.py +4 -2
- jaclang/compiler/passes/tool/doc_ir_gen_pass.py +197 -120
- jaclang/compiler/program.py +2 -7
- jaclang/compiler/tests/fixtures/fam.jac +2 -2
- jaclang/compiler/tests/fixtures/pkg_import_lib/__init__.jac +1 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/sub/__init__.jac +1 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/sub/helper.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib/tools.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/__init__.py +11 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/sub/__init__.py +7 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/sub/helper.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_lib_py/tools.jac +3 -0
- jaclang/compiler/tests/fixtures/pkg_import_main.jac +10 -0
- jaclang/compiler/tests/fixtures/pkg_import_main_py.jac +11 -0
- jaclang/compiler/tests/test_importer.py +20 -0
- jaclang/compiler/tests/test_parser.py +1 -0
- jaclang/compiler/unitree.py +456 -304
- jaclang/langserve/engine.jac +498 -0
- jaclang/langserve/sem_manager.jac +309 -0
- jaclang/langserve/server.jac +186 -0
- jaclang/langserve/tests/server_test/test_lang_serve.py +6 -7
- jaclang/langserve/tests/server_test/utils.py +4 -1
- jaclang/langserve/tests/session.jac +294 -0
- jaclang/langserve/tests/test_sem_tokens.py +2 -2
- jaclang/langserve/tests/test_server.py +12 -7
- jaclang/langserve/utils.jac +51 -30
- jaclang/runtimelib/archetype.py +1 -1
- jaclang/runtimelib/builtin.py +17 -14
- jaclang/runtimelib/importer.py +26 -8
- jaclang/runtimelib/machine.py +96 -55
- jaclang/runtimelib/tests/fixtures/traversing_save.jac +7 -5
- jaclang/runtimelib/utils.py +3 -3
- jaclang/tests/fixtures/backward_edge_visit.jac +31 -0
- jaclang/tests/fixtures/builtin_printgraph.jac +85 -0
- jaclang/tests/fixtures/builtin_printgraph_json.jac +21 -0
- jaclang/tests/fixtures/builtin_printgraph_mermaid.jac +16 -0
- jaclang/tests/fixtures/chandra_bugs2.jac +20 -13
- jaclang/tests/fixtures/concurrency.jac +1 -1
- jaclang/tests/fixtures/edge_ability.jac +49 -0
- jaclang/tests/fixtures/guess_game.jac +1 -1
- jaclang/tests/fixtures/here_usage_error.jac +21 -0
- jaclang/tests/fixtures/here_visitor_usage.jac +21 -0
- jaclang/tests/fixtures/node_del.jac +30 -36
- jaclang/tests/fixtures/visit_traversal.jac +47 -0
- jaclang/tests/test_cli.py +12 -7
- jaclang/tests/test_language.py +91 -16
- jaclang/utils/helpers.py +14 -6
- jaclang/utils/lang_tools.py +2 -3
- jaclang/utils/tests/test_lang_tools.py +2 -1
- jaclang/utils/treeprinter.py +3 -4
- {jaclang-0.8.0.dist-info → jaclang-0.8.1.dist-info}/METADATA +4 -3
- {jaclang-0.8.0.dist-info → jaclang-0.8.1.dist-info}/RECORD +71 -55
- {jaclang-0.8.0.dist-info → jaclang-0.8.1.dist-info}/WHEEL +1 -1
- jaclang/langserve/engine.py +0 -553
- jaclang/langserve/sem_manager.py +0 -383
- jaclang/langserve/server.py +0 -167
- jaclang/langserve/tests/session.py +0 -255
- jaclang/tests/fixtures/builtin_dotgen.jac +0 -42
- jaclang/tests/fixtures/builtin_dotgen_json.jac +0 -21
- /jaclang/langserve/{__init__.py → __init__.jac} +0 -0
- {jaclang-0.8.0.dist-info → jaclang-0.8.1.dist-info}/entry_points.txt +0 -0
|
@@ -25,14 +25,14 @@ node location {
|
|
|
25
25
|
|
|
26
26
|
for i in activities {
|
|
27
27
|
i.duration = visitor.duration;
|
|
28
|
-
if
|
|
28
|
+
if visitor.name not in visitor.passport {
|
|
29
29
|
if i.name == "Hiking" {
|
|
30
30
|
for j=0 to j<3 by j+=1 {
|
|
31
31
|
i.duration+=1;
|
|
32
32
|
}
|
|
33
33
|
i.duration+=1;
|
|
34
34
|
}
|
|
35
|
-
visitor.passport.append(
|
|
35
|
+
visitor.passport.append(visitor.name);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import from .tools { tool_func }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import from .helper { help_func }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import from pkg_import_lib { tool_func }
|
|
2
|
+
import from pkg_import_lib.sub { help_func }
|
|
3
|
+
|
|
4
|
+
with entry {
|
|
5
|
+
print('Main Execution:\n') ;
|
|
6
|
+
print('Calling from tools.jac...') ;
|
|
7
|
+
print('Tool says:', tool_func()) ;
|
|
8
|
+
print('\nCalling from helper.jac...') ;
|
|
9
|
+
print('Helper says:', help_func()) ;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import from pkg_import_lib_py { tool_func,glob_var_lib }
|
|
2
|
+
import from pkg_import_lib_py.sub { help_func }
|
|
3
|
+
|
|
4
|
+
with entry {
|
|
5
|
+
print('Main Execution:\n') ;
|
|
6
|
+
print('Calling from tools.jac...') ;
|
|
7
|
+
print('Tool says:', tool_func()) ;
|
|
8
|
+
print('\nCalling from helper.jac...') ;
|
|
9
|
+
print('Helper says:', help_func()) ;
|
|
10
|
+
print('\nGlobal variable from lib:', glob_var_lib) ;
|
|
11
|
+
}
|
|
@@ -111,3 +111,23 @@ class TestLoader(TestCase):
|
|
|
111
111
|
|
|
112
112
|
os.environ.pop("JACPATH", None)
|
|
113
113
|
jacpath_dir.cleanup()
|
|
114
|
+
|
|
115
|
+
def test_importer_with_submodule_jac(self) -> None:
|
|
116
|
+
"""Test basic self loading."""
|
|
117
|
+
captured_output = io.StringIO()
|
|
118
|
+
sys.stdout = captured_output
|
|
119
|
+
cli.run(self.fixture_abs_path("pkg_import_main.jac"))
|
|
120
|
+
sys.stdout = sys.__stdout__
|
|
121
|
+
stdout_value = captured_output.getvalue()
|
|
122
|
+
self.assertIn("Helper function called", stdout_value)
|
|
123
|
+
self.assertIn("Tool function executed", stdout_value)
|
|
124
|
+
|
|
125
|
+
def test_importer_with_submodule_py(self) -> None:
|
|
126
|
+
captured_output = io.StringIO()
|
|
127
|
+
sys.stdout = captured_output
|
|
128
|
+
cli.run(self.fixture_abs_path("pkg_import_main_py.jac"))
|
|
129
|
+
sys.stdout = sys.__stdout__
|
|
130
|
+
stdout_value = captured_output.getvalue()
|
|
131
|
+
self.assertIn("Helper function called", stdout_value)
|
|
132
|
+
self.assertIn("Tool function executed", stdout_value)
|
|
133
|
+
self.assertIn("pkg_import_lib_py.glob_var_lib", stdout_value)
|