hy/bin/hy2py
Paul Tagliamonte c5c36e1022 Merge branch 'master' into paultag/bugfix/python3.4
Conflicts:
	bin/hy2py
2014-01-03 19:57:05 -05:00

25 lines
557 B
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function
from hy.importer import (import_file_to_ast, import_file_to_module,
import_file_to_hst)
import astor.codegen
import sys
module_name = "<STDIN>"
hst = import_file_to_hst(sys.argv[1])
print(str(hst).encode("utf-8"))
print("")
print("")
_ast = import_file_to_ast(sys.argv[1], module_name)
print("")
print("")
print(astor.dump(_ast).encode("utf-8"))
print("")
print("")
print(astor.codegen.to_source(_ast).encode("utf-8"))
import_file_to_module(module_name, sys.argv[1])