This PR implements a simple code generator which simply removes type annotations and unwraps cast expressions to produce interpretable Python code.
It also includes a complete redesign of the CLI, cleanly separating commands in different files, and simplifying the overloaded ones.
The new CLI includes the following commands:
Command
Description
midas check <file.py> [--types <file.midas>]
Run type checker and report diagnostics
midas types <file.py> [--types <file.midas>]
Print typing judgements for all expressions
midas dump-registry [--types <file.midas>]
Show the whole types registry
midas parse <file.{midas,py}>
Parse and pretty-print AST
midas validate <file.midas>
Validate Midas definitions
midas compile <file.py> [--types <file.midas>]
Compile source
This PR implements a simple code generator which simply removes type annotations and unwraps cast expressions to produce interpretable Python code.
It also includes a complete redesign of the CLI, cleanly separating commands in different files, and simplifying the overloaded ones.
The new CLI includes the following commands:
<table>
<thead><tr><th>Command</th><th>Description</th></tr></thead>
<tbody>
<tr>
<td>
```shell
midas check <file.py> [--types <file.midas>]
```
</td>
<td>Run type checker and report diagnostics</td>
</tr>
<tr>
<td>
```shell
midas types <file.py> [--types <file.midas>]
```
</td>
<td>Print typing judgements for all expressions</td>
</tr>
<tr>
<td>
```shell
midas dump-registry [--types <file.midas>]
```
</td>
<td>Show the whole types registry</td>
</tr>
<tr>
<td>
```shell
midas parse <file.{midas,py}>
```
</td>
<td>Parse and pretty-print AST</td>
</tr>
<tr>
<td>
```shell
midas validate <file.midas>
```
</td>
<td>Validate Midas definitions</td>
</tr>
<tr>
<td>
```shell
midas compile <file.py> [--types <file.midas>]
```
</td>
<td>Compile source</td>
</tr>
</tbody>
</table>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR implements a simple code generator which simply removes type annotations and unwraps cast expressions to produce interpretable Python code.
It also includes a complete redesign of the CLI, cleanly separating commands in different files, and simplifying the overloaded ones.
The new CLI includes the following commands: