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.
Files changed (29) hide show
  1. Typhon/Driver/translate.py +2 -1
  2. Typhon/Grammar/_typhon_parser.py +1638 -1649
  3. Typhon/Grammar/syntax_errors.py +11 -0
  4. Typhon/Grammar/typhon_ast.py +405 -55
  5. Typhon/Grammar/unparse_custom.py +25 -0
  6. Typhon/SourceMap/datatype.py +264 -264
  7. Typhon/Transform/const_member_to_final.py +1 -1
  8. Typhon/Transform/extended_patterns.py +139 -0
  9. Typhon/Transform/forbidden_statements.py +24 -0
  10. Typhon/Transform/if_while_let.py +122 -11
  11. Typhon/Transform/inline_statement_block_capture.py +22 -15
  12. Typhon/Transform/placeholder_to_function.py +0 -1
  13. Typhon/Transform/record_to_dataclass.py +22 -238
  14. Typhon/Transform/scope_check_rename.py +65 -11
  15. Typhon/Transform/transform.py +16 -12
  16. Typhon/Transform/type_abbrev_desugar.py +1 -1
  17. Typhon/Transform/utils/__init__.py +0 -0
  18. Typhon/Transform/utils/imports.py +48 -0
  19. Typhon/Transform/{utils.py → utils/jump_away.py} +2 -38
  20. Typhon/Transform/utils/make_class.py +140 -0
  21. Typhon/Typing/pyright.py +143 -144
  22. Typhon/Typing/result_diagnostic.py +1 -1
  23. {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/METADATA +7 -2
  24. typhon_language-0.1.3.dist-info/RECORD +53 -0
  25. typhon_language-0.1.2.dist-info/RECORD +0 -48
  26. {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/WHEEL +0 -0
  27. {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/entry_points.txt +0 -0
  28. {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/licenses/LICENSE +0 -0
  29. {typhon_language-0.1.2.dist-info → typhon_language-0.1.3.dist-info}/top_level.txt +0 -0
@@ -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 = ast.unparse(ast_tree)
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()