Commit Graph

11743 Commits

Author SHA1 Message Date
Fred Drake 13a2c279c5 Untabify to pass the -tt test. 2000-02-10 17:17:14 +00:00
Fred Drake 857c4c36b9 Detabify.
I ran "expand" instead of using Skip's patch, but it's all the same.
2000-02-10 16:21:11 +00:00
Jack Jansen 8574378ad4 In AskYesNoCancel() treat the "yes" and "no" buttons the same way as the cancel
button (i.e. an empty label hides the button).
2000-02-10 16:15:53 +00:00
Fred Drake ad892dc80d Make this pass the -tt test. 2000-02-10 15:31:07 +00:00
Greg Ward 62e3393e4d Stylistic changes to the registry-grovelling code: code formatting, changed
function names, dbetter (hopefully) ocstrings, and comments.
2000-02-10 02:52:42 +00:00
Greg Ward 10ca82b57c Typecheck 'output_dir' argument to compile/link methods. 2000-02-10 02:51:32 +00:00
Greg Ward 968d883be5 Path from Thomas Heller: resurrect the .def file kludge while preserving the
/export option mini-kludge.
2000-02-10 02:17:06 +00:00
Greg Ward 4ba9b2e3b6 Patch from Thomas heller:
* don't need to mention python<ver>.lib -- it's done by a pragma
  * add debug flags for compile and link, and use them
  * fix 'link_shared_library()' to pass everything to 'link_shared_object()'
  * change filename when shared object with debug info (ugh)
2000-02-10 02:15:52 +00:00
Jeremy Hylton 5e0ce53e0e add ExampleASTVisitor:
* prints out examples of nodes that are handled by visitor.  simply a
  development convenience

remove NestedCodeGenerator -- it was bogus after all
replace with generateFunctionCode, a method to call to generate code
  for a function instead of a top-level module

fix impl of visitDiscard (most pop stack)
emit lineno for pass

handle the following new node types: Import, From, Getattr, Subscript,
Slice, AssAttr, AssTuple, Mod, Not, And, Or, List

LocalNameFinder: remove names declared as globals for locals

