diff --git a/hy/core/__init__.py b/hy/core/__init__.py index 55b9b9c..324ab96 100644 --- a/hy/core/__init__.py +++ b/hy/core/__init__.py @@ -18,6 +18,8 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. +from hy.macros import process as mprocess + import importlib @@ -26,6 +28,11 @@ MACROS = [ ] +def process(tree): + load_macros() + return mprocess(tree) + + def load_macros(): for module in MACROS: importlib.import_module(module) diff --git a/hy/importer.py b/hy/importer.py index 30085ec..f6c0402 100644 --- a/hy/importer.py +++ b/hy/importer.py @@ -1,8 +1,7 @@ # from hy.lex import tokenize -from hy.macros import process -from hy.core import load_macros +from hy.core import process from hy.compiler import hy_compile @@ -13,7 +12,6 @@ import os def import_file_to_hst(fpath): tree = tokenize(open(fpath, 'r').read()) - load_macros() tree = process(tree) return tree