jaclang 0.5.18__py3-none-any.whl → 0.6.0__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.

Files changed (47) hide show
  1. jaclang/cli/cli.py +4 -2
  2. jaclang/compiler/__init__.py +12 -5
  3. jaclang/compiler/absyntree.py +3 -3
  4. jaclang/compiler/generated/jac_parser.py +2 -2
  5. jaclang/compiler/jac.lark +2 -2
  6. jaclang/compiler/parser.py +47 -7
  7. jaclang/compiler/passes/main/__init__.py +3 -2
  8. jaclang/compiler/passes/main/access_modifier_pass.py +173 -0
  9. jaclang/compiler/passes/main/import_pass.py +32 -19
  10. jaclang/compiler/passes/main/pyast_gen_pass.py +41 -26
  11. jaclang/compiler/passes/main/pyast_load_pass.py +136 -73
  12. jaclang/compiler/passes/main/pyout_pass.py +14 -13
  13. jaclang/compiler/passes/main/registry_pass.py +8 -3
  14. jaclang/compiler/passes/main/schedules.py +5 -3
  15. jaclang/compiler/passes/main/sym_tab_build_pass.py +23 -26
  16. jaclang/compiler/passes/main/tests/test_import_pass.py +2 -2
  17. jaclang/compiler/passes/tool/jac_formatter_pass.py +83 -21
  18. jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +11 -4
  19. jaclang/compiler/passes/transform.py +2 -0
  20. jaclang/compiler/symtable.py +10 -3
  21. jaclang/compiler/tests/test_importer.py +9 -0
  22. jaclang/compiler/workspace.py +17 -5
  23. jaclang/core/aott.py +34 -63
  24. jaclang/core/importer.py +73 -65
  25. jaclang/core/llms/__init__.py +20 -0
  26. jaclang/core/llms/anthropic.py +61 -0
  27. jaclang/core/llms/base.py +206 -0
  28. jaclang/core/llms/groq.py +67 -0
  29. jaclang/core/llms/huggingface.py +73 -0
  30. jaclang/core/llms/ollama.py +78 -0
  31. jaclang/core/llms/openai.py +61 -0
  32. jaclang/core/llms/togetherai.py +60 -0
  33. jaclang/core/llms/utils.py +9 -0
  34. jaclang/core/utils.py +16 -1
  35. jaclang/plugin/default.py +37 -14
  36. jaclang/plugin/feature.py +9 -6
  37. jaclang/plugin/spec.py +8 -1
  38. jaclang/settings.py +1 -1
  39. jaclang/utils/helpers.py +6 -2
  40. jaclang/utils/treeprinter.py +9 -6
  41. jaclang-0.6.0.dist-info/METADATA +17 -0
  42. {jaclang-0.5.18.dist-info → jaclang-0.6.0.dist-info}/RECORD +45 -36
  43. jaclang/core/llms.py +0 -111
  44. jaclang-0.5.18.dist-info/METADATA +0 -7
  45. {jaclang-0.5.18.dist-info → jaclang-0.6.0.dist-info}/WHEEL +0 -0
  46. {jaclang-0.5.18.dist-info → jaclang-0.6.0.dist-info}/entry_points.txt +0 -0
  47. {jaclang-0.5.18.dist-info → jaclang-0.6.0.dist-info}/top_level.txt +0 -0
jaclang/cli/cli.py CHANGED
@@ -106,7 +106,7 @@ def build(filename: str) -> None:
106
106
 
107
107
 
108
108
  @cmd_registry.register
109
- def check(filename: str) -> None:
109
+ def check(filename: str, print_errs: bool = True) -> None:
110
110
  """Run type checker for a specified .jac file.
111
111
 
112
112
  :param filename: The path to the .jac file.
@@ -119,7 +119,9 @@ def check(filename: str) -> None:
119
119
 
120
120
  errs = len(out.errors_had)
121
121
  warnings = len(out.warnings_had)
122
-
122
+ if print_errs:
123
+ for e in out.errors_had:
124
+ print("Error:", e)
123
125
  print(f"Errors: {errs}, Warnings: {warnings}")
124
126
  else:
125
127
  print("Not a .jac file.")
@@ -86,17 +86,24 @@ TOKEN_MAP.update(
86
86
  "A_PIPE_FWD": ":>",
87
87
  "A_PIPE_BKWD": "<:",
88
88
  "DOT_FWD": ".>",
89
+ "STAR_POW": "**",
90
+ "STAR_MUL": "*",
91
+ "FLOOR_DIV": "//",
92
+ "DIV": "/",
93
+ "PYNLINE": "::py::",
94
+ "ADD_EQ": "+=",
95
+ "SUB_EQ": "-=",
89
96
  "STAR_POW_EQ": "**=",
90
97
  "MUL_EQ": "*=",
91
98
  "FLOOR_DIV_EQ": "//=",
92
99
  "DIV_EQ": "/=",
100
+ "MOD_EQ": "%=",
101
+ "BW_AND_EQ": "&=",
93
102
  "BW_OR_EQ": "|=",
94
103
  "BW_XOR_EQ": "^=",
95
- "STAR_POW": "**",
96
- "STAR_MUL": "*",
97
- "FLOOR_DIV": "//",
98
- "DIV": "/",
99
- "PYNLINE": "::py::",
104
+ "BW_NOT_EQ": "~=",
105
+ "LSHIFT_EQ": "<<=",
106
+ "RSHIFT_EQ": ">>=",
100
107
  }
101
108
  )
102
109
 
@@ -194,10 +194,10 @@ class AstAccessNode(AstNode):
194
194
  """Get access spec."""
195
195
  return (
196
196
  SymbolAccess.PRIVATE
197
- if self.access and self.access.tag.value == Tok.KW_PRIV
197
+ if self.access and self.access.tag.name == Tok.KW_PRIV
198
198
  else (
199
199
  SymbolAccess.PROTECTED
200
- if self.access and self.access.tag.value == Tok.KW_PROT
200
+ if self.access and self.access.tag.name == Tok.KW_PROT
201
201
  else SymbolAccess.PUBLIC
202
202
  )
203
203
  )
@@ -3716,7 +3716,7 @@ class MatchArch(MatchPattern):
3716
3716
 
3717
3717
  def __init__(
3718
3718
  self,
3719
- name: NameSpec,
3719
+ name: AtomTrailer | NameSpec,
3720
3720
  arg_patterns: Optional[SubNodeList[MatchPattern]],
3721
3721
  kw_patterns: Optional[SubNodeList[MatchKVPair]],
3722
3722
  kid: Sequence[AstNode],