Safe Haskell | None |
---|---|
Language | Haskell2010 |
Sifflet to abstract syntax tree for Python. Use Python module's pyPretty to pretty-print the result.
- data PythonOptions = PythonOptions
- defaultPythonOptions :: PythonOptions
- exprToPExpr :: Expr -> Expr
- nameToPython :: String -> Either Operator String
- fixIdentifierChars :: String -> String
- functionToPyDef :: Function -> PStatement
- defToPy :: FunctionDefTuple -> PStatement
- functionsToPyModule :: Functions -> PModule
- functionsToPrettyPy :: Functions -> String
- exportPython :: VPUI -> PythonOptions -> Exporter
Documentation
data PythonOptions Source
Options for Python export. Should probably include choices like Python2 or Python3; if statement or if expression. Right now, just a placeholder.
exprToPExpr :: Expr -> Expr Source
nameToPython :: String -> Either Operator String Source
Convert Sifflet name (of a function) to Python operator (Left) or function name (Right)
fixIdentifierChars :: String -> String Source
Remove characters that are not valid in a Python identifier, and in some cases, insert other characters to show what's missing
functionToPyDef :: Function -> PStatement Source
Create a Python def statement from a Sifflet function. Minimally parenthesized.
exportPython :: VPUI -> PythonOptions -> Exporter Source