This PR adds a simple parser which takes in a Python Module (an AST node) and converts it to our own internal AST structure.
This is done for two reasons:
Parse custom type annotation into a more semantically explicit structure (Frame[name: Type] is a Frame with a column named name of type Type, not a subscript with a slice)
Simplify Python constructs to expose typed operations (e.g. assignments, annotations, function definitions and calls, etc.)
The latter might not be fully required, as it involves a lot of redundancy with Python's own AST nodes, but it provides a more consistent interface with custom types
This PR also adds a utility gen/gen.py script to help generate AST node classes from simple templates.
Finally, it also adds a new utility command midas utils highlight -o OUTPUT SOURCE_FILE which runs the Midas or Python parser against the provided source file and outputs the highlighted code as a standalone HTML file.
This PR adds a simple parser which takes in a Python Module (an AST node) and converts it to our own internal AST structure.
This is done for two reasons:
- Parse custom type annotation into a more semantically explicit structure (`Frame[name: Type]` is a `Frame` with a column named `name` of type `Type`, not a subscript with a slice)
- Simplify Python constructs to expose typed operations (e.g. assignments, annotations, function definitions and calls, etc.)
The latter might not be fully required, as it involves a lot of redundancy with Python's own AST nodes, but it provides a more consistent interface with custom types
This PR also adds a utility `gen/gen.py` script to help generate AST node classes from simple templates.
Finally, it also adds a new utility command `midas utils highlight -o OUTPUT SOURCE_FILE` which runs the Midas or Python parser against the provided source file and outputs the highlighted code as a standalone HTML file.
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 adds a simple parser which takes in a Python Module (an AST node) and converts it to our own internal AST structure.
This is done for two reasons:
Frame[name: Type]is aFramewith a column namednameof typeType, not a subscript with a slice)The latter might not be fully required, as it involves a lot of redundancy with Python's own AST nodes, but it provides a more consistent interface with custom types
This PR also adds a utility
gen/gen.pyscript to help generate AST node classes from simple templates.Finally, it also adds a new utility command
midas utils highlight -o OUTPUT SOURCE_FILEwhich runs the Midas or Python parser against the provided source file and outputs the highlighted code as a standalone HTML file.