Python parser #4
Reference in New Issue
Block a user
Delete Branch "feat/python-parser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.