jaclang 0.5.15__py3-none-any.whl → 0.5.17__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 +1 -1
- jaclang/compiler/absyntree.py +7 -6
- jaclang/compiler/generated/jac_parser.py +1 -1
- jaclang/compiler/parser.py +2 -2
- jaclang/compiler/passes/main/import_pass.py +2 -2
- jaclang/compiler/passes/main/pyast_gen_pass.py +2 -2
- jaclang/compiler/passes/main/pyast_load_pass.py +2 -2
- jaclang/compiler/passes/main/sym_tab_build_pass.py +1 -1
- jaclang/compiler/passes/tool/jac_formatter_pass.py +144 -21
- jaclang/compiler/passes/tool/tests/test_jac_format_pass.py +66 -55
- jaclang/compiler/workspace.py +2 -2
- jaclang/plugin/default.py +9 -2
- {jaclang-0.5.15.dist-info → jaclang-0.5.17.dist-info}/METADATA +1 -1
- {jaclang-0.5.15.dist-info → jaclang-0.5.17.dist-info}/RECORD +17 -17
- {jaclang-0.5.15.dist-info → jaclang-0.5.17.dist-info}/WHEEL +0 -0
- {jaclang-0.5.15.dist-info → jaclang-0.5.17.dist-info}/entry_points.txt +0 -0
- {jaclang-0.5.15.dist-info → jaclang-0.5.17.dist-info}/top_level.txt +0 -0
jaclang/cli/cli.py
CHANGED
jaclang/compiler/absyntree.py
CHANGED
|
@@ -591,7 +591,7 @@ class Import(ElementStmt, CodeBlockStmt):
|
|
|
591
591
|
|
|
592
592
|
def __init__(
|
|
593
593
|
self,
|
|
594
|
-
|
|
594
|
+
hint: SubTag[Name],
|
|
595
595
|
paths: list[ModulePath],
|
|
596
596
|
items: Optional[SubNodeList[ModuleItem]],
|
|
597
597
|
is_absorb: bool, # For includes
|
|
@@ -599,7 +599,7 @@ class Import(ElementStmt, CodeBlockStmt):
|
|
|
599
599
|
doc: Optional[String] = None,
|
|
600
600
|
) -> None:
|
|
601
601
|
"""Initialize import node."""
|
|
602
|
-
self.
|
|
602
|
+
self.hint = hint
|
|
603
603
|
self.paths = paths
|
|
604
604
|
self.items = items
|
|
605
605
|
self.is_absorb = is_absorb
|
|
@@ -610,7 +610,7 @@ class Import(ElementStmt, CodeBlockStmt):
|
|
|
610
610
|
"""Normalize import node."""
|
|
611
611
|
res = True
|
|
612
612
|
if deep:
|
|
613
|
-
res = self.
|
|
613
|
+
res = self.hint.normalize(deep)
|
|
614
614
|
for p in self.paths:
|
|
615
615
|
res = res and p.normalize(deep)
|
|
616
616
|
res = res and self.items.normalize(deep) if self.items else res
|
|
@@ -622,7 +622,7 @@ class Import(ElementStmt, CodeBlockStmt):
|
|
|
622
622
|
new_kid.append(self.gen_token(Tok.KW_INCLUDE))
|
|
623
623
|
else:
|
|
624
624
|
new_kid.append(self.gen_token(Tok.KW_IMPORT))
|
|
625
|
-
new_kid.append(self.
|
|
625
|
+
new_kid.append(self.hint)
|
|
626
626
|
if self.items:
|
|
627
627
|
new_kid.append(self.gen_token(Tok.KW_FROM))
|
|
628
628
|
for p in self.paths:
|
|
@@ -671,8 +671,8 @@ class ModulePath(AstSymbolNode):
|
|
|
671
671
|
res = res and p.normalize(deep)
|
|
672
672
|
res = res and self.alias.normalize(deep) if self.alias else res
|
|
673
673
|
new_kid: list[AstNode] = []
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
for _ in range(self.level):
|
|
675
|
+
new_kid.append(self.gen_token(Tok.DOT))
|
|
676
676
|
if self.path:
|
|
677
677
|
for p in self.path:
|
|
678
678
|
res = res and p.normalize(deep)
|
|
@@ -681,6 +681,7 @@ class ModulePath(AstSymbolNode):
|
|
|
681
681
|
new_kid.pop()
|
|
682
682
|
if self.alias:
|
|
683
683
|
res = res and self.alias.normalize(deep)
|
|
684
|
+
new_kid.append(self.gen_token(Tok.KW_AS))
|
|
684
685
|
new_kid.append(self.alias)
|
|
685
686
|
self.set_kids(nodes=new_kid)
|
|
686
687
|
return res
|