1.1 --- a/micropython/common.py Fri Nov 15 13:15:30 2013 +0100
1.2 +++ b/micropython/common.py Fri Nov 15 15:46:47 2013 +0100
1.3 @@ -19,8 +19,8 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from micropython.stdcompiler import compiler
1.8 from compiler.ast import AssAttr, Getattr, Name
1.9 -import compiler.ast
1.10 from micropython.basicdata import Const, Constant, TypedInstance
1.11 from micropython.data import BaseAttr, Class, Module
1.12 from micropython.errors import *
2.1 --- a/micropython/deduce.py Fri Nov 15 13:15:30 2013 +0100
2.2 +++ b/micropython/deduce.py Fri Nov 15 15:46:47 2013 +0100
2.3 @@ -22,7 +22,6 @@
2.4 from micropython.common import *
2.5 from micropython.data import *
2.6 from micropython.errors import *
2.7 -import compiler.ast
2.8
2.9 # Source code classes.
2.10
3.1 --- a/micropython/inspect.py Fri Nov 15 13:15:30 2013 +0100
3.2 +++ b/micropython/inspect.py Fri Nov 15 15:46:47 2013 +0100
3.3 @@ -75,7 +75,7 @@
3.4 from micropython.common import ASTVisitor, operator_functions, get_module_name
3.5 from micropython.data import *
3.6 from micropython.errors import *
3.7 -import compiler.ast
3.8 +from micropython.stdcompiler import compiler
3.9 import sys
3.10
3.11 class NullBranch(compiler.ast.AttributeUser):
4.1 --- a/micropython/report.py Fri Nov 15 13:15:30 2013 +0100
4.2 +++ b/micropython/report.py Fri Nov 15 15:46:47 2013 +0100
4.3 @@ -23,7 +23,7 @@
4.4 from micropython.data import *
4.5 from micropython.errors import *
4.6 from os.path import exists, extsep, join
4.7 -import compiler.ast
4.8 +from micropython.stdcompiler import compiler
4.9 import sys
4.10 import os
4.11 import textwrap
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/micropython/stdcompiler.py Fri Nov 15 15:46:47 2013 +0100
5.3 @@ -0,0 +1,29 @@
5.4 +#!/usr/bin/env python
5.5 +
5.6 +"""
5.7 +Compiler module import control.
5.8 +
5.9 +Copyright (C) 2013 Paul Boddie <paul@boddie.org.uk>
5.10 +
5.11 +This program is free software; you can redistribute it and/or modify it under
5.12 +the terms of the GNU General Public License as published by the Free Software
5.13 +Foundation; either version 3 of the License, or (at your option) any later
5.14 +version.
5.15 +
5.16 +This program is distributed in the hope that it will be useful, but WITHOUT
5.17 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
5.18 +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
5.19 +details.
5.20 +
5.21 +You should have received a copy of the GNU General Public License along with
5.22 +this program. If not, see <http://www.gnu.org/licenses/>.
5.23 +"""
5.24 +
5.25 +import compiler.ast
5.26 +
5.27 +if not hasattr(compiler.ast, "AttributeUser"):
5.28 + raise SystemError, "The compiler module must support micropython " \
5.29 + "annotations. See the documentation for more " \
5.30 + "information."
5.31 +
5.32 +# vim: tabstop=4 expandtab shiftwidth=4
6.1 --- a/micropython/syspython.py Fri Nov 15 13:15:30 2013 +0100
6.2 +++ b/micropython/syspython.py Fri Nov 15 15:46:47 2013 +0100
6.3 @@ -23,7 +23,7 @@
6.4 from micropython.data import *
6.5 from micropython.errors import *
6.6 from os.path import exists, extsep, join
6.7 -import compiler.ast
6.8 +from micropython.stdcompiler import compiler
6.9 import sys
6.10 import os
6.11