Commit Graph

31 Commits

Author SHA1 Message Date
Guido van Rossum 7e48898d86 Use the t# format where appropriate. Greg Stein. 1998-10-08 02:25:24 +00:00
Guido van Rossum 0cb96de269 Apply two changes, systematically:
(1) Use PyErr_NewException("module.class", NULL, NULL) to create the
    exception object.

(2) Remove all calls to Py_FatalError(); instead, return or
    ignore the errors -- the import code now checks PyErr_Occurred()
    after calling a module's init function, so it's no longer a
    fatal error for the initialization to fail.

Also did some small cleanups, e.g. removed unnecessary test for
"already initialized" from initfpectl(), and unified
initposix()/initnt().

I haven't checked this very thoroughly, so while the changes are
pretty trivial -- beware of untested code!
1997-10-01 04:29:29 +00:00
Guido van Rossum d19c04a88e Change [_Py_]re_compile_pattern() to return a char*.
Since it only returns an error message (or NULL) there's no reason
for it to be unsigned char *, and various compilers like this better.
1997-09-03 00:47:36 +00:00
Guido van Rossum ed2554a396 Casts by Jack to shut up the Mac compiler. 1997-08-18 15:31:24 +00:00
Guido van Rossum 0318bd6ae6 Use _Py_re_match/search instead of re_match/search; these may become
different in a future version.
1997-08-14 14:35:12 +00:00
Guido van Rossum 95e8053a9f 1.5a3 prerelease 1 from AMK 1997-08-13 22:34:14 +00:00
Guido van Rossum 4a807f5939 Fix big ineficciency in regobj.search/match (introduced by Barry in an
otherwise laudible attempt to rationalize the argument parsing): it
would save a copy of the original string instead of a reference to it.
Go back to saving a reference, but keep the "s#" format (using a hack
that involves two argument parsing steps, first using "O", then using
"s#").
1997-05-12 16:04:09 +00:00
Barry Warsaw 909d7c3284 regex_get_syntax(): New module function exported to Python. 1997-02-18 18:48:50 +00:00
Barry Warsaw 4bc9d39560 Nailed a couple of memory leaks, caught by Purify. 1997-01-09 22:22:05 +00:00
Barry Warsaw c357325663 Several changes. Test program to follow.
- Where optional arguments were being used, converted to
  PyArg_ParseTuple() style instead of nested PyArg_Parse() style.

- Check for and handle many potential error conditions that were never
  being tested.

- internal reg_* functions renamed to regobj_* (makes it easier to
  figure out which are global regex functions and which are for regex
  objects).

- reg_group (now regobj_group) was quite extensively reworked.  it no
  longer recurses to do its job (by factoring core functionality into
  a separate function that knows about string and integer indexes).

- some minor formatting fixes.

- regex_set_syntax() now invalidates the cache.  Without this change
  (in the example below), the second search would produce different
  output depending on whether the first search were performed or not
  (since performing the first search would cache the compiled object
  with RE_SYNTAX_EMACS, causing the second test to unexpectedly fail).

  regex.search('(a+)|(b+)', 'cdb')
  prev = regex.set_syntax(RE_SYNTAX_AWK)
  regex.search('(a+)|(b+)', 'cdb')
1996-12-20 21:56:07 +00:00
Guido van Rossum a376cc5cc8 Keep gcc -Wall happy. 1996-12-05 23:43:35 +00:00
Guido van Rossum d266eb460e New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
Guido van Rossum 0cbaff440d Fix case where you start a new group immediately after a label.
Thanks to Ka-Ping Yee.
1996-10-23 17:53:06 +00:00
Guido van Rossum c196202e3d Speedup of makeresult() by keeping a filler of (-1, -1) around. 1996-10-08 14:18:42 +00:00
Guido van Rossum 8f3032da10 Declare initregex() as returning void, as it should be. 1996-08-19 22:03:12 +00:00
Guido van Rossum dfe8ad969c Converted to new style names by Skip Montanaro 1996-07-24 00:51:20 +00:00
Guido van Rossum ab28c56fd3 Avoid core dump on symcomp(""). 1996-06-11 18:33:14 +00:00
Guido van Rossum 295d171650 explicitly init flags in methodlists 1995-02-19 15:55:19 +00:00
Guido van Rossum 7f7f274839 use Py_CHARMASK 1995-02-10 17:01:56 +00:00
Guido van Rossum 1253960407 mem leak 1995-01-26 00:37:01 +00:00
Guido van Rossum 524b588553 Added 1995 to copyright message.
Setup.in: clarified Tk comments somewhat.
structmodule.c: use memcpy() instead of double precision assignment.
1995-01-04 19:10:35 +00:00
Guido van Rossum b6775db241 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
Guido van Rossum ccd5bad471 Extensive changes to regex module (group(), casefold, etc.) 1993-02-23 13:42:39 +00:00
Guido van Rossum 36d330bf36 * regexmodule.c: added use of translation table, substring() method. 1993-02-21 20:12:16 +00:00
Guido van Rossum 3d1e146086 Improve check for offset out of range 1992-09-03 20:35:01 +00:00
Guido van Rossum 4f1691d0d5 Remove redundant vars 1992-03-27 17:26:25 +00:00
Guido van Rossum d577c0ca90 Fix range error (doc and impl of re_search disagreed!)
Use getargs() function.
Drop re_string from re object.
1992-01-27 16:46:19 +00:00
Guido van Rossum 2d78590183 Make "range" one smaller (discrepancy between doc and source for regex.c!). 1992-01-26 18:12:41 +00:00
Guido van Rossum 1cab95c14d Use Tatu Ylonen's copyleft-free reimplementation of
GNU regular expressions
1992-01-19 16:31:57 +00:00
Guido van Rossum b824fc6773 'regs' is a read-only data member, not a function. 1992-01-01 14:52:16 +00:00
Guido van Rossum 6f4c43d4fd Initial revision 1991-12-30 01:42:57 +00:00