Adding more testing.

This commit is contained in:
Paul R. Tagliamonte 2013-03-02 23:47:16 -05:00
parent efdccb75bb
commit b42fdc0bb7
8 changed files with 40 additions and 0 deletions

View File

@ -18,7 +18,15 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
from abc import ABCMeta, abstractmethod
class HyCompiler(object):
__metaclass__ = ABCMeta
def __init__(self):
pass
@abstractmethod
def compile(self, tree):
pass

View File

@ -18,5 +18,8 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
from hy.compilers import HyCompiler
class HyASTCompiler(HyCompiler):
pass

View File

@ -37,6 +37,7 @@ setup(
'hy',
'hy.lex',
'hy.models',
'hy.compilers',
],
author="Paul Tagliamonte",
author_email="tag@pault.ag",

0
tests/__init__.py Normal file
View File

View File

View File

@ -0,0 +1,28 @@
# 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.
from hy.compilers.ast import HyASTCompiler
from hy.lex import tokenize
def test_ast_expression():
""" Test AST --> Expression conversion """
compiler = HyASTCompiler()
code = compiler.compile(tokenize("(foo bar)"))

0
tests/lex/__init__.py Normal file
View File