From 276df1b1032fc15d66d24fd15888dd6451601ff5 Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Sat, 9 Mar 2013 16:34:35 -0500 Subject: [PATCH] thinking through some manglers. --- hy/core/__init__.py | 7 +++++++ hy/importer.py | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) 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