2013-03-06 00:16:04 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from hy.compiler import hy_compile
|
|
|
|
from hy.lex import tokenize
|
|
|
|
import codegen
|
|
|
|
import sys
|
2013-03-06 03:42:54 +01:00
|
|
|
import ast
|
2013-03-06 00:16:04 +01:00
|
|
|
|
2013-03-06 03:42:54 +01:00
|
|
|
tokens = tokenize(open(sys.argv[1], 'r').read())
|
|
|
|
print tokens
|
|
|
|
_ast = hy_compile(tokens)
|
|
|
|
print ast.dump(_ast)
|
|
|
|
print codegen.to_source(_ast)
|