jaclang 0.7.2__py3-none-any.whl → 0.7.8__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 +2 -2
- jaclang/compiler/__init__.py +11 -12
- jaclang/compiler/absyntree.py +499 -294
- jaclang/compiler/codeloc.py +2 -2
- jaclang/compiler/constant.py +100 -2
- jaclang/compiler/jac.lark +27 -19
- jaclang/compiler/parser.py +119 -92
- jaclang/compiler/passes/main/access_modifier_pass.py +20 -12
- jaclang/compiler/passes/main/def_impl_match_pass.py +28 -14
- jaclang/compiler/passes/main/def_use_pass.py +59 -40
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +65 -43
- jaclang/compiler/passes/main/import_pass.py +8 -6
- jaclang/compiler/passes/main/pyast_gen_pass.py +97 -42
- jaclang/compiler/passes/main/pyast_load_pass.py +47 -12
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +19 -10
- jaclang/compiler/passes/main/registry_pass.py +6 -6
- jaclang/compiler/passes/main/sub_node_tab_pass.py +0 -5
- jaclang/compiler/passes/main/sym_tab_build_pass.py +43 -235
- jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py +21 -4
- jaclang/compiler/passes/main/tests/test_def_use_pass.py +5 -10
- jaclang/compiler/passes/main/type_check_pass.py +2 -1
- jaclang/compiler/passes/tool/jac_formatter_pass.py +30 -9
- jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +16 -0
- jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +16 -0
- jaclang/compiler/passes/tool/tests/fixtures/genai/essay_review.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/expert_answer.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/joke_gen.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/odd_word_out.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/personality_finder.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/text_to_type.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/translator.jac +1 -1
- jaclang/compiler/passes/tool/tests/fixtures/genai/wikipedia.jac +1 -1
- jaclang/compiler/passes/transform.py +2 -4
- jaclang/compiler/passes/utils/mypy_ast_build.py +1 -8
- jaclang/{core/registry.py → compiler/semtable.py} +1 -3
- jaclang/compiler/symtable.py +142 -101
- jaclang/compiler/tests/test_parser.py +2 -2
- jaclang/core/{construct.py → architype.py} +25 -240
- jaclang/core/constructs.py +44 -0
- jaclang/core/context.py +157 -0
- jaclang/core/importer.py +18 -9
- jaclang/core/memory.py +99 -0
- jaclang/core/test.py +90 -0
- jaclang/core/utils.py +2 -2
- jaclang/langserve/engine.py +127 -50
- jaclang/langserve/server.py +34 -61
- jaclang/langserve/tests/fixtures/base_module_structure.jac +28 -0
- jaclang/langserve/tests/fixtures/circle.jac +16 -12
- jaclang/langserve/tests/fixtures/circle_err.jac +3 -3
- jaclang/langserve/tests/fixtures/circle_pure.test.jac +15 -0
- jaclang/langserve/tests/fixtures/import_include_statements.jac +6 -0
- jaclang/langserve/tests/fixtures/py_import.py +26 -0
- jaclang/langserve/tests/test_server.py +93 -18
- jaclang/langserve/utils.py +124 -10
- jaclang/plugin/builtin.py +1 -1
- jaclang/plugin/default.py +25 -77
- jaclang/plugin/feature.py +25 -7
- jaclang/plugin/spec.py +18 -20
- jaclang/settings.py +3 -0
- jaclang/tests/fixtures/abc.jac +16 -12
- jaclang/tests/fixtures/aott_raise.jac +1 -1
- jaclang/tests/fixtures/byllmissue.jac +9 -0
- jaclang/tests/fixtures/edgetypeissue.jac +10 -0
- jaclang/tests/fixtures/hello.jac +1 -1
- jaclang/tests/fixtures/impl_match_confused.impl.jac +1 -0
- jaclang/tests/fixtures/impl_match_confused.jac +5 -0
- jaclang/tests/fixtures/maxfail_run_test.jac +17 -5
- jaclang/tests/fixtures/run_test.jac +17 -5
- jaclang/tests/test_bugs.py +19 -0
- jaclang/tests/test_cli.py +1 -1
- jaclang/tests/test_language.py +65 -100
- jaclang/tests/test_reference.py +1 -1
- jaclang/utils/lang_tools.py +5 -4
- jaclang/utils/test.py +2 -1
- jaclang/utils/treeprinter.py +22 -8
- {jaclang-0.7.2.dist-info → jaclang-0.7.8.dist-info}/METADATA +1 -1
- {jaclang-0.7.2.dist-info → jaclang-0.7.8.dist-info}/RECORD +79 -83
- jaclang/core/aott.py +0 -310
- jaclang/core/llms/__init__.py +0 -20
- jaclang/core/llms/anthropic.py +0 -90
- jaclang/core/llms/base.py +0 -206
- jaclang/core/llms/groq.py +0 -70
- jaclang/core/llms/huggingface.py +0 -76
- jaclang/core/llms/ollama.py +0 -81
- jaclang/core/llms/openai.py +0 -65
- jaclang/core/llms/togetherai.py +0 -63
- jaclang/core/llms/utils.py +0 -9
- jaclang/tests/fixtures/math_question.jpg +0 -0
- jaclang/tests/fixtures/with_llm_function.jac +0 -33
- jaclang/tests/fixtures/with_llm_lower.jac +0 -45
- jaclang/tests/fixtures/with_llm_method.jac +0 -51
- jaclang/tests/fixtures/with_llm_type.jac +0 -52
- jaclang/tests/fixtures/with_llm_vision.jac +0 -25
- {jaclang-0.7.2.dist-info → jaclang-0.7.8.dist-info}/WHEEL +0 -0
- {jaclang-0.7.2.dist-info → jaclang-0.7.8.dist-info}/entry_points.txt +0 -0
jaclang/cli/cli.py
CHANGED
|
@@ -19,7 +19,7 @@ from jaclang.compiler.constant import Constants
|
|
|
19
19
|
from jaclang.compiler.passes.main.pyast_load_pass import PyastBuildPass
|
|
20
20
|
from jaclang.compiler.passes.main.schedules import py_code_gen_typed
|
|
21
21
|
from jaclang.compiler.passes.tool.schedules import format_pass
|
|
22
|
-
from jaclang.core.
|
|
22
|
+
from jaclang.core.constructs import Architype
|
|
23
23
|
from jaclang.plugin.builtin import dotgen
|
|
24
24
|
from jaclang.plugin.feature import JacCmd as Cmd
|
|
25
25
|
from jaclang.plugin.feature import JacFeature as Jac
|
|
@@ -282,7 +282,7 @@ def clean() -> None:
|
|
|
282
282
|
current_dir = os.getcwd()
|
|
283
283
|
for root, dirs, _files in os.walk(current_dir, topdown=True):
|
|
284
284
|
for folder_name in dirs[:]:
|
|
285
|
-
if folder_name
|
|
285
|
+
if folder_name in [Constants.JAC_GEN_DIR, Constants.JAC_MYPY_CACHE]:
|
|
286
286
|
folder_to_remove = os.path.join(root, folder_name)
|
|
287
287
|
shutil.rmtree(folder_to_remove)
|
|
288
288
|
print(f"Removed folder: {folder_to_remove}")
|
jaclang/compiler/__init__.py
CHANGED
|
@@ -6,12 +6,12 @@ import os
|
|
|
6
6
|
import shutil
|
|
7
7
|
import sys
|
|
8
8
|
|
|
9
|
+
from jaclang.utils.helpers import auto_generate_refs
|
|
10
|
+
from jaclang.vendor.lark.tools import standalone
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
def generate_static_parser(force: bool = False) -> None:
|
|
11
14
|
"""Generate static parser."""
|
|
12
|
-
from jaclang.utils.helpers import auto_generate_refs
|
|
13
|
-
from jaclang.vendor.lark.tools import standalone
|
|
14
|
-
|
|
15
15
|
cur_dir = os.path.dirname(__file__)
|
|
16
16
|
if force or not os.path.exists(os.path.join(cur_dir, "generated", "jac_parser.py")):
|
|
17
17
|
if os.path.exists(os.path.join(cur_dir, "generated")):
|
|
@@ -27,25 +27,24 @@ def generate_static_parser(force: bool = False) -> None:
|
|
|
27
27
|
os.path.join(cur_dir, "generated", "jac_parser.py"),
|
|
28
28
|
"-c",
|
|
29
29
|
]
|
|
30
|
-
standalone.main()
|
|
30
|
+
standalone.main()
|
|
31
31
|
sys.argv = save_argv
|
|
32
32
|
try:
|
|
33
33
|
auto_generate_refs()
|
|
34
34
|
except Exception as e:
|
|
35
|
-
|
|
35
|
+
logging.error(f"Error generating reference files: {e}")
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
generate_static_parser()
|
|
39
39
|
try:
|
|
40
|
-
from jaclang.compiler.generated import jac_parser as jac_lark
|
|
41
|
-
|
|
42
|
-
jac_lark.logger.setLevel(logging.DEBUG)
|
|
43
|
-
except AttributeError:
|
|
40
|
+
from jaclang.compiler.generated import jac_parser as jac_lark
|
|
41
|
+
except ModuleNotFoundError:
|
|
44
42
|
generate_static_parser(force=True)
|
|
45
|
-
from jaclang.compiler.generated import jac_parser as jac_lark
|
|
43
|
+
from jaclang.compiler.generated import jac_parser as jac_lark
|
|
44
|
+
|
|
45
|
+
jac_lark.logger.setLevel(logging.DEBUG)
|
|
46
|
+
contextlib.suppress(ModuleNotFoundError)
|
|
46
47
|
|
|
47
|
-
jac_lark.logger.setLevel(logging.DEBUG)
|
|
48
|
-
contextlib.suppress(AttributeError)
|
|
49
48
|
TOKEN_MAP = {
|
|
50
49
|
x.name: x.pattern.value
|
|
51
50
|
for x in jac_lark.Lark_StandAlone().parser.lexer_conf.terminals
|