Adding in better things.

This commit is contained in:
Paul R. Tagliamonte 2013-03-09 15:10:49 -05:00
parent aa89c3c98e
commit a19d085620
2 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,31 @@
# Copyright (c) 2012 Paul Tagliamonte <paultag@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
import importlib
MACROS = [
"hy.core.bootstrap", # defn, cond
]
def load_macros():
for module in MACROS:
importlib.import_module(module)

View File

@ -2,10 +2,9 @@
from hy.lex import tokenize
from hy.macros import process
from hy.core import load_macros
from hy.compiler import hy_compile
import hy.core.bootstrap # NOQA
import imp
import sys
@ -14,6 +13,7 @@ import os
def import_file_to_hst(fpath):
tree = tokenize(open(fpath, 'r').read())
load_macros()
tree = process(tree)
return tree