hy/bin/hy2py

25 lines
557 B
Plaintext
Raw Normal View History

2013-03-05 18:16:04 -05:00
#!/usr/bin/env python
from __future__ import print_function
2013-03-05 18:16:04 -05:00
2013-03-08 18:18:43 -05:00
from hy.importer import (import_file_to_ast, import_file_to_module,
import_file_to_hst)
2013-04-27 20:52:37 -04:00
import astor.codegen
2013-03-05 18:16:04 -05:00
import sys
module_name = "<STDIN>"
2013-03-08 18:18:43 -05:00
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"))
2013-03-08 23:41:04 -05:00
import_file_to_module(module_name, sys.argv[1])