# HG changeset patch # User paulb@localhost.localdomain # Date 1172963461 -3600 # Node ID 9c8152cabd96163876cfe32fbf905083c2a36d68 # Parent 319e35c72bb18e0904490e58a9bbe2c694659f94 Fixed the range built-in function. Added a time module. Added the "lib" directory to the end of the import path. Added a variable for the location of the "lib" directory to simplified. diff -r 319e35c72bb1 -r 9c8152cabd96 annotate.py --- a/annotate.py Mon Feb 26 00:59:15 2007 +0100 +++ b/annotate.py Sun Mar 04 00:11:01 2007 +0100 @@ -1562,6 +1562,7 @@ """ self.path = path or [os.getcwd()] + self.path.append(libdir) self.modules = {} def find_in_path(self, name): diff -r 319e35c72bb1 -r 9c8152cabd96 lib/builtins.py --- a/lib/builtins.py Mon Feb 26 00:59:15 2007 +0100 +++ b/lib/builtins.py Sun Mar 04 00:11:01 2007 +0100 @@ -922,7 +922,12 @@ max_so_far = i return max_so_far -def range(start, end, step=None): +def range(start_or_end, end=None, step=None): + if end is None: + start = 0 + end = start_or_end + else: + start = start_or_end if start == end: return [] elif start > end: diff -r 319e35c72bb1 -r 9c8152cabd96 lib/time.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/time.py Sun Mar 04 00:11:01 2007 +0100 @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +""" +Time module prototypes. + +Copyright (C) 2007 Paul Boddie + +This software is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of +the License, or (at your option) any later version. + +This software is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with this library; see the file LICENCE.txt +If not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +""" + +def clock(): + return float() + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 319e35c72bb1 -r 9c8152cabd96 simplified.py --- a/simplified.py Mon Feb 26 00:59:15 2007 +0100 +++ b/simplified.py Sun Mar 04 00:11:01 2007 +0100 @@ -26,6 +26,13 @@ from compiler.visitor import ASTVisitor import sys +# Location of the built-in libraries. +# NOTE: Change this if the package structure changes. + +import os + +libdir = os.path.join(os.path.split(__file__)[0], "lib") + # Exceptions. class SimplifiedError(Exception):