jaclang 0.7.8__py3-none-any.whl → 0.7.11__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 CHANGED
@@ -243,7 +243,7 @@ def test(
243
243
 
244
244
  jac test => jac test -d .
245
245
  """
246
- Jac.run_test(
246
+ failcount = Jac.run_test(
247
247
  filepath=filepath,
248
248
  filter=filter,
249
249
  xit=xit,
@@ -251,6 +251,8 @@ def test(
251
251
  directory=directory,
252
252
  verbose=verbose,
253
253
  )
254
+ if failcount:
255
+ raise SystemExit(f"Tests failed: {failcount}")
254
256
 
255
257
 
256
258
  @cmd_registry.register
@@ -676,7 +676,7 @@ class Module(AstDocNode):
676
676
  if self.doc:
677
677
  new_kid.append(self.doc)
678
678
  new_kid.extend(self.body)
679
- self.set_kids(nodes=new_kid)
679
+ self.set_kids(nodes=new_kid if len(new_kid) else [EmptyToken()])
680
680
  return res
681
681
 
682
682
  def unparse(self) -> str:
@@ -1,9 +1,11 @@
1
1
  """Abstract class for IR Passes for Jac."""
2
2
 
3
+ import time
3
4
  from typing import Optional, Type, TypeVar
4
5
 
5
6
  import jaclang.compiler.absyntree as ast
6
7
  from jaclang.compiler.passes.transform import Transform
8
+ from jaclang.settings import settings
7
9
  from jaclang.utils.helpers import pascal_to_snake
8
10
 
9
11
  T = TypeVar("T", bound=ast.AstNode)
@@ -17,6 +19,7 @@ class Pass(Transform[T]):
17
19
  self.term_signal = False
18
20
  self.prune_signal = False
19
21
  self.ir: ast.AstNode = input_ir
22
+ self.time_taken = 0.0
20
23
  Transform.__init__(self, input_ir, prior)
21
24
 
22
25
  def before_pass(self) -> None:
@@ -104,11 +107,17 @@ class Pass(Transform[T]):
104
107
  # Only performs passes on proper ASTs
105
108
  if not isinstance(ir, ast.AstNode):
106
109
  return ir
110
+ start_time = time.time()
107
111
  self.before_pass()
108
112
  if not isinstance(ir, ast.AstNode):
109
113
  raise ValueError("Current node is not an AstNode.")
110
114
  self.traverse(ir)
111
115
  self.after_pass()
116
+ self.time_taken = time.time() - start_time
117
+ if settings.pass_timer:
118
+ print(
119
+ f"Time taken in {self.__class__.__name__}: {self.time_taken:.4f} seconds"
120
+ )
112
121
  return self.ir
113
122
 
114
123
  def traverse(self, node: ast.AstNode) -> ast.AstNode:
@@ -25,11 +25,14 @@ class JacImportPass(Pass):
25
25
  def before_pass(self) -> None:
26
26
  """Run once before pass."""
27
27
  self.import_table: dict[str, ast.Module] = {}
28
+ self.__py_imports: set[str] = set()
29
+ self.py_resolve_list: set[str] = set()
28
30
 
29
31
  def enter_module(self, node: ast.Module) -> None:
30
32
  """Run Importer."""
31
33
  self.cur_node = node
32
34
  self.import_table[node.loc.mod_path] = node
35
+ self.__py_imports.clear()
33
36
  self.__annex_impl(node)
34
37
  self.terminate() # Turns off auto traversal for deliberate traversal
35
38
  self.run_again = True
@@ -40,6 +43,10 @@ class JacImportPass(Pass):
40
43
  self.process_import(node, i)
41
44
  self.enter_module_path(i)
42
45
  SubNodeTabPass(prior=self, input_ir=node)
46
+
47
+ for i in self.get_all_sub_nodes(node, ast.AtomTrailer):
48
+ self.enter_atom_trailer(i)
49
+
43
50
  node.mod_deps = self.import_table
44
51
 
45
52
  def process_import(self, node: ast.Module, i: ast.ModulePath) -> None:
@@ -50,6 +57,8 @@ class JacImportPass(Pass):
50
57
  node=i,
51
58
  mod_path=node.loc.mod_path,
52
59
  )
60
+ elif lang == "py":
61
+ self.__py_imports.add(i.path_str)
53
62
 
54
63
  def attach_mod_to_node(
55
64
  self, node: ast.ModulePath | ast.ModuleItem, mod: ast.Module | None
@@ -122,6 +131,11 @@ class JacImportPass(Pass):
122
131
  node.sub_module.name = node.alias.value
123
132
  # Items matched during def/decl pass
124
133
 
134
+ def enter_atom_trailer(self, node: ast.AtomTrailer) -> None:
135
+ """Iterate on AtomTrailer nodes to get python paths to resolve."""
136
+ if node.as_attr_list[0].sym_name in self.__py_imports:
137
+ self.py_resolve_list.add(".".join([i.sym_name for i in node.as_attr_list]))
138
+
125
139
  def import_jac_module(self, node: ast.ModulePath, mod_path: str) -> None:
126
140
  """Import a module."""
127
141
  self.cur_node = node # impacts error reporting
@@ -206,10 +220,9 @@ class PyImportPass(JacImportPass):
206
220
 
207
221
  def before_pass(self) -> None:
208
222
  """Only run pass if settings are set to raise python."""
223
+ super().before_pass()
209
224
  if not settings.py_raise:
210
225
  self.terminate()
211
- else:
212
- return super().before_pass()
213
226
 
214
227
  def process_import(self, node: ast.Module, i: ast.ModulePath) -> None:
215
228
  """Process an import."""
@@ -49,3 +49,16 @@ class ImportPassPassTests(TestCase):
49
49
  )
50
50
  for i in state.ir.get_all_sub_nodes(ast.Module):
51
51
  self.assertEqual(i.annexable_by, self.fixture_abs_path("autoimpl.jac"))
52
+
53
+ def test_py_resolve_list(self) -> None:
54
+ """Basic test for pass."""
55
+ state: JacImportPass = jac_file_to_pass(
56
+ self.examples_abs_path("rpg_game/jac_impl/jac_impl_5/main.jac"),
57
+ JacImportPass,
58
+ )
59
+ self.assertGreater(len(state.py_resolve_list), 20)
60
+ self.assertIn("pygame.sprite.Sprite.__init__", state.py_resolve_list)
61
+ self.assertIn("pygame.mouse.get_pressed", state.py_resolve_list)
62
+ self.assertIn("pygame.K_SPACE", state.py_resolve_list)
63
+ self.assertIn("random.randint", state.py_resolve_list)
64
+ self.assertIn("pygame.font.Font", state.py_resolve_list)
@@ -36,7 +36,7 @@ class PyastGenPassTests(TestCaseMicroSuite, AstSyncTestMixin):
36
36
  def test_hodge_podge(self) -> None:
37
37
  """Basic test for pass."""
38
38
  code_gen = jac_file_to_pass(
39
- self.fixture_abs_path("../../../../../../examples/micro/hodge_podge.jac"),
39
+ self.examples_abs_path("micro/hodge_podge.jac"),
40
40
  target=PyastGenPass,
41
41
  )
42
42
 
@@ -45,7 +45,7 @@ class PyastGenPassTests(TestCaseMicroSuite, AstSyncTestMixin):
45
45
  def test_circle_py_ast(self) -> None:
46
46
  """Basic test for pass."""
47
47
  code_gen = jac_file_to_pass(
48
- self.fixture_abs_path("../../../../../../examples/manual_code/circle.jac"),
48
+ self.examples_abs_path("manual_code/circle.jac"),
49
49
  target=PyastGenPass,
50
50
  )
51
51
  import ast as ast3
@@ -15,9 +15,7 @@ class SubNodePassTests(TestCase):
15
15
  def test_sub_node_pass(self) -> None:
16
16
  """Basic test for pass."""
17
17
  code_gen = jac_file_to_pass(
18
- file_path=self.fixture_abs_path(
19
- "../../../../../../examples/manual_code/circle.jac"
20
- ),
18
+ file_path=self.examples_abs_path("manual_code/circle.jac"),
21
19
  target=SubNodeTabPass,
22
20
  )
23
21
  for i in code_gen.ir.kid[1].kid:
@@ -8,6 +8,7 @@ import os
8
8
  import pathlib
9
9
  import sys
10
10
 
11
+ # import jaclang
11
12
  import jaclang.compiler.absyntree as ast
12
13
  import jaclang.compiler.passes.utils.mypy_ast_build as myab
13
14
  from jaclang.compiler.constant import Constants as Con
@@ -93,12 +94,29 @@ class JacTypeCheckPass(Pass):
93
94
  mypy_graph[module.name] = st
94
95
  new_modules.append(st)
95
96
 
97
+ # def get_stub(mod: str) -> myab.BuildSource:
98
+ # """Get stub file path."""
99
+ # return myab.BuildSource(
100
+ # path=str(
101
+ # pathlib.Path(os.path.dirname(jaclang.__file__)).parent
102
+ # / "stubs"
103
+ # / "jaclang"
104
+ # / "plugin"
105
+ # / f"{mod}.pyi"
106
+ # ),
107
+ # module=f"jaclang.plugin.{mod}",
108
+ # )
109
+
96
110
  graph = myab.load_graph(
97
111
  [
98
112
  myab.BuildSource(
99
113
  path=str(self.__path / "typeshed" / "stdlib" / "builtins.pyi"),
100
114
  module="builtins",
101
- )
115
+ ),
116
+ # get_stub("default"),
117
+ # get_stub("feature"),
118
+ # get_stub("spec"),
119
+ # get_stub("builtin"),
102
120
  ],
103
121
  manager,
104
122
  old_graph=mypy_graph,
@@ -3,7 +3,7 @@
3
3
  import ast as ast3
4
4
  from difflib import unified_diff
5
5
 
6
- import jaclang.compiler.absyntree as ast
6
+
7
7
  from jaclang.compiler.compile import jac_file_to_pass, jac_str_to_pass
8
8
  from jaclang.compiler.passes.main import PyastGenPass
9
9
  from jaclang.compiler.passes.main.schedules import py_code_gen as without_format
@@ -18,10 +18,9 @@ class JacUnparseTests(TestCaseMicroSuite, AstSyncTestMixin):
18
18
 
19
19
  def test_double_unparse(self) -> None:
20
20
  """Parse micro jac file."""
21
- filename = "../../../../../../examples/manual_code/circle.jac"
22
21
  try:
23
22
  code_gen_pure = jac_file_to_pass(
24
- self.fixture_abs_path(filename),
23
+ self.examples_abs_path("manual_code/circle.jac"),
25
24
  target=PyastGenPass,
26
25
  schedule=without_format,
27
26
  )
jaclang/core/importer.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  import importlib
4
4
  import marshal
5
+ import os
5
6
  import sys
6
7
  import types
7
8
  from os import getcwd, path
@@ -13,6 +14,121 @@ from jaclang.compiler.constant import Constants as Con
13
14
  from jaclang.core.utils import sys_path_context
14
15
 
15
16
 
17
+ def handle_directory(
18
+ module_name: str, full_mod_path: str, mod_bundle: Module
19
+ ) -> types.ModuleType:
20
+ """Import from a directory that potentially contains multiple Jac modules."""
21
+ module = types.ModuleType(module_name)
22
+ module.__name__ = module_name
23
+ module.__path__ = [full_mod_path]
24
+ module.__dict__["__jac_mod_bundle__"] = mod_bundle
25
+ if module not in sys.modules:
26
+ sys.modules[module_name] = module
27
+ return module
28
+
29
+
30
+ def process_items(
31
+ module: types.ModuleType,
32
+ items: dict[str, Union[str, bool]],
33
+ caller_dir: str,
34
+ mod_bundle: Optional[Module] = None,
35
+ cachable: bool = True,
36
+ ) -> None:
37
+ """Process items within a module by handling renaming and potentially loading missing attributes."""
38
+ module_dir = (
39
+ module.__path__[0]
40
+ if hasattr(module, "__path__")
41
+ else os.path.dirname(getattr(module, "__file__", ""))
42
+ )
43
+ for name, alias in items.items():
44
+ try:
45
+ item = getattr(module, name)
46
+ if alias and alias != name and not isinstance(alias, bool):
47
+ setattr(module, alias, item)
48
+ except AttributeError:
49
+ jac_file_path = os.path.join(module_dir, f"{name}.jac")
50
+ if hasattr(module, "__path__") and os.path.isfile(jac_file_path):
51
+ item = load_jac_file(
52
+ module=module,
53
+ name=name,
54
+ jac_file_path=jac_file_path,
55
+ mod_bundle=mod_bundle,
56
+ cachable=cachable,
57
+ caller_dir=caller_dir,
58
+ )
59
+ if item:
60
+ setattr(module, name, item)
61
+ if alias and alias != name and not isinstance(alias, bool):
62
+ setattr(module, alias, item)
63
+
64
+
65
+ def load_jac_file(
66
+ module: types.ModuleType,
67
+ name: str,
68
+ jac_file_path: str,
69
+ mod_bundle: Optional[Module],
70
+ cachable: bool,
71
+ caller_dir: str,
72
+ ) -> Optional[types.ModuleType]:
73
+ """Load a single .jac file into the specified module component."""
74
+ try:
75
+ package_name = (
76
+ f"{module.__name__}.{name}"
77
+ if hasattr(module, "__path__")
78
+ else module.__name__
79
+ )
80
+ new_module = sys.modules.get(
81
+ package_name,
82
+ create_jac_py_module(mod_bundle, name, module.__name__, jac_file_path),
83
+ )
84
+
85
+ codeobj = get_codeobj(
86
+ full_target=jac_file_path,
87
+ module_name=name,
88
+ mod_bundle=mod_bundle,
89
+ cachable=cachable,
90
+ caller_dir=caller_dir,
91
+ )
92
+ if not codeobj:
93
+ raise ImportError(f"No bytecode found for {jac_file_path}")
94
+
95
+ exec(codeobj, new_module.__dict__)
96
+ return getattr(new_module, name, new_module)
97
+ except ImportError as e:
98
+ print(
99
+ f"Failed to load {name} from {jac_file_path} in {module.__name__}: {str(e)}"
100
+ )
101
+ return None
102
+
103
+
104
+ def get_codeobj(
105
+ full_target: str,
106
+ module_name: str,
107
+ mod_bundle: Optional[Module],
108
+ cachable: bool,
109
+ caller_dir: str,
110
+ ) -> Optional[types.CodeType]:
111
+ """Execcutes the code for a given module."""
112
+ if mod_bundle:
113
+ codeobj = mod_bundle.mod_deps[full_target].gen.py_bytecode
114
+ return marshal.loads(codeobj) if isinstance(codeobj, bytes) else None
115
+ gen_dir = os.path.join(caller_dir, Con.JAC_GEN_DIR)
116
+ pyc_file_path = os.path.join(gen_dir, module_name + ".jbc")
117
+ if cachable and os.path.exists(pyc_file_path):
118
+ with open(pyc_file_path, "rb") as f:
119
+ return marshal.load(f)
120
+
121
+ result = compile_jac(full_target, cache_result=cachable)
122
+ if result.errors_had or not result.ir.gen.py_bytecode:
123
+ for e in result.errors_had:
124
+ print(e)
125
+ return None
126
+ if result.ir.gen.py_bytecode is not None:
127
+ return marshal.loads(result.ir.gen.py_bytecode)
128
+ else:
129
+ return None
130
+
131
+
16
132
  def jac_importer(
17
133
  target: str,
18
134
  base_path: str,
@@ -53,39 +169,46 @@ def jac_importer(
53
169
 
54
170
  if lng == "py":
55
171
  module = py_import(
56
- target=target, items=items, absorb=absorb, mdl_alias=mdl_alias
172
+ target=target,
173
+ items=items,
174
+ absorb=absorb,
175
+ mdl_alias=mdl_alias,
176
+ caller_dir=caller_dir,
57
177
  )
58
178
  else:
59
179
  module_name = override_name if override_name else module_name
60
- module = create_jac_py_module(
61
- valid_mod_bundle, module_name, package_path, full_target
62
- )
63
- if valid_mod_bundle:
64
- codeobj = valid_mod_bundle.mod_deps[full_target].gen.py_bytecode
65
- codeobj = marshal.loads(codeobj) if isinstance(codeobj, bytes) else None
66
- else:
67
- gen_dir = path.join(caller_dir, Con.JAC_GEN_DIR)
68
- pyc_file_path = path.join(gen_dir, module_name + ".jbc")
69
- if (
70
- cachable
71
- and path.exists(pyc_file_path)
72
- and path.getmtime(pyc_file_path) > path.getmtime(full_target)
73
- ):
74
- with open(pyc_file_path, "rb") as f:
75
- codeobj = marshal.load(f)
76
- else:
77
- result = compile_jac(full_target, cache_result=cachable)
78
- if result.errors_had or not result.ir.gen.py_bytecode:
79
- # for e in result.errors_had:
80
- # print(e)
81
- return None
82
- else:
83
- codeobj = marshal.loads(result.ir.gen.py_bytecode)
84
- if not codeobj:
85
- raise ImportError(f"No bytecode found for {full_target}")
86
- with sys_path_context(caller_dir):
87
- exec(codeobj, module.__dict__)
88
180
 
181
+ if os.path.isdir(path.splitext(full_target)[0]):
182
+ module = handle_directory(
183
+ module_name, path.splitext(full_target)[0], valid_mod_bundle
184
+ )
185
+ if items:
186
+ process_items(
187
+ module,
188
+ items,
189
+ caller_dir,
190
+ mod_bundle=valid_mod_bundle,
191
+ cachable=cachable,
192
+ )
193
+ else:
194
+ module = create_jac_py_module(
195
+ valid_mod_bundle, module_name, package_path, full_target
196
+ )
197
+ codeobj = get_codeobj(
198
+ full_target=full_target,
199
+ module_name=module_name,
200
+ mod_bundle=valid_mod_bundle,
201
+ cachable=cachable,
202
+ caller_dir=caller_dir,
203
+ )
204
+ try:
205
+ if not codeobj:
206
+ raise ImportError(f"No bytecode found for {full_target}")
207
+ with sys_path_context(caller_dir):
208
+ exec(codeobj, module.__dict__)
209
+ except Exception as e:
210
+ print(f"Error importing {full_target}: {str(e)}")
211
+ return None
89
212
  return module
90
213
 
91
214
 
@@ -129,14 +252,25 @@ def get_caller_dir(target: str, base_path: str, dir_path: str) -> str:
129
252
 
130
253
  def py_import(
131
254
  target: str,
255
+ caller_dir: str,
132
256
  items: Optional[dict[str, Union[str, bool]]] = None,
133
257
  absorb: bool = False,
134
258
  mdl_alias: Optional[str] = None,
135
259
  ) -> types.ModuleType:
136
260
  """Import a Python module."""
137
261
  try:
138
- target = target.lstrip(".") if target.startswith("..") else target
139
- imported_module = importlib.import_module(name=target)
262
+ if target.startswith("."):
263
+ target = target.lstrip(".")
264
+ full_target = path.normpath(path.join(caller_dir, target))
265
+ spec = importlib.util.spec_from_file_location(target, full_target + ".py")
266
+ if spec and spec.loader:
267
+ imported_module = importlib.util.module_from_spec(spec)
268
+ sys.modules[spec.name] = imported_module
269
+ spec.loader.exec_module(imported_module)
270
+ else:
271
+ raise ImportError(f"Cannot find module {target} at {full_target}")
272
+ else:
273
+ imported_module = importlib.import_module(name=target)
140
274
  main_module = __import__("__main__")
141
275
  if absorb:
142
276
  for name in dir(imported_module):
@@ -2,7 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import asyncio
5
6
  import logging
7
+ from concurrent.futures import ThreadPoolExecutor
6
8
  from enum import IntEnum
7
9
  from typing import Optional
8
10
 
@@ -60,21 +62,35 @@ class ModuleInfo:
60
62
  """Return uri."""
61
63
  return uris.from_fs_path(self.ir.loc.mod_path)
62
64
 
63
- @property
64
- def has_syntax_error(self) -> bool:
65
- """Return if there are syntax errors."""
66
- return len(self.errors) > 0 and self.alev == ALev.QUICK
67
-
68
- def update_with(self, new_info: ModuleInfo, refresh: bool = False) -> None:
65
+ def update_with(
66
+ self,
67
+ build: Pass,
68
+ alev: ALev,
69
+ refresh: bool = False,
70
+ mod_override: Optional[ast.Module] = None,
71
+ ) -> None:
69
72
  """Update module info."""
70
- self.ir = new_info.ir
73
+ target_mod = mod_override if mod_override else build.ir
74
+ if not isinstance(target_mod, ast.Module):
75
+ return
76
+ self.ir = target_mod # if alev > ALev.QUICK else self.ir
71
77
  if refresh:
72
- self.errors = new_info.errors
73
- self.warnings = new_info.warnings
78
+ self.errors = build.errors_had
79
+ self.warnings = build.warnings_had
74
80
  else:
75
- self.errors += [i for i in new_info.errors if i not in self.errors]
76
- self.warnings += [i for i in new_info.warnings if i not in self.warnings]
77
- self.alev = new_info.alev
81
+ self.errors += [
82
+ i
83
+ for i in build.errors_had
84
+ if i not in self.errors
85
+ if i.loc.mod_path == target_mod.loc.mod_path
86
+ ]
87
+ self.warnings += [
88
+ i
89
+ for i in build.warnings_had
90
+ if i not in self.warnings
91
+ if i.loc.mod_path == target_mod.loc.mod_path
92
+ ]
93
+ self.alev = alev
78
94
  self.diagnostics = self.gen_diagnostics()
79
95
  if self.alev == ALev.TYPE:
80
96
  self.sem_tokens = self.gen_sem_tokens()
@@ -126,8 +142,9 @@ class JacLangServer(LanguageServer):
126
142
  """Initialize workspace."""
127
143
  super().__init__("jac-lsp", "v0.1")
128
144
  self.modules: dict[str, ModuleInfo] = {}
145
+ self.executor = ThreadPoolExecutor()
129
146
 
130
- def push_diagnostics(self, file_path: str) -> None:
147
+ async def push_diagnostics(self, file_path: str) -> None:
131
148
  """Push diagnostics for a file."""
132
149
  if file_path in self.modules:
133
150
  self.publish_diagnostics(
@@ -155,36 +172,36 @@ class JacLangServer(LanguageServer):
155
172
  if not isinstance(build.ir, ast.Module):
156
173
  self.log_error("Error with module build.")
157
174
  return
158
- new_mod = ModuleInfo(
159
- ir=build.ir,
160
- errors=[
161
- i
162
- for i in build.errors_had
163
- if i.loc.mod_path == uris.to_fs_path(file_path)
164
- ],
165
- warnings=[
166
- i
167
- for i in build.warnings_had
168
- if i.loc.mod_path == uris.to_fs_path(file_path)
169
- ],
170
- alev=alev,
171
- )
172
175
  if file_path in self.modules:
173
- self.modules[file_path].update_with(new_mod, refresh=refresh)
176
+ self.modules[file_path].update_with(build, alev, refresh=refresh)
174
177
  else:
175
- self.modules[file_path] = new_mod
176
- for p in build.ir.mod_deps.keys():
177
- uri = uris.from_fs_path(p)
178
- new_mod = ModuleInfo(
179
- ir=build.ir.mod_deps[p],
180
- errors=[i for i in build.errors_had if i.loc.mod_path == p],
181
- warnings=[i for i in build.warnings_had if i.loc.mod_path == p],
178
+ self.modules[file_path] = ModuleInfo(
179
+ ir=build.ir,
180
+ errors=[
181
+ i
182
+ for i in build.errors_had
183
+ if i.loc.mod_path == uris.to_fs_path(file_path)
184
+ ],
185
+ warnings=[
186
+ i
187
+ for i in build.warnings_had
188
+ if i.loc.mod_path == uris.to_fs_path(file_path)
189
+ ],
182
190
  alev=alev,
183
191
  )
192
+ for p in build.ir.mod_deps.keys():
193
+ uri = uris.from_fs_path(p)
184
194
  if not refresh and uri in self.modules:
185
- self.modules[uri].update_with(new_mod)
195
+ self.modules[uri].update_with(
196
+ build, alev, mod_override=build.ir.mod_deps[p], refresh=refresh
197
+ )
186
198
  else:
187
- self.modules[uri] = new_mod
199
+ self.modules[uri] = ModuleInfo(
200
+ ir=build.ir.mod_deps[p],
201
+ errors=[i for i in build.errors_had if i.loc.mod_path == p],
202
+ warnings=[i for i in build.warnings_had if i.loc.mod_path == p],
203
+ alev=alev,
204
+ )
188
205
  self.modules[uri].parent = (
189
206
  self.modules[file_path] if file_path != uri else None
190
207
  )
@@ -230,17 +247,23 @@ class JacLangServer(LanguageServer):
230
247
  self.update_modules(file_path, build, ALev.TYPE)
231
248
  return len(self.modules[file_path].errors) == 0
232
249
 
233
- def analyze_and_publish(self, uri: str, level: int = 2) -> None:
250
+ async def analyze_and_publish(self, uri: str, level: int = 2) -> None:
234
251
  """Analyze and publish diagnostics."""
235
252
  self.log_py(f"Analyzing {uri}...")
236
- success = self.quick_check(uri)
237
- self.push_diagnostics(uri)
253
+ success = await asyncio.get_event_loop().run_in_executor(
254
+ self.executor, self.quick_check, uri
255
+ )
256
+ await self.push_diagnostics(uri)
238
257
  if success and level > 0:
239
- success = self.deep_check(uri)
240
- self.push_diagnostics(uri)
258
+ success = await asyncio.get_event_loop().run_in_executor(
259
+ self.executor, self.deep_check, uri
260
+ )
261
+ await self.push_diagnostics(uri)
241
262
  if level > 1:
242
- self.type_check(uri)
243
- self.push_diagnostics(uri)
263
+ await asyncio.get_event_loop().run_in_executor(
264
+ self.executor, self.type_check, uri
265
+ )
266
+ await self.push_diagnostics(uri)
244
267
 
245
268
  def get_completion(
246
269
  self, file_path: str, position: lspt.Position
@@ -338,7 +361,9 @@ class JacLangServer(LanguageServer):
338
361
 
339
362
  def get_document_symbols(self, file_path: str) -> list[lspt.DocumentSymbol]:
340
363
  """Return document symbols for a file."""
341
- if root_node := self.modules[file_path].ir._sym_tab:
364
+ if file_path in self.modules and (
365
+ root_node := self.modules[file_path].ir._sym_tab
366
+ ):
342
367
  return collect_symbols(root_node)
343
368
  return []
344
369
 
@@ -410,6 +435,24 @@ class JacLangServer(LanguageServer):
410
435
  else:
411
436
  return None
412
437
 
438
+ def get_references(
439
+ self, file_path: str, position: lspt.Position
440
+ ) -> list[lspt.Location]:
441
+ """Return references for a file."""
442
+ node_selected = find_deepest_symbol_node_at_pos(
443
+ self.modules[file_path].ir, position.line, position.character
444
+ )
445
+ if node_selected and node_selected.sym:
446
+ list_of_references: list[lspt.Location] = [
447
+ lspt.Location(
448
+ uri=uris.from_fs_path(node.loc.mod_path),
449
+ range=create_range(node.loc),
450
+ )
451
+ for node in node_selected.sym.uses
452
+ ]
453
+ return list_of_references
454
+ return []
455
+
413
456
  def get_semantic_tokens(self, file_path: str) -> lspt.SemanticTokens:
414
457
  """Return semantic tokens for a file."""
415
458
  if file_path not in self.modules:
@@ -18,21 +18,28 @@ server = JacLangServer()
18
18
 
19
19
  @server.feature(lspt.TEXT_DOCUMENT_DID_OPEN)
20
20
  @server.feature(lspt.TEXT_DOCUMENT_DID_SAVE)
21
- def did_open(ls: JacLangServer, params: lspt.DidOpenTextDocumentParams) -> None:
21
+ async def did_open(ls: JacLangServer, params: lspt.DidOpenTextDocumentParams) -> None:
22
22
  """Check syntax on change."""
23
- ls.analyze_and_publish(params.text_document.uri)
24
- # token_params = lspt.SemanticTokensParams(
25
- # text_document=lspt.TextDocumentIdentifier(uri=params.text_document.uri)
26
- # )
27
- # tokens = semantic_tokens_full(ls, token_params)
28
- # ls.send_notification("textDocument/publishSemanticTokens", tokens)
23
+ await ls.analyze_and_publish(params.text_document.uri)
24
+ ls.lsp.send_request(lspt.WORKSPACE_SEMANTIC_TOKENS_REFRESH)
29
25
 
30
26
 
31
27
  @server.feature(lspt.TEXT_DOCUMENT_DID_CHANGE)
32
- @debounce(0.1)
33
- async def did_change(ls: JacLangServer, params: lspt.DidOpenTextDocumentParams) -> None:
28
+ @debounce(0.3)
29
+ async def did_change(
30
+ ls: JacLangServer, params: lspt.DidChangeTextDocumentParams
31
+ ) -> None:
34
32
  """Check syntax on change."""
35
- ls.analyze_and_publish(params.text_document.uri, level=0)
33
+ await ls.analyze_and_publish(params.text_document.uri, level=1)
34
+ ls.lsp.send_request(lspt.WORKSPACE_SEMANTIC_TOKENS_REFRESH)
35
+
36
+
37
+ @server.feature(lspt.TEXT_DOCUMENT_FORMATTING)
38
+ def formatting(
39
+ ls: JacLangServer, params: lspt.DocumentFormattingParams
40
+ ) -> list[lspt.TextEdit]:
41
+ """Format the given document."""
42
+ return ls.formatted_jac(params.text_document.uri)
36
43
 
37
44
 
38
45
  @server.feature(
@@ -86,14 +93,6 @@ def completion(ls: JacLangServer, params: lspt.CompletionParams) -> lspt.Complet
86
93
  return ls.get_completion(params.text_document.uri, params.position)
87
94
 
88
95
 
89
- @server.feature(lspt.TEXT_DOCUMENT_FORMATTING)
90
- def formatting(
91
- ls: JacLangServer, params: lspt.DocumentFormattingParams
92
- ) -> list[lspt.TextEdit]:
93
- """Format the given document."""
94
- return ls.formatted_jac(params.text_document.uri)
95
-
96
-
97
96
  @server.feature(lspt.TEXT_DOCUMENT_HOVER, lspt.HoverOptions(work_done_progress=True))
98
97
  def hover(
99
98
  ls: JacLangServer, params: lspt.TextDocumentPositionParams
@@ -118,6 +117,12 @@ def definition(
118
117
  return ls.get_definition(params.text_document.uri, params.position)
119
118
 
120
119
 
120
+ @server.feature(lspt.TEXT_DOCUMENT_REFERENCES)
121
+ def references(ls: JacLangServer, params: lspt.ReferenceParams) -> list[lspt.Location]:
122
+ """Provide references."""
123
+ return ls.get_references(params.text_document.uri, params.position)
124
+
125
+
121
126
  @server.feature(
122
127
  lspt.TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL,
123
128
  lspt.SemanticTokensLegend(
@@ -121,9 +121,7 @@ class TestJacLangServer(TestCase):
121
121
  workspace_path = self.fixture_abs_path("")
122
122
  workspace = Workspace(workspace_path, lsp)
123
123
  lsp.lsp._workspace = workspace
124
- target = uris.from_fs_path(
125
- self.fixture_abs_path("../../../../examples/guess_game/guess_game4.jac")
126
- )
124
+ target = uris.from_fs_path(self.examples_abs_path("guess_game/guess_game4.jac"))
127
125
  lsp.quick_check(target)
128
126
  lsp.deep_check(target)
129
127
  lsp.type_check(target)
@@ -171,7 +169,7 @@ class TestJacLangServer(TestCase):
171
169
  workspace = Workspace(workspace_path, lsp)
172
170
  lsp.lsp._workspace = workspace
173
171
  guess_game_file = uris.from_fs_path(
174
- self.fixture_abs_path("../../../../examples/guess_game/guess_game4.jac")
172
+ self.examples_abs_path("guess_game/guess_game4.jac")
175
173
  )
176
174
  lsp.quick_check(guess_game_file)
177
175
  lsp.deep_check(guess_game_file)
@@ -264,3 +262,23 @@ class TestJacLangServer(TestCase):
264
262
  ]
265
263
  for token_type, expected_count in expected_counts:
266
264
  self.assertEqual(str(sem_list).count(token_type), expected_count)
265
+
266
+ def test_go_to_reference(self) -> None:
267
+ """Test that the go to reference is correct."""
268
+ lsp = JacLangServer()
269
+ workspace_path = self.fixture_abs_path("")
270
+ workspace = Workspace(workspace_path, lsp)
271
+ lsp.lsp._workspace = workspace
272
+ circle_file = uris.from_fs_path(self.fixture_abs_path("circle.jac"))
273
+ lsp.quick_check(circle_file)
274
+ lsp.deep_check(circle_file)
275
+ lsp.type_check(circle_file)
276
+ test_cases = [
277
+ (47, 12, ["circle.jac:47:8-47:14", "69:8-69:14", "74:8-74:14"]),
278
+ (54, 66, ["54:62-54:76", "65:28-65:42"]),
279
+ (62, 14, ["65:49-65:62", "70:38-70:51"]),
280
+ ]
281
+ for line, char, expected_refs in test_cases:
282
+ references = str(lsp.get_references(circle_file, lspt.Position(line, char)))
283
+ for expected in expected_refs:
284
+ self.assertIn(expected, references)
jaclang/plugin/default.py CHANGED
@@ -251,9 +251,10 @@ class JacFeatureDefaults:
251
251
  maxfail: Optional[int],
252
252
  directory: Optional[str],
253
253
  verbose: bool,
254
- ) -> bool:
254
+ ) -> int:
255
255
  """Run the test suite in the specified .jac file."""
256
256
  test_file = False
257
+ ret_count = 0
257
258
  if filepath:
258
259
  if filepath.endswith(".jac"):
259
260
  base, mod_name = os.path.split(filepath)
@@ -262,6 +263,7 @@ class JacFeatureDefaults:
262
263
  JacTestCheck.reset()
263
264
  Jac.jac_import(target=mod_name, base_path=base)
264
265
  JacTestCheck.run_test(xit, maxfail, verbose)
266
+ ret_count = JacTestCheck.failcount
265
267
  else:
266
268
  print("Not a .jac file.")
267
269
  else:
@@ -293,10 +295,11 @@ class JacFeatureDefaults:
293
295
  if JacTestCheck.breaker and (xit or maxfail):
294
296
  break
295
297
  JacTestCheck.breaker = False
298
+ ret_count += JacTestCheck.failcount
296
299
  JacTestCheck.failcount = 0
297
300
  print("No test files found.") if not test_file else None
298
301
 
299
- return True
302
+ return ret_count
300
303
 
301
304
  @staticmethod
302
305
  @hookimpl
jaclang/plugin/feature.py CHANGED
@@ -132,7 +132,7 @@ class JacFeature:
132
132
  maxfail: Optional[int] = None,
133
133
  directory: Optional[str] = None,
134
134
  verbose: bool = False,
135
- ) -> bool:
135
+ ) -> int:
136
136
  """Run the test suite in the specified .jac file."""
137
137
  return pm.hook.run_test(
138
138
  filepath=filepath,
jaclang/plugin/spec.py CHANGED
@@ -121,7 +121,7 @@ class JacFeatureSpec:
121
121
  maxfail: Optional[int],
122
122
  directory: Optional[str],
123
123
  verbose: bool,
124
- ) -> bool:
124
+ ) -> int:
125
125
  """Run the test suite in the specified .jac file."""
126
126
  raise NotImplementedError
127
127
 
jaclang/py.typed ADDED
File without changes
jaclang/settings.py CHANGED
@@ -13,6 +13,7 @@ class Settings:
13
13
  fuse_type_info_debug: bool = False
14
14
  filter_sym_builtins: bool = True
15
15
  ast_symbol_info_detailed: bool = False
16
+ pass_timer: bool = False
16
17
 
17
18
  # Import configuration
18
19
  py_raise: bool = False
@@ -1,6 +1,5 @@
1
- import:jac deeper.snd_lev as snd_lev;
1
+ import:jac from .deeper, snd_lev as snd_lev;
2
2
 
3
- can olprint ->str {
3
+ can olprint -> str {
4
4
  return "one level deeper" + snd_lev.slprint();
5
- }
6
-
5
+ }
jaclang/tests/test_cli.py CHANGED
@@ -219,9 +219,7 @@ class JacCliTests(TestCase):
219
219
  """Test for graph CLI cmd."""
220
220
  captured_output = io.StringIO()
221
221
  sys.stdout = captured_output
222
- cli.dot(
223
- f"{self.fixture_abs_path('../../../examples/reference/connect_expressions.jac')}"
224
- )
222
+ cli.dot(f"{self.examples_abs_path('reference/connect_expressions.jac')}")
225
223
  sys.stdout = sys.__stdout__
226
224
  stdout_value = captured_output.getvalue()
227
225
  if os.path.exists("connect_expressions.dot"):
@@ -62,9 +62,7 @@ class JacLanguageTests(TestCase):
62
62
  """Parse micro jac file."""
63
63
  captured_output = io.StringIO()
64
64
  sys.stdout = captured_output
65
- jac_import(
66
- "micro.simple_walk", base_path=self.fixture_abs_path("../../../examples/")
67
- )
65
+ jac_import("micro.simple_walk", base_path=self.examples_abs_path(""))
68
66
  sys.stdout = sys.__stdout__
69
67
  stdout_value = captured_output.getvalue()
70
68
  self.assertEqual(
@@ -157,7 +155,7 @@ class JacLanguageTests(TestCase):
157
155
  sys.stdout = captured_output
158
156
  jac_import(
159
157
  "reference.special_comprehensions",
160
- base_path=self.fixture_abs_path("../../../examples/"),
158
+ base_path=self.examples_abs_path(""),
161
159
  )
162
160
  sys.stdout = sys.__stdout__
163
161
  stdout_value = captured_output.getvalue()
@@ -389,7 +387,7 @@ class JacLanguageTests(TestCase):
389
387
  sys.stdout = captured_output
390
388
  jac_import(
391
389
  "micro.typed_filter_compr",
392
- base_path=self.fixture_abs_path("../../../examples/"),
390
+ base_path=self.examples_abs_path(""),
393
391
  )
394
392
  sys.stdout = sys.__stdout__
395
393
  stdout_value = captured_output.getvalue()
@@ -602,9 +600,7 @@ class JacLanguageTests(TestCase):
602
600
  "ir",
603
601
  [
604
602
  "ast",
605
- self.fixture_abs_path(
606
- "../../../examples/reference/collection_values.jac"
607
- ),
603
+ self.examples_abs_path("reference/collection_values.jac"),
608
604
  ],
609
605
  )
610
606
 
@@ -760,7 +756,7 @@ class JacLanguageTests(TestCase):
760
756
  """Test conn assign on edges."""
761
757
  Jac.get_root()._jac_.edges.clear()
762
758
  mypass = jac_file_to_pass(
763
- self.fixture_abs_path("../../../examples/micro/simple_walk.jac"),
759
+ self.examples_abs_path("micro/simple_walk.jac"),
764
760
  schedule=py_code_gen_typed,
765
761
  )
766
762
  self.assertEqual(len(mypass.errors_had), 0)
@@ -770,7 +766,7 @@ class JacLanguageTests(TestCase):
770
766
  """Test conn assign on edges."""
771
767
  Jac.get_root()._jac_.edges.clear()
772
768
  mypass = jac_file_to_pass(
773
- self.fixture_abs_path("../../../examples/guess_game/guess_game5.jac"),
769
+ self.examples_abs_path("guess_game/guess_game5.jac"),
774
770
  schedule=py_code_gen_typed,
775
771
  )
776
772
  self.assertEqual(len(mypass.errors_had), 0)
@@ -803,14 +799,14 @@ class JacLanguageTests(TestCase):
803
799
  def test_single_impl_annex(self) -> None:
804
800
  """Basic test for pass."""
805
801
  mypass = jac_file_to_pass(
806
- self.fixture_abs_path("../../../examples/manual_code/circle_pure.jac"),
802
+ self.examples_abs_path("manual_code/circle_pure.jac"),
807
803
  target=passes.JacImportPass,
808
804
  )
809
805
 
810
806
  self.assertEqual(mypass.ir.pp().count("AbilityDef - (o)Circle.(c)area"), 1)
811
807
  self.assertIsNone(mypass.ir._sym_tab)
812
808
  mypass = jac_file_to_pass(
813
- self.fixture_abs_path("../../../examples/manual_code/circle_pure.jac"),
809
+ self.examples_abs_path("manual_code/circle_pure.jac"),
814
810
  target=passes.SymTabBuildPass,
815
811
  )
816
812
  self.assertEqual(
@@ -821,7 +817,7 @@ class JacLanguageTests(TestCase):
821
817
  def test_inherit_baseclass_sym(self) -> None:
822
818
  """Basic test for symtable support for inheritance."""
823
819
  mypass = jac_file_to_pass(
824
- self.fixture_abs_path("../../../examples/guess_game/guess_game4.jac"),
820
+ self.examples_abs_path("guess_game/guess_game4.jac"),
825
821
  target=passes.DefUsePass,
826
822
  )
827
823
  table = None
@@ -2,6 +2,7 @@
2
2
 
3
3
  import io
4
4
  import sys
5
+ from contextlib import suppress
5
6
 
6
7
  from jaclang.cli import cli
7
8
  from jaclang.utils.test import TestCase
@@ -20,7 +21,7 @@ class JacCliTests(TestCase):
20
21
  sys.stdout = captured_output
21
22
 
22
23
  # Execute the function
23
- cli.run(self.fixture_abs_path("../../../examples/manual_code/circle.jac"))
24
+ cli.run(self.examples_abs_path("manual_code/circle.jac"))
24
25
 
25
26
  sys.stdout = sys.__stdout__
26
27
  stdout_value = captured_output.getvalue()
@@ -43,7 +44,7 @@ class JacCliTests(TestCase):
43
44
  sys.stdout = stdout_block
44
45
 
45
46
  # Execute the function
46
- cli.test(self.fixture_abs_path("../../../examples/manual_code/circle.jac"))
47
+ cli.test(self.examples_abs_path("manual_code/circle.jac"))
47
48
 
48
49
  sys.stderr = sys.__stderr__
49
50
  sys.stdout = sys.__stdout__
@@ -57,7 +58,7 @@ class JacCliTests(TestCase):
57
58
  sys.stdout = captured_output
58
59
 
59
60
  # Execute the function
60
- cli.run(self.fixture_abs_path("../../../examples/manual_code/circle_clean.jac"))
61
+ cli.run(self.examples_abs_path("manual_code/circle_clean.jac"))
61
62
 
62
63
  sys.stdout = sys.__stdout__
63
64
  stdout_value = captured_output.getvalue()
@@ -75,7 +76,7 @@ class JacCliTests(TestCase):
75
76
  sys.stdout = captured_output
76
77
 
77
78
  # Execute the function
78
- cli.run(self.fixture_abs_path("../../../examples/manual_code/circle_pure.jac"))
79
+ cli.run(self.examples_abs_path("manual_code/circle_pure.jac"))
79
80
 
80
81
  sys.stdout = sys.__stdout__
81
82
  stdout_value = captured_output.getvalue()
@@ -96,7 +97,7 @@ class JacCliTests(TestCase):
96
97
  "ir",
97
98
  [
98
99
  "py",
99
- f"{self.fixture_abs_path('../../../examples/manual_code/circle_pure.jac')}",
100
+ f"{self.examples_abs_path('manual_code/circle_pure.jac')}",
100
101
  ],
101
102
  )
102
103
 
@@ -114,11 +115,8 @@ class JacCliTests(TestCase):
114
115
  sys.stdout = stdio_block
115
116
 
116
117
  # Execute the function
117
- cli.test(
118
- self.fixture_abs_path(
119
- "../../../examples/manual_code/circle_clean_tests.jac"
120
- )
121
- )
118
+ with suppress(SystemExit):
119
+ cli.test(self.examples_abs_path("manual_code/circle_clean_tests.jac"))
122
120
 
123
121
  sys.stderr = sys.__stderr__
124
122
  sys.stdout = sys.__stdout__
jaclang/utils/helpers.py CHANGED
@@ -108,12 +108,12 @@ def auto_generate_refs() -> None:
108
108
  heading = heading.strip()
109
109
  heading_snakecase = heading_to_snake(heading)
110
110
  content = (
111
- f'## {heading}\n**Grammar Snippet**\n```yaml linenums="{lines[0]}"\n--8<-- '
112
- f'"jaclang/compiler/jac.lark:{lines[0]}:{lines[1]}"\n```\n'
113
- f'**Code Example**\n=== "Jac"\n ```jac linenums="1"\n --8<-- "examples/reference/'
111
+ f'## {heading}\n**Code Example**\n=== "Jac"\n ```jac linenums="1"\n --8<-- "examples/reference/'
114
112
  f'{heading_snakecase}.jac"\n'
115
113
  f' ```\n=== "Python"\n ```python linenums="1"\n --8<-- "examples/reference/'
116
114
  f'{heading_snakecase}.py"\n ```\n'
115
+ f'??? example "Jac Grammar Snippet"\n ```yaml linenums="{lines[0]}"\n --8<-- '
116
+ f'"jaclang/compiler/jac.lark:{lines[0]}:{lines[1]}"\n ```\n'
117
117
  "**Description**\n\n--8<-- "
118
118
  f'"examples/reference/'
119
119
  f'{heading_snakecase}.md"\n'
jaclang/utils/test.py CHANGED
@@ -52,6 +52,14 @@ class TestCase(_TestCase):
52
52
  file_path = os.path.join(os.path.dirname(fixture_src), "fixtures", fixture)
53
53
  return os.path.abspath(file_path)
54
54
 
55
+ def examples_abs_path(self, example: str) -> str:
56
+ """Get absolute path of a example from examples directory."""
57
+ fixture_src = jaclang.__file__
58
+ file_path = os.path.join(
59
+ os.path.dirname(os.path.dirname(fixture_src)), "examples", example
60
+ )
61
+ return os.path.abspath(file_path)
62
+
55
63
 
56
64
  class TestCaseMicroSuite(TestCase):
57
65
  """Base test case for Jaseci."""
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaclang
3
- Version: 0.7.8
3
+ Version: 0.7.11
4
4
  Summary: Jac is a unique and powerful programming language that runs on top of Python, offering an unprecedented level of intelligence and intuitive understanding.
5
5
  Home-page: https://jaseci.org
6
6
  License: MIT
7
- Keywords: jac,jaclang,programming-language,machine-learning,artificial-intelligence
7
+ Keywords: jac,jaclang,jaseci,python,programming-language,machine-learning,artificial-intelligence
8
8
  Author: Jason Mars
9
9
  Author-email: jason@jaseci.org
10
10
  Requires-Python: >=3.11.0,<4.0.0
@@ -2,24 +2,24 @@ jaclang/__init__.py,sha256=quKqbhKk5CQ0k798jIXMbeAKzQxD0yhOpQGSvYD6TD8,399
2
2
  jaclang/cli/.gitignore,sha256=NYuons2lzuCpCdefMnztZxeSMgtPVJF6R6zSgVDOV20,27
3
3
  jaclang/cli/__init__.py,sha256=7aaPgYddIAHBvkdv36ngbfwsimMnfGaTDcaHYMg_vf4,23
4
4
  jaclang/cli/cli.md,sha256=4BPJGdcyvs_rXgd_DPEGjkKSGe5ureXXYaQsf-_z_LU,5939
5
- jaclang/cli/cli.py,sha256=8CbN_oqMhZ71AJhgA9J0Q551GMO3ey273dgaFPckLyI,13582
5
+ jaclang/cli/cli.py,sha256=LUu53it5DMotyuhY1f28twR3KTR2inhrYyml9Ga00NI,13667
6
6
  jaclang/cli/cmdreg.py,sha256=u0jAd6A8czt7tBgPBBKBhYAG4By1FrjEGaTU2XFKeYs,8372
7
7
  jaclang/compiler/.gitignore,sha256=n1k2_xXTorp9PY8hhYM4psHircn-NMaFx95bSgDKopo,10
8
8
  jaclang/compiler/__init__.py,sha256=P8h-q53h-MTK8Wmvpb7sP5R6Ojz94Y2F9nqMwIUt0d4,3064
9
- jaclang/compiler/absyntree.py,sha256=q3Ma7mGGzPDRoiNEX_H0wJmechx4zGpSYTnYCJpa-WA,134509
9
+ jaclang/compiler/absyntree.py,sha256=Xwkd3sxRmjWobNZEO-UNDmDfSC0wA0ihN-FSRXrZ-1Q,134545
10
10
  jaclang/compiler/codeloc.py,sha256=YhJcHjhMCOT6mV1qLehwriuFgW0H2-ntq68k_r8yBs4,2800
11
11
  jaclang/compiler/compile.py,sha256=0d8p4i2LXg2RCu1XfWx_Jq_dx7pK2Zn2VIj-apvX_nI,3389
12
12
  jaclang/compiler/constant.py,sha256=n4KaEkvnb9-KVJJVvxiWimhjbrOiknBvLHAVDBFbF7Y,8991
13
13
  jaclang/compiler/jac.lark,sha256=Vu14pEa9HObGQCHCGFhIdq__yA3W0-cKAX53NZc--xM,17204
14
14
  jaclang/compiler/parser.py,sha256=RccqG82EqkDdfi0n-4BB34Dh80EYINWy36jX8Ntklhw,140235
15
15
  jaclang/compiler/passes/__init__.py,sha256=0Tw0d130ZjzA05jVcny9cf5NfLjlaM70PKqFnY4zqn4,69
16
- jaclang/compiler/passes/ir_pass.py,sha256=gh1Zd8ouu79FoxerW1sMxktmfeC9gHyp4H_MoAviYP8,5504
16
+ jaclang/compiler/passes/ir_pass.py,sha256=rNB3aHffPkX6HOeVAZgXwabNY1t9dWFr1xp6XgfNSok,5823
17
17
  jaclang/compiler/passes/main/__init__.py,sha256=YSWVNkgnJKF32LpJwX__FwvYrpTSoxFqvnw410WrhkA,947
18
18
  jaclang/compiler/passes/main/access_modifier_pass.py,sha256=fvmvU_V72Zby8fiBnVESinAYFII5qJWKYXtmn4JAChA,5140
19
19
  jaclang/compiler/passes/main/def_impl_match_pass.py,sha256=yAkwLQm2NBJycJVSmG88Shq0r2GSxTH8goINDfGIHek,4583
20
20
  jaclang/compiler/passes/main/def_use_pass.py,sha256=68Uts_v-R-9mzBXC9EfXpcBEQwqnVcpL2JD0sri88AY,9674
21
21
  jaclang/compiler/passes/main/fuse_typeinfo_pass.py,sha256=-Ubaxk_5Tm4e09pDiTk0U-vZqUIZRzffLBw4yT2pOVo,18187
22
- jaclang/compiler/passes/main/import_pass.py,sha256=18Lf8oC66Q2TmpKPjk-tY2a9kUtbssG_z4VU8RZLD_0,10374
22
+ jaclang/compiler/passes/main/import_pass.py,sha256=r7y-G3hyf1Cu8nuV5tkre6_kZfSNTzs3VZ84wlokjMs,10944
23
23
  jaclang/compiler/passes/main/pyast_gen_pass.py,sha256=b0LHAeJbyZXDyqBD38oenar_HuR8urZGlW9SLaNYO2E,139978
24
24
  jaclang/compiler/passes/main/pyast_load_pass.py,sha256=UJyoSpz_QHN0yX7RIubVQ-GjQxcVSkyueDxlwK6Qv-w,93127
25
25
  jaclang/compiler/passes/main/pybc_gen_pass.py,sha256=CjA9AqyMO3Pv_b5Hh0YI6JmCqIru2ASonO6rhrkau-M,1336
@@ -53,16 +53,16 @@ jaclang/compiler/passes/main/tests/fixtures/registry.jac,sha256=1G6amtU1zIFCgq09
53
53
  jaclang/compiler/passes/main/tests/fixtures/type_info.jac,sha256=64Im2L-R3YF8DEuTt29QE6mJI5PnFe3PiwcDLKa8gOE,661
54
54
  jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py,sha256=zWF2l93RjyG0AWyDXdXsMlPWYOhX46d699YqvIETRGY,1836
55
55
  jaclang/compiler/passes/main/tests/test_def_use_pass.py,sha256=0ieyoeiDSK2m3dmVN00oJK2TdJhxWwxA1lnxT95wz0A,843
56
- jaclang/compiler/passes/main/tests/test_import_pass.py,sha256=qHz3IHJmFmTKpP_stU-Nhs9-1spR_04KddUSWdD5bl4,2073
56
+ jaclang/compiler/passes/main/tests/test_import_pass.py,sha256=I7Y1p6PPqnXjpd9UpSILxAiWRdURis3qR-Y5LFzzG9o,2717
57
57
  jaclang/compiler/passes/main/tests/test_pyast_build_pass.py,sha256=LIT4TP-nhtftRtY5rNySRQlim-dWMSlkfUvkhZTk4pc,1383
58
- jaclang/compiler/passes/main/tests/test_pyast_gen_pass.py,sha256=fNL_FS26AQGlRCvwWfl-Qyt7iW2_A99GIHOAnnkpw9A,4731
58
+ jaclang/compiler/passes/main/tests/test_pyast_gen_pass.py,sha256=6ZpLNYxblzBg6bmWSA0fikNM7nEAR9b9F18LJaO5buM,4679
59
59
  jaclang/compiler/passes/main/tests/test_pybc_gen_pass.py,sha256=If8PE4exN5g9o1NRElNC0XdfIwJAp7M7f69rzmYRYUQ,655
60
60
  jaclang/compiler/passes/main/tests/test_registry_pass.py,sha256=Eed94qPmO38GFVV4DARx6G0xaawAoncWfgSHja1wPeQ,1162
61
- jaclang/compiler/passes/main/tests/test_sub_node_pass.py,sha256=I8m2SM2Z-OJkRG3CfpzhZkxh4lrKNtFmcu6UuYzZpY0,877
61
+ jaclang/compiler/passes/main/tests/test_sub_node_pass.py,sha256=afz0Kh5xBCeNXQSI9FNHTewI2r5HO19-JxNGK_NZ01E,821
62
62
  jaclang/compiler/passes/main/tests/test_sym_tab_build_pass.py,sha256=85mUM6mYYLCrQ9AivBIbreG7CgdsJH2zrNOqdcpnwBo,730
63
63
  jaclang/compiler/passes/main/tests/test_type_check_pass.py,sha256=v2_KmcyX1_fOpReRKM0mUnlFXKVPRvFCMR3Mw9ftytI,2265
64
64
  jaclang/compiler/passes/main/tests/test_typeinfo_pass.py,sha256=ehC0_giLg7NwB7fR10nW5Te8mZ76qmUFxkK1bEjtmrw,129
65
- jaclang/compiler/passes/main/type_check_pass.py,sha256=ER2GXi_B0qRD31p224yAI9b3PZeSRLAXkpfFa1oq1C4,3440
65
+ jaclang/compiler/passes/main/type_check_pass.py,sha256=TyVC3jmuxMvG8Fo4TbceMnRSgZxX98m65cfMh10C5O8,4073
66
66
  jaclang/compiler/passes/tool/__init__.py,sha256=xekCOXysHIcthWm8NRmQoA1Ah1XV8vFbkfeHphJtUdc,223
67
67
  jaclang/compiler/passes/tool/fuse_comments_pass.py,sha256=N9a84qArNuTXX1iaXsBzqcufx6A3zYq2p-1ieH6FmHc,3133
68
68
  jaclang/compiler/passes/tool/jac_formatter_pass.py,sha256=yqq2OOSs2tlDKUnPe0GS3NAZh8F5fquA5ZTYw44QX08,87356
@@ -100,7 +100,7 @@ jaclang/compiler/passes/tool/tests/fixtures/simple_walk.jac,sha256=6jwYKXxJ1B4Vf
100
100
  jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac,sha256=6jwYKXxJ1B4VfYDFlQhStN3_QX7dDXzC2gI6U9-KhZM,806
101
101
  jaclang/compiler/passes/tool/tests/test_fuse_comments_pass.py,sha256=ZeWHsm7VIyyS8KKpoB2SdlHM4jF22fMfSrfTfxt2MQw,398
102
102
  jaclang/compiler/passes/tool/tests/test_jac_format_pass.py,sha256=AKGBEz02bS9REJuryZlPvY2avE_XWqKV8sRrnh5hu2g,6101
103
- jaclang/compiler/passes/tool/tests/test_unparse_validate.py,sha256=sIBDl35Cns6vv200GsKyLBbIggKKV2tDy4gq_J8zf6E,2768
103
+ jaclang/compiler/passes/tool/tests/test_unparse_validate.py,sha256=rySW9ppDvnOqgF_B6kC4qRvXwfGErs6rOGXl4iULw-U,2674
104
104
  jaclang/compiler/passes/transform.py,sha256=GEHK3zFWrEjbAQ3mIl3D59jBuIrA8DRbw9t_IlUqg3M,2297
105
105
  jaclang/compiler/passes/utils/__init__.py,sha256=UsI5rUopTUiStAzup4kbPwIwrnC5ofCrqWBCBbM2-k4,35
106
106
  jaclang/compiler/passes/utils/mypy_ast_build.py,sha256=aPvvdGSwbOGHYiK5kY665bqtfjj7s2YfTONV4EuLai8,26162
@@ -121,13 +121,13 @@ jaclang/core/__init__.py,sha256=jDDYBCV82qPhmcDVk3NIvHbhng0ebSrXD3xrojg0-eo,34
121
121
  jaclang/core/architype.py,sha256=qBH0W-ALxmK6DALc4_S7gx-3R7C_6o-PGKb3f4RbWbE,16781
122
122
  jaclang/core/constructs.py,sha256=ogWc95DEZxQWoxqsfbRrcmt9ldGDqW7zQVu3DWuIAKs,848
123
123
  jaclang/core/context.py,sha256=AxGsra9EqokVdOhwIxR9RuAcnm0HmobUnMBezUBY1_s,4774
124
- jaclang/core/importer.py,sha256=CReQhfVak0kUT-UB2Q_g023hR_JpyNl-uA91pZeDNXs,6324
124
+ jaclang/core/importer.py,sha256=ToJxybB7Al0mZBstCY3n-vMDOH8MCDwzWcbFxULqHSY,10873
125
125
  jaclang/core/memory.py,sha256=7QukfL6wDBXrdpRn01yu4RMNkmIMNqFiKrI0zfpGSy4,2947
126
126
  jaclang/core/test.py,sha256=HRCl3cf0uPTe58Kcx_sBUb6ow8J53rnmpFOhA7g9oAA,2851
127
127
  jaclang/core/utils.py,sha256=uzEsRSuNSMMo7dlvCozGv0TnpUmHEjGNzUTZt1Df2gQ,7741
128
128
  jaclang/langserve/__init__.py,sha256=3qbnivBBcLZCfmDYRMIeKkG08Lx7XQsJJg-qG8TU8yc,51
129
- jaclang/langserve/engine.py,sha256=oo9IvUFTKxpfk65sk2ExRBEhN0y2PzFTLrTNF0rxMeE,16289
130
- jaclang/langserve/server.py,sha256=XGg9AfGiY17DvVGLQ-O228OwdvSsKaqdhnsiYxVgwew,4368
129
+ jaclang/langserve/engine.py,sha256=PCv429zeeS_7WQK4CEBis08ylMpWaD8Os1166_G4jDY,17892
130
+ jaclang/langserve/server.py,sha256=h--EqQVJmh-2viIZl5uBRK8Z-iYSYkmDlVIFpJ-eNYA,4496
131
131
  jaclang/langserve/tests/__init__.py,sha256=iDM47k6c3vahaWhwxpbkdEOshbmX-Zl5x669VONjS2I,23
132
132
  jaclang/langserve/tests/defaults.py,sha256=8UWHuCHY-WatPcWFhyX9-4KLuJgODTlLNj0wNnKomIM,7608
133
133
  jaclang/langserve/tests/fixtures/base_module_structure.jac,sha256=gtU3Uq0gsJy6G8Dg4IWiL-YSk_LVFAYK4mVEPt5rGpE,515
@@ -147,13 +147,13 @@ jaclang/langserve/tests/pylsp_jsonrpc/endpoint.py,sha256=TxDpWUd-8AGJwdRQN_iiCXY
147
147
  jaclang/langserve/tests/pylsp_jsonrpc/exceptions.py,sha256=NGHeFQawZcjoLUcgDmY3bF7BqZR83g7TmdKyzCmRaKM,2836
148
148
  jaclang/langserve/tests/pylsp_jsonrpc/streams.py,sha256=R80_FvICIkrbdGmNtlemWYaxrr7-XldPgLaASnyv0W8,3332
149
149
  jaclang/langserve/tests/session.py,sha256=3pIRoQjZnsnUWIYnO2SpK7c1PAiHMCFrrStNK2tawRM,9572
150
- jaclang/langserve/tests/test_server.py,sha256=Bmllojot7c40rq0mDMOAiOyowY0-ECh_qAJtCZV_8Q0,11102
150
+ jaclang/langserve/tests/test_server.py,sha256=Bcly3KKiJ6kF6lPeZ0nDhdWE3p_vgFhuqU5InpIgk64,11953
151
151
  jaclang/langserve/utils.py,sha256=JS_XxDAtqTO4r0wSQjxgGqHwx9xTN_JZpNI1YP-kgbY,9868
152
152
  jaclang/plugin/__init__.py,sha256=5t2krHKt_44PrCTGojzxEimxpNHYVQcn89jAiCSXE_k,165
153
153
  jaclang/plugin/builtin.py,sha256=MEMPUnj_rlwcCNmUkfH5S8iazMnQ6fpp6tls4fh5z7k,1188
154
- jaclang/plugin/default.py,sha256=PBRhDnMChwLbV-Mzuy5Uss1ziRZ3UNCnGfOb1D6fOP4,23533
155
- jaclang/plugin/feature.py,sha256=fhyQRNYOkcXlYn1ObFPqdOHPhtC_lGQfgd7RD2ooLUY,9792
156
- jaclang/plugin/spec.py,sha256=CMu6rzi94eIZaqsFz3NIbN3upJgGneb4FE_7Rly7slE,8893
154
+ jaclang/plugin/default.py,sha256=QF-ITQrpr_8zpX6P7PCuvD0CxPteY_EsEwDZSiUiSEA,23658
155
+ jaclang/plugin/feature.py,sha256=V1-Zis7DwLK1QrL1h89Dk_M45hNe5iyISE37PR_aFKU,9791
156
+ jaclang/plugin/spec.py,sha256=WjqNywrQYR8aSVa47Kx2RqgTFDfvWe2vydNIjxysy5M,8892
157
157
  jaclang/plugin/tests/__init__.py,sha256=rn_tNG8jCHWwBc_rx4yFkGc4N1GISb7aPuTFVRTvrTk,38
158
158
  jaclang/plugin/tests/fixtures/impl_match.jac,sha256=WEhcA1GlovusITEFO2bOjYYqiiULyYGKhM17uK2GqnI,91
159
159
  jaclang/plugin/tests/fixtures/impl_match_impl.jac,sha256=k1385r7Hdlq6mUKxEHa3VOKJUIWH08hYg2kErhbYwFM,31
@@ -161,7 +161,8 @@ jaclang/plugin/tests/fixtures/simple_node_connection.jac,sha256=KdbpACWtnj92TqQq
161
161
  jaclang/plugin/tests/fixtures/simple_persistent.jac,sha256=o0TZTOJEZjFW8A2IGY8ICBZEBZzHhqha0xQFFBK_DSI,624
162
162
  jaclang/plugin/tests/test_features.py,sha256=p0N5inZn92Cj0eqslmDR0-q6pVG8hkcQfA6CuQcfP3Y,2352
163
163
  jaclang/plugin/tests/test_jaseci.py,sha256=XcVL-FOZMTsjJEZqCa-rcYyEPl1dxdFFu9vhvm8kUaI,7956
164
- jaclang/settings.py,sha256=7rKy_kQkWjciwBoWHoJVYrK0nxLwaG54FFvFLOGGggk,3375
164
+ jaclang/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
+ jaclang/settings.py,sha256=woT2v-xh3Mh_haOoefQlRddOYDkalwGGlQJVSvBkmAc,3404
165
166
  jaclang/tests/fixtures/abc.jac,sha256=AWzRxTBjvQwoLSOakjn0kKXWqKvDaUYGc1zmBk1Nd5c,1770
166
167
  jaclang/tests/fixtures/access_checker.jac,sha256=6Inm14cZsyMfezFRs2zfnQEZSE_JRxVvytcZbox7BNw,375
167
168
  jaclang/tests/fixtures/access_modifier.jac,sha256=bxiPlbqm4zPXdMIeTR0-LhjO6c-LS7fW_fGuIA7oKWI,945
@@ -178,7 +179,7 @@ jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac,sha256=omdlOBM0cuUAHhmx
178
179
  jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac,sha256=YlAclVAukzVeCNbXZU6iTl8Rj1uXpUJ1WR7Ei2vhbqc,252
179
180
  jaclang/tests/fixtures/deep/deeper/snd_lev.jac,sha256=SRp6Ic-MAgjcbYc090TwiFYsoVoJB4sLTA-Y5JPMpp8,82
180
181
  jaclang/tests/fixtures/deep/mycode.jac,sha256=XP6RdZP90ftdhe5vidttgZhjDcsO4S8rbaVC0cG-e0U,47
181
- jaclang/tests/fixtures/deep/one_lev.jac,sha256=ViaR09OgKCfL-ANjELnfg7yhcXW16Oq1qqdpC62qO4E,113
182
+ jaclang/tests/fixtures/deep/one_lev.jac,sha256=0hLFdq1Oky868YLJKExEV6w3FAKCEdOkg6qHo021lNw,119
182
183
  jaclang/tests/fixtures/deep/one_lev_dup.jac,sha256=ViaR09OgKCfL-ANjELnfg7yhcXW16Oq1qqdpC62qO4E,113
183
184
  jaclang/tests/fixtures/deep/one_lev_dup_py.py,sha256=G2k46o37mPhPSskYw7bYdbdq8r0xXVpNbGPWu2_os14,117
184
185
  jaclang/tests/fixtures/deep_convert.jac,sha256=AWmLuqhM8GlOZ5rP2THREzpIpL9v3L9sZWyx07nkeDE,71
@@ -242,16 +243,16 @@ jaclang/tests/fixtures/type_info.jac,sha256=4Cw31ef5gny6IS0kLzgeSO-7ArEH1HgFFFip
242
243
  jaclang/tests/fixtures/walker_override.jac,sha256=Ok58ZAgxuV6aECNxYrjbbyAWSiqIbnly3N3O6cD563o,271
243
244
  jaclang/tests/fixtures/with_context.jac,sha256=cDA_4YWe5UVmQRgcpktzkZ_zsswQpV_T2Otf_rFnPy8,466
244
245
  jaclang/tests/test_bugs.py,sha256=tBPsIlSPqZDIz4QaScNRT-WdGIdJ0uU-aRBWq1XUZ6o,555
245
- jaclang/tests/test_cli.py,sha256=tnqdx8W5jTlsDJYR3713EikJqCbcgWEknEwuRHByvWk,8703
246
- jaclang/tests/test_language.py,sha256=T0DqM3aFjJ5_0oWqKhEkOyY1eruv-uGRgWkjWWcngXE,34671
247
- jaclang/tests/test_man_code.py,sha256=Kq93zg3hEfiouvpWvmfCgR6lDT5RKDp28k5ZaWe1Xeg,4519
246
+ jaclang/tests/test_cli.py,sha256=YoocasJ19pU9HpSB1w-ugV1ONIccoF0AFln5EgRpSSk,8664
247
+ jaclang/tests/test_language.py,sha256=T2NawObRbnOMUHp-JofNB-QSp1O5hpVOlNlMdE0qfdM,34458
248
+ jaclang/tests/test_man_code.py,sha256=cKSgTTDl1_Ojhz71X9n2gh0hP4jIa0uQeQeG29LuX9I,4436
248
249
  jaclang/tests/test_reference.py,sha256=FoZQS-U9teiag8mAmX5X6ak4fuCOv00mvOyqJ44Zkc8,3379
249
250
  jaclang/tests/test_settings.py,sha256=TIX5uiu8H9IpZN2__uFiclcdCpBpPpcAwtlEHyFC4kk,1999
250
251
  jaclang/utils/__init__.py,sha256=86LQ_LDyWV-JFkYBpeVHpLaVxkqwFDP60XpWXOFZIQk,46
251
- jaclang/utils/helpers.py,sha256=v-jQ-SDzGLrrLXKxoL1PaCguJqcV-X1UlwjWSL3GNAI,6142
252
+ jaclang/utils/helpers.py,sha256=aPAIj7j_Gqg0DToFj-DEbfea6gIbiBhAEFDtxw-Av4c,6168
252
253
  jaclang/utils/lang_tools.py,sha256=5R-Pe_ylXqWEPXrUGsQ3Vy7rrItf_mbyK19ptFSKiJI,10020
253
254
  jaclang/utils/log.py,sha256=G8Y_DnETgTh9xzvlW5gh9zqJ1ap4YY_MDTwIMu5Uc0Y,262
254
- jaclang/utils/test.py,sha256=Ll3H2l8U2OVQGHAkohsryDXIKSJHJseQSrMHS8JQTiw,5414
255
+ jaclang/utils/test.py,sha256=l2CrsC0umDn0YKukuAO4oWxjOeeP5QK0LgHxjxCjxkY,5743
255
256
  jaclang/utils/tests/__init__.py,sha256=8uwVqMsc6cxBAM1DuHLuNuTnzLXqOqM-WRa4ixOMF6w,23
256
257
  jaclang/utils/tests/test_lang_tools.py,sha256=hFQzkzdmJIhP99xqjR5z7bqkefMLmE6kwldXYrfK--E,4831
257
258
  jaclang/utils/treeprinter.py,sha256=7YPWmtU-gHPN37m9eXqVSqjTy7X_xmUVmBaGcn3p5SM,12663
@@ -1477,7 +1478,7 @@ jaclang/vendor/typing_extensions-4.12.2.dist-info/METADATA,sha256=BeUQIa8cnYbrjW
1477
1478
  jaclang/vendor/typing_extensions-4.12.2.dist-info/RECORD,sha256=XS4fBVrPI7kaNZ56Ggl2RGa76jySWLqTzcrUpZIQTVM,418
1478
1479
  jaclang/vendor/typing_extensions-4.12.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
1479
1480
  jaclang/vendor/typing_extensions.py,sha256=gwekpyG9DVG3lxWKX4ni8u7nk3We5slG98mA9F3DJQw,134451
1480
- jaclang-0.7.8.dist-info/METADATA,sha256=LTPHZdBbBJASj1F0iU9uv1uY49AgOhQaDMxmfQfTYp0,4807
1481
- jaclang-0.7.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1482
- jaclang-0.7.8.dist-info/entry_points.txt,sha256=8sMi4Tvi9f8tQDN2QAXsSA2icO27zQ4GgEdph6bNEZM,49
1483
- jaclang-0.7.8.dist-info/RECORD,,
1481
+ jaclang-0.7.11.dist-info/METADATA,sha256=D4WcvjXZ5wMXmTi7pYgWYt-_G0cpe4tvWYgR-CboZoA,4822
1482
+ jaclang-0.7.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1483
+ jaclang-0.7.11.dist-info/entry_points.txt,sha256=8sMi4Tvi9f8tQDN2QAXsSA2icO27zQ4GgEdph6bNEZM,49
1484
+ jaclang-0.7.11.dist-info/RECORD,,