Typhon-Language 0.1.2__py3-none-any.whl → 0.1.3__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.
- Typhon/Driver/translate.py +2 -1
- Typhon/Grammar/_typhon_parser.py +1638 -1649
- Typhon/Grammar/syntax_errors.py +11 -0
- Typhon/Grammar/typhon_ast.py +405 -55
- Typhon/Grammar/unparse_custom.py +25 -0
- Typhon/SourceMap/datatype.py +264 -264
- Typhon/Transform/const_member_to_final.py +1 -1
- Typhon/Transform/extended_patterns.py +139 -0
- Typhon/Transform/forbidden_statements.py +24 -0
- Typhon/Transform/if_while_let.py +122 -11
- Typhon/Transform/inline_statement_block_capture.py +22 -15
- Typhon/Transform/placeholder_to_function.py +0 -1
- Typhon/Transform/record_to_dataclass.py +22 -238
- Typhon/Transform/scope_check_rename.py +65 -11
- Typhon/Transform/transform.py +16 -12
- Typhon/Transform/type_abbrev_desugar.py +1 -1
- Typhon/Transform/utils/__init__.py +0 -0
- Typhon/Transform/utils/imports.py +48 -0
- Typhon/Transform/{utils.py → utils/jump_away.py} +2 -38
- Typhon/Transform/utils/make_class.py +140 -0
- Typhon/Typing/pyright.py +143 -144
- Typhon/Typing/result_diagnostic.py +1 -1
- {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/METADATA +7 -2
- typhon_language-0.1.3.dist-info/RECORD +53 -0
- typhon_language-0.1.2.dist-info/RECORD +0 -48
- {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/WHEEL +0 -0
- {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/entry_points.txt +0 -0
- {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/top_level.txt +0 -0
Typhon/Driver/translate.py
CHANGED
|
@@ -8,6 +8,7 @@ from ..Grammar.syntax_errors import (
|
|
|
8
8
|
TyphonSyntaxError,
|
|
9
9
|
TyphonSyntaxErrorList,
|
|
10
10
|
)
|
|
11
|
+
from ..Grammar.unparse_custom import unparse_custom
|
|
11
12
|
from .utils import (
|
|
12
13
|
shorthand,
|
|
13
14
|
TYPHON_EXT,
|
|
@@ -43,7 +44,7 @@ def translate_file(source: Path, output: Path) -> TranslateResult:
|
|
|
43
44
|
source_map=None,
|
|
44
45
|
syntax_error=e,
|
|
45
46
|
)
|
|
46
|
-
translated_code =
|
|
47
|
+
translated_code = unparse_custom(ast_tree)
|
|
47
48
|
source_code = source.read_text(encoding="utf-8")
|
|
48
49
|
mapping = map_from_transformed_ast(
|
|
49
50
|
ast_tree, ast.parse(translated_code), source_code, source.as_posix()
|