Do the macro processing in the compiler

This commit is contained in:
Nicolas Dandrimont 2013-05-01 19:50:06 +02:00
parent 3d8a3d589c
commit e9f7c47663
2 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,8 @@ from hy.models.float import HyFloat
from hy.models.list import HyList
from hy.models.dict import HyDict
from hy.core import process
from hy.util import str_type
import codecs
@ -361,6 +363,7 @@ class HyASTCompiler(object):
def compile_atom(self, atom_type, atom):
if atom_type in _compile_table:
atom = process(atom)
ret = _compile_table[atom_type](self, atom)
if not isinstance(ret, Result):
ret = Result() + ret

View File

@ -21,7 +21,6 @@
from py_compile import wr_long, MAGIC
from hy.compiler import hy_compile
from hy.models import HyObject
from hy.core import process
from hy.lex import tokenize
@ -48,7 +47,7 @@ def ast_compile(ast, filename, mode):
def import_buffer_to_hst(buf):
"""Import content from buf and return an Hy AST."""
return process(tokenize(buf + "\n"))
return tokenize(buf + "\n")
def import_file_to_hst(fpath):