PythonVMCode: pass arg names to constructor, force varnames to contain
them all (even if they aren't referenced)

add -q option on command line to disable stdout
2000-02-10 00:47:08 +00:00
Jeremy Hylton 69926eaee0 add remove method to set 2000-02-10 00:43:22 +00:00
Greg Ward e8c6ce4684 Added 'debug' option, and changed compile/link calls to use it. 2000-02-09 02:20:14 +00:00
Greg Ward 324620015d Added 'debug' option (just there for 'build_ext' and 'build_lib' commands
to fallback to if the user doesn't set it for those commands.
2000-02-09 02:19:49 +00:00
Greg Ward 386b84439f Added 'debug' flags to compile and link methods, and added dummy code for
someone who knows Windows/MSVC++ to come along and add the right flags.
Comment noting that 'link_static_lib()' signature is inconsistent with
  the other compiler classes (uh-oh!)
2000-02-09 02:18:39 +00:00
Greg Ward ba233fbe92 Added 'debug' flags to compile and link methods, and modified code to add
'-g' flag to compiler/linker command lines when it's true.
2000-02-09 02:17:00 +00:00
Greg Ward 3c045a5766 Added 'debug' flag to compile and link method signatures.
Doc fix: several paragraphs under 'link_static_lib()' moved to
  'link_shared_lib()', where they belong.
2000-02-09 02:16:14 +00:00
Jeremy Hylton 402456020b add optional verbose arg to walk function. it overrides the global
VERBOSE setting for the ASTVisitor

add getopt handling for one or more -v args

rename ForwardRef to StackRef, because it isn't necessarily directional

CodeGenerator:
* add assertStackEmpty method.  prints warning if stack is not empty
  when it should be
* define methods for AssName, UNARY_*, For

PythonVMCode:
* fix mix up between hasjrel and hasjabs for address calculation
2000-02-08 21:15:48 +00:00
Jeremy Hylton 156a975476 make all unary operators have a single child node called expr 2000-02-08 21:06:19 +00:00
Jeremy Hylton 1851901a05 add spaces to comparison names is not and not in to match dis 2000-02-08 19:58:33 +00:00
Jeremy Hylton 53187f32eb now produces valid pyc files for a least a trivial subset of the
language.

CodeGenerator:
* modify to track stack depth
* add emit method that call's PythonVMCode's makeCodeObject
* thread filenames through in hackish way
* set flags for code objects for modules and functions
  XXX the docs for the flags seem out of date and/or incomplete

PythonVMCode:
* add doc string describing the elements of a real code object

LineAddrTable:
* creates an lnotab (no quite correctly though)
2000-02-08 19:01:29 +00:00
Jeremy Hylton aa9d2d6123 constants from transformer 2000-02-08 18:57:51 +00:00
Jeremy Hylton 9605c11c4c move constants out of transformer so that they can be shared with ast
add varargs and kwargs attributes to Function nodes
2000-02-08 18:57:32 +00:00
Fred Drake 69e2c6efbb get_config_h_filename(): Support NT as well as Posix systems.
_init_nt():  Use get_config_h_filename() instead of figuring out the
             name directly.

             g['SO'] should be set to '.pyd'.

             Adjust some minor coding nits.
2000-02-08 15:55:42 +00:00
Greg Ward 1b9c6f7788 Revised version (thank to Thomas Heller and Robin Becker) that tries a lot
harder to find the MSVC compiler (mainly by using the registry).
2000-02-08 02:39:44 +00:00
Greg Ward f0219ba290 Ditch .def file kludge for (much smaller) /export option kludge. 2000-02-08 02:37:15 +00:00
Fred Drake da8d216eb2 Protect against core dumps in gdbm: don't allow access by key once the
database is closed.  Raise gdbm.error instead.

Bug report #198 submitted by Barry Haddow <bhaddow@orbism.com>.
2000-02-07 17:19:41 +00:00
Fred Drake a710d6e20c Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.
2000-02-07 17:15:48 +00:00
Guido van Rossum ef6ceb62bd Same patch (also by Mark Hammond) for this straggler project file as
for the other projects, to move the x86 project names back to what
they were.
2000-02-07 15:29:43 +00:00
Greg Ward 1bea7ab7bd Added 'libraries' option for use by the 'build_lib' command.
Typo fix.
2000-02-05 02:24:52 +00:00
Greg Ward 5f7c18e816 Run the 'build_lib' command before building extensions, if necessary. 2000-02-05 02:24:16 +00:00
Greg Ward aaf27ee07b New command to build C (and C++, hopefully) libraries needed by extensions
in the current distribution: motivated by PIL's libImaging.
2000-02-05 02:23:59 +00:00
Greg Ward c1854673e2 Tweaked various comments, docstrings, and error messages. 2000-02-05 02:23:16 +00:00
Fred Drake 0d40ba4cdf Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>:
Attached is patch (against 1.5.2 release) to allow some modules
to be buildable as pyd's (usual &PyType_Type stuff).
2000-02-04 20:33:49 +00:00
Jeremy Hylton 0fdffcf916 rapid evolution towards producing real .pyc files (even though I don't
handle most of the language syntax yet)

create NestedCodeGenerator used to generator the separate code object
that needs to be passed as an argument to MAKE_FUNCTION when a def
stmt is found (probably useful for class too)

change CodeGenerator.visitFunction to use the NestedCG

add CompiledModule class to handle creation of .pyc (pretty minimal
for now)

add makeCodeObject method to PythonVMCode that replaces symbolic names
with indexes into slots of the code code.  the design of this
class will probably need to be revised.
2000-02-04 19:37:35 +00:00
Guido van Rossum 1fdae12c93 Added a simple test program to disassemble a file, invoked as __main__. 2000-02-04 17:47:55 +00:00
Guido van Rossum 4b8c6eaf8b Actually, the previous batch's comment should have been different;
*this* set of patches is Ka-Ping's final sweep:

The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:39:30 +00:00
Guido van Rossum e7b146fb3b The third and final doc-string sweep by Ka-Ping Yee.
The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:28:42 +00:00
Guido van Rossum 54f22ed30b More trivial comment -> docstring transformations by Ka-Ping Yee,
who writes:

Here is batch 2, as a big collection of CVS context diffs.
Along with moving comments into docstrings, i've added a
couple of missing docstrings and attempted to make sure more
module docstrings begin with a one-line summary.

I did not add docstrings to the methods in profile.py for
fear of upsetting any careful optimizations there, though
i did move class documentation into class docstrings.

The convention i'm using is to leave credits/version/copyright
type of stuff in # comments, and move the rest of the descriptive
stuff about module usage into module docstrings.  Hope this is
okay.
2000-02-04 15:10:34 +00:00
Jeremy Hylton 8b6323d3ef checking in initial weekend's work
compile.py: ASTVisitor framework plus bits of a code generator that
    should be bug-for-buf compatible with compile.c

misc.py: Set and Stack helpers

test.py: a bit of simple sample code that compile.py will work on
2000-02-04 00:28:21 +00:00
Jeremy Hylton 106a02da94 make p2c a package 2000-02-04 00:25:34 +00:00
Jeremy Hylton f968e8545d three files from the p2c cvs tree. the message here indicates the
revision number the p2c cvs tree.

COPYRIGHT: 1.1
ast.py: 1.3
transformer.py: 1.11
2000-02-04 00:25:23 +00:00
Greg Ward 7f0fb0b01e Improved an error message.
Announce when we start building each extension (better feedback).
2000-02-03 23:07:54 +00:00
Greg Ward ef6f515d49 Changed 'compile()' method to compile files one-at-a-time -- gives better
feedback and, theoretically, the opportunity to set compiler flags
on a per-file basis.
2000-02-03 23:07:19 +00:00
Guido van Rossum 4310debbd8 Mark Hammond renames the x86 projects back to what they were named
before the patch by Trent Mick.  Since he now also works for
ActiveState, I suppose he overrides Trent. :-)
2000-02-03 17:19:35 +00:00
Fred Drake 2bb43a20ce The dircmp module is now obsolete. 2000-02-03 15:27:26 +00:00
Fred Drake d89ffebd85 These modules are now declared obsolete. 2000-02-03 15:26:16 +00:00
Guido van Rossum ff484183de According to Harri Pasanen, the Solaris+gcc test for LINKFORSHARED
needed an adaptation for the latest gcc -- we need to grep stderr as
well as stdout for the magic string BFD.  (Does anybody know what BFD
means?)
2000-02-03 13:50:24 +00:00
Guido van Rossum 9c6ba9b598 According to Harri Pasanen, the Solaris+gcc test for LINKFORSHARED
needed an adaptation for the latest gcc -- we need to grep stderr as
well as stdout for the magic string BFD.  (Does anybody know what BFD
means?)
2000-02-03 13:42:50 +00:00
Guido van Rossum 43265beff9 # module filecmp
# combo of old cmp, cmpcache and dircmp with redundancies removed
#
# bugs fixed:
#   dircmp.dircmp was not ignoring IGNORES
#   old stuff could falsely report files as "identical" when contents actually differed
#
# enhancements:
#   dircmp has a more straightforward interface
#cmp enhanced by Moshe Zadca
#dircmp enhanced byGordon McMillan

[some layout changes by GvR]
2000-02-03 00:41:22 +00:00
Guido van Rossum 75a7959335 In _fileobject, optimize read() a bit (it could be really slow), and
remove "import string" -- use string methods instead!
2000-02-02 16:57:32 +00:00
Guido van Rossum 823e91c767 Optimize abspath() slightly for the case that win32api can't be
imported; in that case, abspath is replaced by a fallback version.
2000-02-02 16:54:39 +00:00