jaclang 0.7.19__py3-none-any.whl → 0.7.20__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/compiler/absyntree.py +1 -1
- jaclang/compiler/parser.py +1 -1
- jaclang/compiler/passes/main/__init__.py +1 -1
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +50 -13
- jaclang/compiler/passes/main/import_pass.py +27 -0
- jaclang/compiler/passes/main/sym_tab_build_pass.py +0 -18
- jaclang/compiler/passes/main/tests/fixtures/mod_type_assign.jac +7 -0
- jaclang/compiler/passes/main/tests/test_type_check_pass.py +1 -1
- jaclang/compiler/passes/main/tests/test_typeinfo_pass.py +23 -1
- jaclang/compiler/passes/tool/jac_formatter_pass.py +10 -0
- jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/line_spacing.jac +3 -1
- jaclang/compiler/semtable.py +4 -4
- jaclang/compiler/symtable.py +5 -0
- jaclang/langserve/engine.py +64 -6
- jaclang/langserve/tests/test_server.py +1 -1
- jaclang/langserve/utils.py +0 -113
- jaclang/plugin/tests/test_jaseci.py +23 -4
- jaclang/runtimelib/importer.py +2 -0
- jaclang/runtimelib/memory.py +1 -1
- jaclang/stubs/jaclang/__init__.pyi +5 -0
- jaclang/stubs/jaclang/cli/__init__.pyi +0 -0
- jaclang/stubs/jaclang/cli/cli.pyi +58 -0
- jaclang/stubs/jaclang/cli/cmdreg.pyi +32 -0
- jaclang/stubs/jaclang/compiler/__init__.pyi +6 -0
- jaclang/stubs/jaclang/compiler/absyntree.pyi +1248 -0
- jaclang/stubs/jaclang/compiler/codeloc.pyi +45 -0
- jaclang/stubs/jaclang/compiler/compile.pyi +29 -0
- jaclang/stubs/jaclang/compiler/constant.pyi +287 -0
- jaclang/stubs/jaclang/compiler/generated/__init__.pyi +0 -0
- jaclang/stubs/jaclang/compiler/generated/jac_parser.pyi +898 -0
- jaclang/stubs/jaclang/compiler/parser.pyi +266 -0
- jaclang/stubs/jaclang/compiler/passes/__init__.pyi +3 -0
- jaclang/stubs/jaclang/compiler/passes/ir_pass.pyi +40 -0
- jaclang/stubs/jaclang/compiler/passes/main/__init__.pyi +27 -0
- jaclang/stubs/jaclang/compiler/passes/main/access_modifier_pass.pyi +23 -0
- jaclang/stubs/jaclang/compiler/passes/main/def_impl_match_pass.pyi +12 -0
- jaclang/stubs/jaclang/compiler/passes/main/def_use_pass.pyi +31 -0
- jaclang/stubs/jaclang/compiler/passes/main/fuse_typeinfo_pass.pyi +66 -0
- jaclang/stubs/jaclang/compiler/passes/main/import_pass.pyi +34 -0
- jaclang/stubs/jaclang/compiler/passes/main/pyast_gen_pass.pyi +178 -0
- jaclang/stubs/jaclang/compiler/passes/main/pyast_load_pass.pyi +135 -0
- jaclang/stubs/jaclang/compiler/passes/main/pybc_gen_pass.pyi +6 -0
- jaclang/stubs/jaclang/compiler/passes/main/pyjac_ast_link_pass.pyi +22 -0
- jaclang/stubs/jaclang/compiler/passes/main/pyout_pass.pyi +9 -0
- jaclang/stubs/jaclang/compiler/passes/main/registry_pass.pyi +15 -0
- jaclang/stubs/jaclang/compiler/passes/main/schedules.pyi +19 -0
- jaclang/stubs/jaclang/compiler/passes/main/sub_node_tab_pass.pyi +6 -0
- jaclang/stubs/jaclang/compiler/passes/main/sym_tab_build_pass.pyi +147 -0
- jaclang/stubs/jaclang/compiler/passes/main/type_check_pass.pyi +11 -0
- jaclang/stubs/jaclang/compiler/passes/tool/__init__.pyi +4 -0
- jaclang/stubs/jaclang/compiler/passes/tool/fuse_comments_pass.pyi +12 -0
- jaclang/stubs/jaclang/compiler/passes/tool/jac_formatter_pass.pyi +134 -0
- jaclang/stubs/jaclang/compiler/passes/tool/schedules.pyi +11 -0
- jaclang/stubs/jaclang/compiler/passes/transform.pyi +28 -0
- jaclang/stubs/jaclang/compiler/passes/utils/__init__.pyi +0 -0
- jaclang/stubs/jaclang/compiler/passes/utils/mypy_ast_build.pyi +151 -0
- jaclang/stubs/jaclang/compiler/semtable.pyi +35 -0
- jaclang/stubs/jaclang/compiler/symtable.pyi +65 -0
- jaclang/stubs/jaclang/langserve/__init__.pyi +0 -0
- jaclang/stubs/jaclang/langserve/engine.pyi +73 -0
- jaclang/stubs/jaclang/langserve/sem_manager.pyi +89 -0
- jaclang/stubs/jaclang/langserve/server.pyi +38 -0
- jaclang/stubs/jaclang/langserve/utils.pyi +55 -0
- jaclang/stubs/jaclang/plugin/__init__.pyi +3 -0
- jaclang/stubs/jaclang/plugin/builtin.pyi +12 -0
- jaclang/stubs/jaclang/plugin/default.pyi +202 -0
- jaclang/stubs/jaclang/plugin/feature.pyi +176 -0
- jaclang/stubs/jaclang/plugin/spec.pyi +181 -0
- jaclang/stubs/jaclang/runtimelib/__init__.pyi +0 -0
- jaclang/stubs/jaclang/runtimelib/architype.pyi +133 -0
- jaclang/stubs/jaclang/runtimelib/constructs.pyi +41 -0
- jaclang/stubs/jaclang/runtimelib/context.pyi +48 -0
- jaclang/stubs/jaclang/runtimelib/importer.pyi +104 -0
- jaclang/stubs/jaclang/runtimelib/machine.pyi +6 -0
- jaclang/stubs/jaclang/runtimelib/memory.pyi +26 -0
- jaclang/stubs/jaclang/runtimelib/utils.pyi +35 -0
- jaclang/stubs/jaclang/settings.pyi +35 -0
- jaclang/stubs/jaclang/utils/__init__.pyi +0 -0
- jaclang/stubs/jaclang/utils/helpers.pyi +18 -0
- jaclang/stubs/jaclang/utils/lang_tools.pyi +43 -0
- jaclang/stubs/jaclang/utils/log.pyi +3 -0
- jaclang/stubs/jaclang/utils/treeprinter.pyi +47 -0
- jaclang/tests/fixtures/builtins_test.jac +16 -0
- jaclang/tests/fixtures/match_multi_ex.jac +12 -0
- jaclang/tests/test_cli.py +29 -2
- jaclang/tests/test_language.py +10 -0
- jaclang/utils/treeprinter.py +1 -1
- {jaclang-0.7.19.dist-info → jaclang-0.7.20.dist-info}/METADATA +1 -1
- {jaclang-0.7.19.dist-info → jaclang-0.7.20.dist-info}/RECORD +91 -25
- {jaclang-0.7.19.dist-info → jaclang-0.7.20.dist-info}/WHEEL +0 -0
- {jaclang-0.7.19.dist-info → jaclang-0.7.20.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import jaclang.compiler.absyntree as ast
|
|
2
|
+
import lsprotocol.types as lspt
|
|
3
|
+
from jaclang.compiler.codeloc import CodeLocInfo as CodeLocInfo
|
|
4
|
+
from jaclang.compiler.constant import SymbolType as SymbolType
|
|
5
|
+
from jaclang.compiler.passes.transform import Alert as Alert
|
|
6
|
+
from jaclang.compiler.symtable import Symbol as Symbol, SymbolTable as SymbolTable
|
|
7
|
+
from jaclang.vendor.pygls import uris as uris
|
|
8
|
+
from typing import Any, Awaitable, Callable, Coroutine, ParamSpec, TypeVar
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T", bound=Callable[..., Coroutine[Any, Any, Any]])
|
|
11
|
+
P = ParamSpec("P")
|
|
12
|
+
|
|
13
|
+
def gen_diagnostics(
|
|
14
|
+
from_path: str, errors: list[Alert], warnings: list[Alert]
|
|
15
|
+
) -> list[lspt.Diagnostic]: ...
|
|
16
|
+
def debounce(wait: float) -> Callable[[T], Callable[..., Awaitable[None]]]: ...
|
|
17
|
+
def sym_tab_list(sym_tab: SymbolTable, file_path: str) -> list[SymbolTable]: ...
|
|
18
|
+
def find_node_by_position(
|
|
19
|
+
tokens: list[tuple[lspt.Position, int, int, ast.AstSymbolNode]],
|
|
20
|
+
line: int,
|
|
21
|
+
position: int,
|
|
22
|
+
) -> ast.AstSymbolNode | None: ...
|
|
23
|
+
def find_index(sem_tokens: list[int], line: int, char: int) -> int | None: ...
|
|
24
|
+
def get_symbols_for_outline(node: SymbolTable) -> list[lspt.DocumentSymbol]: ...
|
|
25
|
+
def owner_sym(table: SymbolTable) -> Symbol | None: ...
|
|
26
|
+
def create_range(loc: CodeLocInfo) -> lspt.Range: ...
|
|
27
|
+
def kind_map(sub_tab: ast.AstNode) -> lspt.SymbolKind: ...
|
|
28
|
+
def label_map(sub_tab: SymbolType) -> lspt.CompletionItemKind: ...
|
|
29
|
+
def get_mod_path(mod_path: ast.ModulePath, name_node: ast.Name) -> str | None: ...
|
|
30
|
+
def get_item_path(mod_item: ast.ModuleItem) -> tuple[str, tuple[int, int]] | None: ...
|
|
31
|
+
def get_definition_range(
|
|
32
|
+
filename: str, name: str
|
|
33
|
+
) -> tuple[str, tuple[int, int]] | None: ...
|
|
34
|
+
def collect_all_symbols_in_scope(
|
|
35
|
+
sym_tab: SymbolTable, up_tree: bool = True
|
|
36
|
+
) -> list[lspt.CompletionItem]: ...
|
|
37
|
+
def parse_symbol_path(text: str, dot_position: int) -> list[str]: ...
|
|
38
|
+
def resolve_symbol_path(sym_name: str, node_tab: SymbolTable) -> str: ...
|
|
39
|
+
def find_symbol_table(path: str, current_tab: SymbolTable | None) -> SymbolTable: ...
|
|
40
|
+
def resolve_completion_symbol_table(
|
|
41
|
+
mod_tab: SymbolTable,
|
|
42
|
+
current_symbol_path: list[str],
|
|
43
|
+
current_tab: SymbolTable | None,
|
|
44
|
+
) -> list[lspt.CompletionItem]: ...
|
|
45
|
+
def get_token_start(
|
|
46
|
+
token_index: int | None, sem_tokens: list[int]
|
|
47
|
+
) -> tuple[int, int, int]: ...
|
|
48
|
+
def find_surrounding_tokens(
|
|
49
|
+
change_start_line: int,
|
|
50
|
+
change_start_char: int,
|
|
51
|
+
change_end_line: int,
|
|
52
|
+
change_end_char: int,
|
|
53
|
+
sem_tokens: list[int],
|
|
54
|
+
) -> tuple[int | None, int | None, bool]: ...
|
|
55
|
+
def get_line_of_code(line_number: int, lines: list[str]) -> tuple[str, int] | None: ...
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from jaclang.runtimelib.constructs import NodeArchitype as NodeArchitype
|
|
2
|
+
|
|
3
|
+
def dotgen(
|
|
4
|
+
node: NodeArchitype | None = None,
|
|
5
|
+
depth: int | None = None,
|
|
6
|
+
traverse: bool | None = None,
|
|
7
|
+
edge_type: list[str] | None = None,
|
|
8
|
+
bfs: bool | None = None,
|
|
9
|
+
edge_limit: int | None = None,
|
|
10
|
+
node_limit: int | None = None,
|
|
11
|
+
dot_file: str | None = None,
|
|
12
|
+
) -> str: ...
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import types
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from jaclang.compiler.absyntree import Module
|
|
4
|
+
from jaclang.compiler.constant import EdgeDir
|
|
5
|
+
from jaclang.plugin.spec import P, T as T
|
|
6
|
+
from jaclang.runtimelib.constructs import (
|
|
7
|
+
Anchor as Anchor,
|
|
8
|
+
Architype as Architype,
|
|
9
|
+
DSFunc as DSFunc,
|
|
10
|
+
EdgeAnchor as EdgeAnchor,
|
|
11
|
+
EdgeArchitype as EdgeArchitype,
|
|
12
|
+
ExecutionContext,
|
|
13
|
+
GenericEdge as GenericEdge,
|
|
14
|
+
JacTestCheck as JacTestCheck,
|
|
15
|
+
Memory,
|
|
16
|
+
NodeAnchor as NodeAnchor,
|
|
17
|
+
NodeArchitype as NodeArchitype,
|
|
18
|
+
Root as Root,
|
|
19
|
+
WalkerAnchor as WalkerAnchor,
|
|
20
|
+
WalkerArchitype as WalkerArchitype,
|
|
21
|
+
)
|
|
22
|
+
from typing import Any, Callable
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"EdgeAnchor",
|
|
26
|
+
"GenericEdge",
|
|
27
|
+
"hookimpl",
|
|
28
|
+
"JacTestCheck",
|
|
29
|
+
"NodeAnchor",
|
|
30
|
+
"Anchor",
|
|
31
|
+
"WalkerAnchor",
|
|
32
|
+
"NodeArchitype",
|
|
33
|
+
"EdgeArchitype",
|
|
34
|
+
"Root",
|
|
35
|
+
"WalkerArchitype",
|
|
36
|
+
"Architype",
|
|
37
|
+
"DSFunc",
|
|
38
|
+
"T",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
hookimpl: Incomplete
|
|
42
|
+
|
|
43
|
+
class JacFeatureDefaults:
|
|
44
|
+
pm: Incomplete
|
|
45
|
+
@staticmethod
|
|
46
|
+
def context(session: str = "") -> ExecutionContext: ...
|
|
47
|
+
@staticmethod
|
|
48
|
+
def reset_context() -> None: ...
|
|
49
|
+
@staticmethod
|
|
50
|
+
def memory_hook() -> Memory | None: ...
|
|
51
|
+
@staticmethod
|
|
52
|
+
def make_architype(
|
|
53
|
+
cls, arch_base: type[Architype], on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
54
|
+
) -> type[Architype]: ...
|
|
55
|
+
@staticmethod
|
|
56
|
+
def make_obj(
|
|
57
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
58
|
+
) -> Callable[[type], type]: ...
|
|
59
|
+
@staticmethod
|
|
60
|
+
def make_node(
|
|
61
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
62
|
+
) -> Callable[[type], type]: ...
|
|
63
|
+
@staticmethod
|
|
64
|
+
def make_edge(
|
|
65
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
66
|
+
) -> Callable[[type], type]: ...
|
|
67
|
+
@staticmethod
|
|
68
|
+
def make_walker(
|
|
69
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
70
|
+
) -> Callable[[type], type]: ...
|
|
71
|
+
@staticmethod
|
|
72
|
+
def impl_patch_filename(
|
|
73
|
+
file_loc: str,
|
|
74
|
+
) -> Callable[[Callable[P, T]], Callable[P, T]]: ...
|
|
75
|
+
@staticmethod
|
|
76
|
+
def jac_import(
|
|
77
|
+
target: str,
|
|
78
|
+
base_path: str,
|
|
79
|
+
absorb: bool,
|
|
80
|
+
cachable: bool,
|
|
81
|
+
mdl_alias: str | None,
|
|
82
|
+
override_name: str | None,
|
|
83
|
+
mod_bundle: Module | str | None,
|
|
84
|
+
lng: str | None,
|
|
85
|
+
items: dict[str, str | str | None] | None,
|
|
86
|
+
) -> tuple[types.ModuleType, ...]: ...
|
|
87
|
+
@staticmethod
|
|
88
|
+
def create_test(test_fun: Callable) -> Callable: ...
|
|
89
|
+
@staticmethod
|
|
90
|
+
def run_test(
|
|
91
|
+
filepath: str,
|
|
92
|
+
filter: str | None,
|
|
93
|
+
xit: bool,
|
|
94
|
+
maxfail: int | None,
|
|
95
|
+
directory: str | None,
|
|
96
|
+
verbose: bool,
|
|
97
|
+
) -> int: ...
|
|
98
|
+
@staticmethod
|
|
99
|
+
def elvis(op1: T | None, op2: T) -> T: ...
|
|
100
|
+
@staticmethod
|
|
101
|
+
def has_instance_default(gen_func: Callable[[], T]) -> T: ...
|
|
102
|
+
@staticmethod
|
|
103
|
+
def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype: ...
|
|
104
|
+
@staticmethod
|
|
105
|
+
def report(expr: Any) -> Any: ...
|
|
106
|
+
@staticmethod
|
|
107
|
+
def ignore(
|
|
108
|
+
walker: WalkerArchitype,
|
|
109
|
+
expr: (
|
|
110
|
+
list[NodeArchitype | EdgeArchitype]
|
|
111
|
+
| list[NodeArchitype]
|
|
112
|
+
| list[EdgeArchitype]
|
|
113
|
+
| NodeArchitype
|
|
114
|
+
| EdgeArchitype
|
|
115
|
+
),
|
|
116
|
+
) -> bool: ...
|
|
117
|
+
@staticmethod
|
|
118
|
+
def visit_node(
|
|
119
|
+
walker: WalkerArchitype,
|
|
120
|
+
expr: (
|
|
121
|
+
list[NodeArchitype | EdgeArchitype]
|
|
122
|
+
| list[NodeArchitype]
|
|
123
|
+
| list[EdgeArchitype]
|
|
124
|
+
| NodeArchitype
|
|
125
|
+
| EdgeArchitype
|
|
126
|
+
),
|
|
127
|
+
) -> bool: ...
|
|
128
|
+
@staticmethod
|
|
129
|
+
def disengage(walker: WalkerArchitype) -> bool: ...
|
|
130
|
+
@staticmethod
|
|
131
|
+
def edge_ref(
|
|
132
|
+
node_obj: NodeArchitype | list[NodeArchitype],
|
|
133
|
+
target_obj: NodeArchitype | list[NodeArchitype] | None,
|
|
134
|
+
dir: EdgeDir,
|
|
135
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
136
|
+
edges_only: bool,
|
|
137
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
138
|
+
@staticmethod
|
|
139
|
+
def connect(
|
|
140
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
141
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
142
|
+
edge_spec: Callable[[], EdgeArchitype],
|
|
143
|
+
edges_only: bool,
|
|
144
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
145
|
+
@staticmethod
|
|
146
|
+
def disconnect(
|
|
147
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
148
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
149
|
+
dir: EdgeDir,
|
|
150
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
151
|
+
) -> bool: ...
|
|
152
|
+
@staticmethod
|
|
153
|
+
def assign_compr(
|
|
154
|
+
target: list[T], attr_val: tuple[tuple[str], tuple[Any]]
|
|
155
|
+
) -> list[T]: ...
|
|
156
|
+
@staticmethod
|
|
157
|
+
def get_root() -> Root: ...
|
|
158
|
+
@staticmethod
|
|
159
|
+
def get_root_type() -> type[Root]: ...
|
|
160
|
+
@staticmethod
|
|
161
|
+
def build_edge(
|
|
162
|
+
is_undirected: bool,
|
|
163
|
+
conn_type: type[EdgeArchitype] | EdgeArchitype | None,
|
|
164
|
+
conn_assign: tuple[tuple, tuple] | None,
|
|
165
|
+
) -> Callable[[], EdgeArchitype]: ...
|
|
166
|
+
@staticmethod
|
|
167
|
+
def get_semstr_type(
|
|
168
|
+
file_loc: str, scope: str, attr: str, return_semstr: bool
|
|
169
|
+
) -> str | None: ...
|
|
170
|
+
@staticmethod
|
|
171
|
+
def obj_scope(file_loc: str, attr: str) -> str: ...
|
|
172
|
+
@staticmethod
|
|
173
|
+
def get_sem_type(file_loc: str, attr: str) -> tuple[str | None, str | None]: ...
|
|
174
|
+
@staticmethod
|
|
175
|
+
def with_llm(
|
|
176
|
+
file_loc: str,
|
|
177
|
+
model: Any,
|
|
178
|
+
model_params: dict[str, Any],
|
|
179
|
+
scope: str,
|
|
180
|
+
incl_info: list[tuple[str, str]],
|
|
181
|
+
excl_info: list[tuple[str, str]],
|
|
182
|
+
inputs: list[tuple[str, str, str, Any]],
|
|
183
|
+
outputs: tuple,
|
|
184
|
+
action: str,
|
|
185
|
+
) -> Any: ...
|
|
186
|
+
|
|
187
|
+
class JacBuiltin:
|
|
188
|
+
@staticmethod
|
|
189
|
+
def dotgen(
|
|
190
|
+
node: NodeArchitype,
|
|
191
|
+
depth: int,
|
|
192
|
+
traverse: bool,
|
|
193
|
+
edge_type: list[str],
|
|
194
|
+
bfs: bool,
|
|
195
|
+
edge_limit: int,
|
|
196
|
+
node_limit: int,
|
|
197
|
+
dot_file: str | None,
|
|
198
|
+
) -> str: ...
|
|
199
|
+
|
|
200
|
+
class JacCmdDefaults:
|
|
201
|
+
@staticmethod
|
|
202
|
+
def create_cmd() -> None: ...
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import types
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from jaclang.compiler.absyntree import Module as Module
|
|
4
|
+
from jaclang.plugin.default import ExecutionContext as ExecutionContext
|
|
5
|
+
from jaclang.plugin.spec import (
|
|
6
|
+
JacBuiltin as JacBuiltin,
|
|
7
|
+
JacCmdSpec as JacCmdSpec,
|
|
8
|
+
JacFeatureSpec as JacFeatureSpec,
|
|
9
|
+
P as P,
|
|
10
|
+
T as T,
|
|
11
|
+
)
|
|
12
|
+
from jaclang.runtimelib.constructs import (
|
|
13
|
+
Architype as Architype,
|
|
14
|
+
EdgeArchitype as EdgeArchitype,
|
|
15
|
+
Memory as Memory,
|
|
16
|
+
NodeArchitype as NodeArchitype,
|
|
17
|
+
Root as Root,
|
|
18
|
+
WalkerArchitype as WalkerArchitype,
|
|
19
|
+
)
|
|
20
|
+
from typing import Any, Callable, TypeAlias
|
|
21
|
+
|
|
22
|
+
pm: Incomplete
|
|
23
|
+
|
|
24
|
+
class JacFeature:
|
|
25
|
+
EdgeDir: TypeAlias
|
|
26
|
+
DSFunc: TypeAlias
|
|
27
|
+
RootType: TypeAlias
|
|
28
|
+
Obj: TypeAlias
|
|
29
|
+
Node: TypeAlias
|
|
30
|
+
Edge: TypeAlias
|
|
31
|
+
Walker: TypeAlias
|
|
32
|
+
@staticmethod
|
|
33
|
+
def context(session: str = "") -> ExecutionContext: ...
|
|
34
|
+
@staticmethod
|
|
35
|
+
def reset_context() -> None: ...
|
|
36
|
+
@staticmethod
|
|
37
|
+
def memory_hook() -> Memory | None: ...
|
|
38
|
+
@staticmethod
|
|
39
|
+
def make_architype(
|
|
40
|
+
cls, arch_base: type[Architype], on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
41
|
+
) -> type[Architype]: ...
|
|
42
|
+
@staticmethod
|
|
43
|
+
def make_obj(
|
|
44
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
45
|
+
) -> Callable[[type], type]: ...
|
|
46
|
+
@staticmethod
|
|
47
|
+
def make_node(
|
|
48
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
49
|
+
) -> Callable[[type], type]: ...
|
|
50
|
+
@staticmethod
|
|
51
|
+
def make_edge(
|
|
52
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
53
|
+
) -> Callable[[type], type]: ...
|
|
54
|
+
@staticmethod
|
|
55
|
+
def make_walker(
|
|
56
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
57
|
+
) -> Callable[[type], type]: ...
|
|
58
|
+
@staticmethod
|
|
59
|
+
def impl_patch_filename(
|
|
60
|
+
file_loc: str,
|
|
61
|
+
) -> Callable[[Callable[P, T]], Callable[P, T]]: ...
|
|
62
|
+
@staticmethod
|
|
63
|
+
def jac_import(
|
|
64
|
+
target: str,
|
|
65
|
+
base_path: str,
|
|
66
|
+
absorb: bool = False,
|
|
67
|
+
cachable: bool = True,
|
|
68
|
+
mdl_alias: str | None = None,
|
|
69
|
+
override_name: str | None = None,
|
|
70
|
+
mod_bundle: Module | str | None = None,
|
|
71
|
+
lng: str | None = "jac",
|
|
72
|
+
items: dict[str, str | str | None] | None = None,
|
|
73
|
+
) -> tuple[types.ModuleType, ...]: ...
|
|
74
|
+
@staticmethod
|
|
75
|
+
def create_test(test_fun: Callable) -> Callable: ...
|
|
76
|
+
@staticmethod
|
|
77
|
+
def run_test(
|
|
78
|
+
filepath: str,
|
|
79
|
+
filter: str | None = None,
|
|
80
|
+
xit: bool = False,
|
|
81
|
+
maxfail: int | None = None,
|
|
82
|
+
directory: str | None = None,
|
|
83
|
+
verbose: bool = False,
|
|
84
|
+
) -> int: ...
|
|
85
|
+
@staticmethod
|
|
86
|
+
def elvis(op1: T | None, op2: T) -> T: ...
|
|
87
|
+
@staticmethod
|
|
88
|
+
def has_instance_default(gen_func: Callable[[], T]) -> T: ...
|
|
89
|
+
@staticmethod
|
|
90
|
+
def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype: ...
|
|
91
|
+
@staticmethod
|
|
92
|
+
def report(expr: Any) -> Any: ...
|
|
93
|
+
@staticmethod
|
|
94
|
+
def ignore(
|
|
95
|
+
walker: WalkerArchitype,
|
|
96
|
+
expr: (
|
|
97
|
+
list[NodeArchitype | EdgeArchitype]
|
|
98
|
+
| list[NodeArchitype]
|
|
99
|
+
| list[EdgeArchitype]
|
|
100
|
+
| NodeArchitype
|
|
101
|
+
| EdgeArchitype
|
|
102
|
+
),
|
|
103
|
+
) -> bool: ...
|
|
104
|
+
@staticmethod
|
|
105
|
+
def visit_node(
|
|
106
|
+
walker: WalkerArchitype,
|
|
107
|
+
expr: (
|
|
108
|
+
list[NodeArchitype | EdgeArchitype]
|
|
109
|
+
| list[NodeArchitype]
|
|
110
|
+
| list[EdgeArchitype]
|
|
111
|
+
| NodeArchitype
|
|
112
|
+
| EdgeArchitype
|
|
113
|
+
),
|
|
114
|
+
) -> bool: ...
|
|
115
|
+
@staticmethod
|
|
116
|
+
def disengage(walker: WalkerArchitype) -> bool: ...
|
|
117
|
+
@staticmethod
|
|
118
|
+
def edge_ref(
|
|
119
|
+
node_obj: NodeArchitype | list[NodeArchitype],
|
|
120
|
+
target_obj: NodeArchitype | list[NodeArchitype] | None,
|
|
121
|
+
dir: EdgeDir,
|
|
122
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
123
|
+
edges_only: bool = False,
|
|
124
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
125
|
+
@staticmethod
|
|
126
|
+
def connect(
|
|
127
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
128
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
129
|
+
edge_spec: Callable[[], EdgeArchitype],
|
|
130
|
+
edges_only: bool = False,
|
|
131
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
132
|
+
@staticmethod
|
|
133
|
+
def disconnect(
|
|
134
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
135
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
136
|
+
dir: EdgeDir,
|
|
137
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
138
|
+
) -> bool: ...
|
|
139
|
+
@staticmethod
|
|
140
|
+
def assign_compr(
|
|
141
|
+
target: list[T], attr_val: tuple[tuple[str], tuple[Any]]
|
|
142
|
+
) -> list[T]: ...
|
|
143
|
+
@staticmethod
|
|
144
|
+
def get_root() -> Root: ...
|
|
145
|
+
@staticmethod
|
|
146
|
+
def get_root_type() -> type[Root]: ...
|
|
147
|
+
@staticmethod
|
|
148
|
+
def build_edge(
|
|
149
|
+
is_undirected: bool,
|
|
150
|
+
conn_type: type[EdgeArchitype] | EdgeArchitype | None,
|
|
151
|
+
conn_assign: tuple[tuple, tuple] | None,
|
|
152
|
+
) -> Callable[[], EdgeArchitype]: ...
|
|
153
|
+
@staticmethod
|
|
154
|
+
def get_semstr_type(
|
|
155
|
+
file_loc: str, scope: str, attr: str, return_semstr: bool
|
|
156
|
+
) -> str | None: ...
|
|
157
|
+
@staticmethod
|
|
158
|
+
def obj_scope(file_loc: str, attr: str) -> str: ...
|
|
159
|
+
@staticmethod
|
|
160
|
+
def get_sem_type(file_loc: str, attr: str) -> tuple[str | None, str | None]: ...
|
|
161
|
+
@staticmethod
|
|
162
|
+
def with_llm(
|
|
163
|
+
file_loc: str,
|
|
164
|
+
model: Any,
|
|
165
|
+
model_params: dict[str, Any],
|
|
166
|
+
scope: str,
|
|
167
|
+
incl_info: list[tuple[str, str]],
|
|
168
|
+
excl_info: list[tuple[str, str]],
|
|
169
|
+
inputs: list[tuple[str, str, str, Any]],
|
|
170
|
+
outputs: tuple,
|
|
171
|
+
action: str,
|
|
172
|
+
) -> Any: ...
|
|
173
|
+
|
|
174
|
+
class JacCmd:
|
|
175
|
+
@staticmethod
|
|
176
|
+
def create_cmd() -> None: ...
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import types
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from jaclang.compiler.absyntree import Module as Module
|
|
4
|
+
from jaclang.plugin.default import (
|
|
5
|
+
Architype as Architype,
|
|
6
|
+
DSFunc as DSFunc,
|
|
7
|
+
EdgeDir as EdgeDir,
|
|
8
|
+
ExecutionContext as ExecutionContext,
|
|
9
|
+
Root as Root,
|
|
10
|
+
WalkerArchitype as WalkerArchitype,
|
|
11
|
+
)
|
|
12
|
+
from jaclang.runtimelib.constructs import (
|
|
13
|
+
EdgeArchitype as EdgeArchitype,
|
|
14
|
+
NodeArchitype as NodeArchitype,
|
|
15
|
+
)
|
|
16
|
+
from jaclang.runtimelib.memory import Memory as Memory
|
|
17
|
+
from typing import Any, Callable, ParamSpec, TypeVar
|
|
18
|
+
|
|
19
|
+
hookspec: Incomplete
|
|
20
|
+
T = TypeVar("T")
|
|
21
|
+
P = ParamSpec("P")
|
|
22
|
+
|
|
23
|
+
class JacFeatureSpec:
|
|
24
|
+
@staticmethod
|
|
25
|
+
def context(session: str = "") -> ExecutionContext: ...
|
|
26
|
+
@staticmethod
|
|
27
|
+
def reset_context() -> None: ...
|
|
28
|
+
@staticmethod
|
|
29
|
+
def memory_hook() -> Memory | None: ...
|
|
30
|
+
@staticmethod
|
|
31
|
+
def make_architype(
|
|
32
|
+
cls, arch_base: type[Architype], on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
33
|
+
) -> type[Architype]: ...
|
|
34
|
+
@staticmethod
|
|
35
|
+
def make_obj(
|
|
36
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
37
|
+
) -> Callable[[type], type]: ...
|
|
38
|
+
@staticmethod
|
|
39
|
+
def make_node(
|
|
40
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
41
|
+
) -> Callable[[type], type]: ...
|
|
42
|
+
@staticmethod
|
|
43
|
+
def make_edge(
|
|
44
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
45
|
+
) -> Callable[[type], type]: ...
|
|
46
|
+
@staticmethod
|
|
47
|
+
def make_walker(
|
|
48
|
+
on_entry: list[DSFunc], on_exit: list[DSFunc]
|
|
49
|
+
) -> Callable[[type], type]: ...
|
|
50
|
+
@staticmethod
|
|
51
|
+
def impl_patch_filename(
|
|
52
|
+
file_loc: str,
|
|
53
|
+
) -> Callable[[Callable[P, T]], Callable[P, T]]: ...
|
|
54
|
+
@staticmethod
|
|
55
|
+
def jac_import(
|
|
56
|
+
target: str,
|
|
57
|
+
base_path: str,
|
|
58
|
+
absorb: bool,
|
|
59
|
+
cachable: bool,
|
|
60
|
+
mdl_alias: str | None,
|
|
61
|
+
override_name: str | None,
|
|
62
|
+
mod_bundle: Module | str | None,
|
|
63
|
+
lng: str | None,
|
|
64
|
+
items: dict[str, str | str | None] | None,
|
|
65
|
+
) -> tuple[types.ModuleType, ...]: ...
|
|
66
|
+
@staticmethod
|
|
67
|
+
def create_test(test_fun: Callable) -> Callable: ...
|
|
68
|
+
@staticmethod
|
|
69
|
+
def run_test(
|
|
70
|
+
filepath: str,
|
|
71
|
+
filter: str | None,
|
|
72
|
+
xit: bool,
|
|
73
|
+
maxfail: int | None,
|
|
74
|
+
directory: str | None,
|
|
75
|
+
verbose: bool,
|
|
76
|
+
) -> int: ...
|
|
77
|
+
@staticmethod
|
|
78
|
+
def elvis(op1: T | None, op2: T) -> T: ...
|
|
79
|
+
@staticmethod
|
|
80
|
+
def has_instance_default(gen_func: Callable[[], T]) -> T: ...
|
|
81
|
+
@staticmethod
|
|
82
|
+
def spawn_call(op1: Architype, op2: Architype) -> WalkerArchitype: ...
|
|
83
|
+
@staticmethod
|
|
84
|
+
def report(expr: Any) -> Any: ...
|
|
85
|
+
@staticmethod
|
|
86
|
+
def ignore(
|
|
87
|
+
walker: WalkerArchitype,
|
|
88
|
+
expr: (
|
|
89
|
+
list[NodeArchitype | EdgeArchitype]
|
|
90
|
+
| list[NodeArchitype]
|
|
91
|
+
| list[EdgeArchitype]
|
|
92
|
+
| NodeArchitype
|
|
93
|
+
| EdgeArchitype
|
|
94
|
+
),
|
|
95
|
+
) -> bool: ...
|
|
96
|
+
@staticmethod
|
|
97
|
+
def visit_node(
|
|
98
|
+
walker: WalkerArchitype,
|
|
99
|
+
expr: (
|
|
100
|
+
list[NodeArchitype | EdgeArchitype]
|
|
101
|
+
| list[NodeArchitype]
|
|
102
|
+
| list[EdgeArchitype]
|
|
103
|
+
| NodeArchitype
|
|
104
|
+
| EdgeArchitype
|
|
105
|
+
),
|
|
106
|
+
) -> bool: ...
|
|
107
|
+
@staticmethod
|
|
108
|
+
def disengage(walker: WalkerArchitype) -> bool: ...
|
|
109
|
+
@staticmethod
|
|
110
|
+
def edge_ref(
|
|
111
|
+
node_obj: NodeArchitype | list[NodeArchitype],
|
|
112
|
+
target_obj: NodeArchitype | list[NodeArchitype] | None,
|
|
113
|
+
dir: EdgeDir,
|
|
114
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
115
|
+
edges_only: bool,
|
|
116
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
117
|
+
@staticmethod
|
|
118
|
+
def connect(
|
|
119
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
120
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
121
|
+
edge_spec: Callable[[], EdgeArchitype],
|
|
122
|
+
edges_only: bool,
|
|
123
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]: ...
|
|
124
|
+
@staticmethod
|
|
125
|
+
def disconnect(
|
|
126
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
127
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
128
|
+
dir: EdgeDir,
|
|
129
|
+
filter_func: Callable[[list[EdgeArchitype]], list[EdgeArchitype]] | None,
|
|
130
|
+
) -> bool: ...
|
|
131
|
+
@staticmethod
|
|
132
|
+
def assign_compr(
|
|
133
|
+
target: list[T], attr_val: tuple[tuple[str], tuple[Any]]
|
|
134
|
+
) -> list[T]: ...
|
|
135
|
+
@staticmethod
|
|
136
|
+
def get_root() -> Root: ...
|
|
137
|
+
@staticmethod
|
|
138
|
+
def get_root_type() -> type[Root]: ...
|
|
139
|
+
@staticmethod
|
|
140
|
+
def build_edge(
|
|
141
|
+
is_undirected: bool,
|
|
142
|
+
conn_type: type[EdgeArchitype] | EdgeArchitype | None,
|
|
143
|
+
conn_assign: tuple[tuple, tuple] | None,
|
|
144
|
+
) -> Callable[[], EdgeArchitype]: ...
|
|
145
|
+
@staticmethod
|
|
146
|
+
def get_semstr_type(
|
|
147
|
+
file_loc: str, scope: str, attr: str, return_semstr: bool
|
|
148
|
+
) -> str | None: ...
|
|
149
|
+
@staticmethod
|
|
150
|
+
def obj_scope(file_loc: str, attr: str) -> str: ...
|
|
151
|
+
@staticmethod
|
|
152
|
+
def get_sem_type(file_loc: str, attr: str) -> tuple[str | None, str | None]: ...
|
|
153
|
+
@staticmethod
|
|
154
|
+
def with_llm(
|
|
155
|
+
file_loc: str,
|
|
156
|
+
model: Any,
|
|
157
|
+
model_params: dict[str, Any],
|
|
158
|
+
scope: str,
|
|
159
|
+
incl_info: list[tuple[str, str]],
|
|
160
|
+
excl_info: list[tuple[str, str]],
|
|
161
|
+
inputs: list[tuple[str, str, str, Any]],
|
|
162
|
+
outputs: tuple,
|
|
163
|
+
action: str,
|
|
164
|
+
) -> Any: ...
|
|
165
|
+
|
|
166
|
+
class JacBuiltin:
|
|
167
|
+
@staticmethod
|
|
168
|
+
def dotgen(
|
|
169
|
+
node: NodeArchitype,
|
|
170
|
+
depth: int,
|
|
171
|
+
traverse: bool,
|
|
172
|
+
edge_type: list[str],
|
|
173
|
+
bfs: bool,
|
|
174
|
+
edge_limit: int,
|
|
175
|
+
node_limit: int,
|
|
176
|
+
dot_file: str | None,
|
|
177
|
+
) -> str: ...
|
|
178
|
+
|
|
179
|
+
class JacCmdSpec:
|
|
180
|
+
@staticmethod
|
|
181
|
+
def create_cmd() -> None: ...
|
|
File without changes
|