Typhon-Language 0.1.1__tar.gz → 0.1.3__tar.gz
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_language-0.1.1/src/Typhon_Language.egg-info → typhon_language-0.1.3}/PKG-INFO +51 -6
- typhon_language-0.1.1/PKG-INFO → typhon_language-0.1.3/README.md +153 -123
- {typhon_language-0.1.1 → typhon_language-0.1.3}/pyproject.toml +1 -1
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/translate.py +2 -1
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/_typhon_parser.py +1638 -1649
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/syntax_errors.py +11 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/typhon_ast.py +405 -55
- typhon_language-0.1.3/src/Typhon/Grammar/unparse_custom.py +25 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/SourceMap/datatype.py +264 -264
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/const_member_to_final.py +1 -1
- typhon_language-0.1.3/src/Typhon/Transform/extended_patterns.py +139 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/forbidden_statements.py +24 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/if_while_let.py +122 -11
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/inline_statement_block_capture.py +22 -15
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/placeholder_to_function.py +0 -1
- typhon_language-0.1.3/src/Typhon/Transform/record_to_dataclass.py +256 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/scope_check_rename.py +65 -11
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/transform.py +16 -12
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/type_abbrev_desugar.py +1 -1
- typhon_language-0.1.3/src/Typhon/Transform/utils/imports.py +48 -0
- typhon_language-0.1.1/src/Typhon/Transform/utils.py → typhon_language-0.1.3/src/Typhon/Transform/utils/jump_away.py +2 -38
- typhon_language-0.1.3/src/Typhon/Transform/utils/make_class.py +140 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Typing/pyright.py +143 -144
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Typing/result_diagnostic.py +1 -1
- typhon_language-0.1.3/src/Typhon/__init__.py +0 -0
- typhon_language-0.1.1/README.md → typhon_language-0.1.3/src/Typhon_Language.egg-info/PKG-INFO +168 -108
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon_Language.egg-info/SOURCES.txt +6 -1
- typhon_language-0.1.1/src/Typhon/Transform/record_to_dataclass.py +0 -472
- {typhon_language-0.1.1 → typhon_language-0.1.3}/LICENSE +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/setup.cfg +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/debugging.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/diagnostic.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/run.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/type_check.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Driver/utils.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/__init__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/line_break.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/parser.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/parser_helper.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/token_factory_custom.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Grammar/tokenizer_custom.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/SourceMap/__init__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/SourceMap/ast_match_based_map.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/SourceMap/ast_matching.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/__init__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/comprehension_to_function.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/func_literal_to_def.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/insert_self_to_method.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/name_generator.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/optional_operators_to_checked.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/type_annotation_check_expand.py +0 -0
- {typhon_language-0.1.1/src/Typhon/Typing → typhon_language-0.1.3/src/Typhon/Transform/utils}/__init__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/Transform/visitor.py +0 -0
- {typhon_language-0.1.1/src/Typhon → typhon_language-0.1.3/src/Typhon/Typing}/__init__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon/__main__.py +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon_Language.egg-info/dependency_links.txt +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon_Language.egg-info/entry_points.txt +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon_Language.egg-info/requires.txt +0 -0
- {typhon_language-0.1.1 → typhon_language-0.1.3}/src/Typhon_Language.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Typhon-Language
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Typhon programming language
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -17,17 +17,58 @@ Dynamic: license-file
|
|
|
17
17
|
|
|
18
18
|
Typhon is a modernized syntax sugar for Python, designed to improve developer experience with features like static typing, brace-based scoping, and expressive functional programming capabilities.
|
|
19
19
|
|
|
20
|
-
GitHub repository: [Typhon](https://github.com/hnakamura5/Typhon)
|
|
21
|
-
PyPI package: [Typhon-Language](https://pypi.org/project/Typhon-Language/)
|
|
20
|
+
- GitHub repository: [Typhon](https://github.com/hnakamura5/Typhon)
|
|
21
|
+
- PyPI package: [Typhon-Language](https://pypi.org/project/Typhon-Language/)
|
|
22
|
+
- VSCode extension: [Typhon Language Support](https://marketplace.visualstudio.com/items?itemName=hnakamura5.typhon-language-support) from [GitHub Repository](https://github.com/hnakamura5/typhon-language-support)
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
Install Typhon via pip:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install typhon-language
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run Typhon from the command line:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
typhon --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Create a simple Typhon program in `hello.typh`:
|
|
39
|
+
|
|
40
|
+
```typhon
|
|
41
|
+
def main() {
|
|
42
|
+
print("Hello, Typhon!")
|
|
43
|
+
}
|
|
44
|
+
main()
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Run the program:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
typhon run hello.typh
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or run directly using uvx:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uvx --from typhon-language typhon run hello.typh
|
|
57
|
+
```
|
|
22
58
|
|
|
23
59
|
## Design Concepts
|
|
24
60
|
|
|
25
61
|
Typhon is built on three core pillars:
|
|
26
62
|
|
|
27
|
-
1. **Safety**: As expected
|
|
63
|
+
1. **Safety**: As expected in modern programming languages, Typhon enforces safety through static typing, lexical scopes, immutable-by-default variables (`let`), and null safety features (`?.`, `??`, `?()`, `?[]`).
|
|
28
64
|
2. **Expressiveness**: Expression-oriented design with functional programming features. Control comprehension forms for `if`, `match`, `try`, and so on enable concise, value-returning expressions. Function literals, placeholders and pipe operators facilitate clean and readable code.
|
|
29
65
|
3. **Python Interoperability**: Typhon compiles directly to Python, allowing you to use the vast ecosystem of Python libraries seamlessly while enjoying a modern syntax.
|
|
30
66
|
|
|
67
|
+
### How it looks like
|
|
68
|
+
|
|
69
|
+
You can see small code snippets in the test directory: [Typhon Tests](test/execute/RunFileTest/).
|
|
70
|
+
|
|
71
|
+
|
|
31
72
|
## Documentation
|
|
32
73
|
|
|
33
74
|
For a complete guide to the language, please visit the **[Typhon Reference Manual](doc/reference/README.md)**.
|
|
@@ -48,8 +89,8 @@ Typhon retains most of Python's semantics but introduces significant syntax chan
|
|
|
48
89
|
|
|
49
90
|
### Main Changes
|
|
50
91
|
|
|
51
|
-
- **Brace Scoping**: Typhon uses `{ ... }` for blocks, replacing indentation-based scoping. Both `;` and line breaks can also act as delimiters. See [Lexical Structure](doc/reference/lexical_structure.md).
|
|
52
|
-
- **Static Typing**: Type checking is enforced at compile time.
|
|
92
|
+
- **Brace Scoping**: Typhon uses `{ ... }` for blocks, replacing indentation-based scoping. Both `;` and line breaks can also act as delimiters. See [Lexical Structure](doc/reference/lexical_structure.md) for more details.
|
|
93
|
+
- **Static Typing**: Type checking is enforced at compile time. Currently powered by [basedpyright](https://docs.basedpyright.com/latest/) type checker.
|
|
53
94
|
- **Declarations**: Variables must be declared with `let` (immutable) or `var` (mutable). See [Variables](doc/reference/variables.md).
|
|
54
95
|
|
|
55
96
|
### Syntax Extensions
|
|
@@ -83,6 +124,10 @@ Some Python features are removed to enforce safety and clarity. See [Removed Fea
|
|
|
83
124
|
|
|
84
125
|
Typhon can be run directly or translated to Python.
|
|
85
126
|
|
|
127
|
+
`.typh` files are Typhon source files. In directory mode, all `.typh` files are processed.
|
|
128
|
+
|
|
129
|
+
Note Typhon uses `.typhon` directory in source paths to place translated Python files and caches.
|
|
130
|
+
|
|
86
131
|
### Run
|
|
87
132
|
|
|
88
133
|
Run a Typhon source file or directory.
|
|
@@ -1,123 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
# Typhon
|
|
2
|
+
|
|
3
|
+
Typhon is a modernized syntax sugar for Python, designed to improve developer experience with features like static typing, brace-based scoping, and expressive functional programming capabilities.
|
|
4
|
+
|
|
5
|
+
- GitHub repository: [Typhon](https://github.com/hnakamura5/Typhon)
|
|
6
|
+
- PyPI package: [Typhon-Language](https://pypi.org/project/Typhon-Language/)
|
|
7
|
+
- VSCode extension: [Typhon Language Support](https://marketplace.visualstudio.com/items?itemName=hnakamura5.typhon-language-support) from [GitHub Repository](https://github.com/hnakamura5/typhon-language-support)
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
Install Typhon via pip:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install typhon-language
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run Typhon from the command line:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
typhon --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Create a simple Typhon program in `hello.typh`:
|
|
24
|
+
|
|
25
|
+
```typhon
|
|
26
|
+
def main() {
|
|
27
|
+
print("Hello, Typhon!")
|
|
28
|
+
}
|
|
29
|
+
main()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run the program:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
typhon run hello.typh
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or run directly using uvx:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uvx --from typhon-language typhon run hello.typh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Design Concepts
|
|
45
|
+
|
|
46
|
+
Typhon is built on three core pillars:
|
|
47
|
+
|
|
48
|
+
1. **Safety**: As expected in modern programming languages, Typhon enforces safety through static typing, lexical scopes, immutable-by-default variables (`let`), and null safety features (`?.`, `??`, `?()`, `?[]`).
|
|
49
|
+
2. **Expressiveness**: Expression-oriented design with functional programming features. Control comprehension forms for `if`, `match`, `try`, and so on enable concise, value-returning expressions. Function literals, placeholders and pipe operators facilitate clean and readable code.
|
|
50
|
+
3. **Python Interoperability**: Typhon compiles directly to Python, allowing you to use the vast ecosystem of Python libraries seamlessly while enjoying a modern syntax.
|
|
51
|
+
|
|
52
|
+
### How it looks like
|
|
53
|
+
|
|
54
|
+
You can see small code snippets in the test directory: [Typhon Tests](test/execute/RunFileTest/).
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
For a complete guide to the language, please visit the **[Typhon Reference Manual](doc/reference/README.md)**.
|
|
60
|
+
|
|
61
|
+
### Quick Links
|
|
62
|
+
|
|
63
|
+
- [Lexical Structure](doc/reference/lexical_structure.md) (Comments, Keywords, Delimiters)
|
|
64
|
+
- [Types](doc/reference/types.md)
|
|
65
|
+
- [Variables](doc/reference/variables.md)
|
|
66
|
+
- [Expressions](doc/reference/expressions/README.md)
|
|
67
|
+
- [Statements](doc/reference/statements/README.md)
|
|
68
|
+
- [Definitions](doc/reference/definitions/README.md) (Functions, Classes, Modules)
|
|
69
|
+
- [Removed Features](doc/reference/removed_features.md)
|
|
70
|
+
|
|
71
|
+
## Syntax Changes from Python
|
|
72
|
+
|
|
73
|
+
Typhon retains most of Python's semantics but introduces significant syntax changes.
|
|
74
|
+
|
|
75
|
+
### Main Changes
|
|
76
|
+
|
|
77
|
+
- **Brace Scoping**: Typhon uses `{ ... }` for blocks, replacing indentation-based scoping. Both `;` and line breaks can also act as delimiters. See [Lexical Structure](doc/reference/lexical_structure.md) for more details.
|
|
78
|
+
- **Static Typing**: Type checking is enforced at compile time. Currently powered by [basedpyright](https://docs.basedpyright.com/latest/) type checker.
|
|
79
|
+
- **Declarations**: Variables must be declared with `let` (immutable) or `var` (mutable). See [Variables](doc/reference/variables.md).
|
|
80
|
+
|
|
81
|
+
### Syntax Extensions
|
|
82
|
+
|
|
83
|
+
- **Null Safety**: `?.`, `??`, `?()`, `?[]` operators. See [Null Safety](doc/reference/expressions/null_safety.md).
|
|
84
|
+
- **Function literals**: Unrestricted function literals with `(x) => { return x + 1 }` syntax, with totally the same capability as normal functions. See[Function literals](doc/reference/expressions/literals.md#function-literals).
|
|
85
|
+
- **Pipe Operator**: `x |> f` for function chaining. See [Pipe Operator](doc/reference/expressions/pipe_operator.md).
|
|
86
|
+
- **Placeholders**: `_` for concise anonymous functions (e.g., `_ + 1`). See [Placeholders](doc/reference/expressions/placeholders.md).
|
|
87
|
+
- **Control Comprehensions**: Control statements as expressions (e.g., `(if (c) x else y)`). All `if/while/for/let/try/with/match` are supported as comprehension. See [Comprehensions](doc/reference/expressions/comprehensions.md).
|
|
88
|
+
- **Pattern Matching**: Enhanced `match`, `if-let`, and `let-else` statements. See [Control Flow](doc/reference/statements/control_flow.md).
|
|
89
|
+
- **`self` Keyword**: `self` is a keyword and is not explicitly declared in method signatures. See [Classes](doc/reference/items/classes.md).
|
|
90
|
+
- **Data Records**: Anonymous immutable structs `{|x=1|}`. See [Types](doc/reference/types.md).
|
|
91
|
+
- **Block Comments**: `#( ... )#` allows nested comments.
|
|
92
|
+
|
|
93
|
+
### Detailed Design Changes
|
|
94
|
+
|
|
95
|
+
- **Logical Operators**: `&&`, `||`, `!` replace `and`, `or`, `not` (though Python keywords are still reserved).
|
|
96
|
+
- **Const Parameters**: Function parameters are immutable by default.
|
|
97
|
+
- **Line Breaks**: Stricter rules for line continuations. See [Lexical Structure](doc/reference/lexical_structure.md).
|
|
98
|
+
|
|
99
|
+
### Syntax Restrictions
|
|
100
|
+
|
|
101
|
+
Some Python features are removed to enforce safety and clarity. See [Removed Features](doc/reference/removed_features.md).
|
|
102
|
+
|
|
103
|
+
- No `del`, `global`, `nonlocal`.
|
|
104
|
+
- No wildcard imports.
|
|
105
|
+
- No chained assignments (`a = b = c`).
|
|
106
|
+
- No control statements inside class bodies.
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
Typhon can be run directly or translated to Python.
|
|
111
|
+
|
|
112
|
+
`.typh` files are Typhon source files. In directory mode, all `.typh` files are processed.
|
|
113
|
+
|
|
114
|
+
Note Typhon uses `.typhon` directory in source paths to place translated Python files and caches.
|
|
115
|
+
|
|
116
|
+
### Run
|
|
117
|
+
|
|
118
|
+
Run a Typhon source file or directory.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
typhon run <source> [args...]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Translate
|
|
125
|
+
|
|
126
|
+
Translate Typhon code to Python.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
typhon translate <source> [-o output_dir]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Type Check
|
|
133
|
+
|
|
134
|
+
Run type checking on Typhon code.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
typhon type_check <source>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Future Plans
|
|
141
|
+
|
|
142
|
+
See [Future Plans](doc/reference/future_plans.md) for planned features like compile-time controls (`static if`) and known limitations.
|
|
143
|
+
|
|
144
|
+
## Influenced By
|
|
145
|
+
|
|
146
|
+
Typhon draws inspiration from several modern programming languages:
|
|
147
|
+
|
|
148
|
+
- Python
|
|
149
|
+
- TypeScript
|
|
150
|
+
- Swift
|
|
151
|
+
- Rust
|
|
152
|
+
- Scala
|
|
153
|
+
- F#
|
|
@@ -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()
|