Mercurial > emacs
view etc/DISTRIB @ 28062:26edef632c89
This is a big redesign of failure-stack and register handling, prompted
by bugs revealed when trying to add shy-groups. Overall, what happened
is that loops are now structured a little differently, groups can be
shy and the code is a little simpler.
(enum re_opcode_t): Remove jump_past_alt, maybe_pop_jump,
push_dummy_failure and dumy_failure_jump.
Add on_failure_jump_(exclusive, loop and smart).
Also fix the comment for (start|stop)_memory since they now only take
one argument (the second has becomes unnecessary).
(print_partial_compiled_pattern): Adjust for changes in re_opcode_t.
(print_compiled_pattern): Use %ld to printf long ints and flush to make
debugging a little easier.
(union fail_stack_elt): Make the integer unsigned.
(struct fail_stack_type): Add a `frame' element.
(INIT_FAIL_STACK): Init `frame' as well.
(POP_PATTERN_OP): New macro for re_compile_fastmap.
(DEBUG_PUSH, DEBUG_POP): Remove.
(NUM_REG_ITEMS): Remove.
(NUM_NONREG_ITEMS): Adjust.
(FAILURE_PAT, FAILURE_STR, NEXT_FAILURE_HANDLE, TOP_FAILURE_HANDLE):
New macros for the cycle detection.
(ENSURE_FAIL_STACK): New macro for PUSH_FAILURE_(REG|POINT).
(PUSH_FAILURE_REG, POP_FAILURE_REG, CHECK_INFINITE_LOOP): New macros.
(PUSH_FAILURE_POINT): Don't push registers any more.
The pattern address pushed is not the destination of the jump
but the source of it instead.
(NUM_FAILURE_ITEMS): Remove.
(POP_FAILURE_POINT): Adapt to the new stack structure (i.e. pop
registers before the actual failure point).
Don't hardcode any meaning for str==NULL anymore.
(union register_info_type, REG_MATCH_NULL_STRING_P, IS_ACTIVE)
(MATCHED_SOMETHING, EVER_MATCHED_SOMETHING, SET_REGS_MATCHED): Remove.
(REG_UNSET_VALUE): Use NULL (why not?).
(compile_range): Remove declaration since it doesn't exist.
(struct compile_stack_elt_t): Remove inner_group_offset.
(old_reg(start|end), reg_info, reg_dummy, reg_info_dummy): Remove.
(regex_grow_registers): Remove dead code.
(FIXUP_ALT_JUMP): New macro.
(regex_compile): Add shy-groups
Change loops to use on_failure_jump_smart&jump instead of
on_failure_jump&maybe_pop_jump.
Change + loops to eliminate the initial (dummy_failure_)jump.
Remove c1_base (looks like unused variable to me).
Use `jump' instead of `jump_past_alt' and don't bother with
push_dummy_failure in alternatives since it is now unnecessary.
Use FIXUP_ALT_JUMP.
Eliminate a useless `#ifdef emacs' for (re)allocating the stack.
(re_compile_fastmap): Remove dead variables i and num_regs.
Exit from loop when bufp->can_be_null rather than jumping to `done'.
Avoid jumping backwards so as to ensure termination.
Use PATTERN_STACK_EMPTY and POP_PATTERN_OP.
Improved handling of backreferences.
Remove dead code in handling of `anychar'.
(skip_noops, mutually_exclusive_p): New functions taken from the
handling of `maybe_pop_jump' in re_match_2_internal.
Slightly improve mutually_exclusive_p to handle ".+\n".
((lowest|highest)_active_reg, NO_(LOWEST|HIGHEST)_ACTIVE_REG)
Remove.
(re_match_2_internal): Use %p instead of 0x%x when printf'ing ptrs.
Don't SET_REGS_MATCHED anymore. Remove many dead variables.
Push register (in `start_memory') on the stack rather than storing it
in old_reg(start|end).
Remove the cycle detection from `stop_memory', replaced by the use
of on_failure_jump_loop for greedy loops.
Add code for the new on_failure_jump_<foo>.
Remove ad-hoc code in `on_failure_jump' to push more registers
in the case of a loop.
Take out code from `maybe_pop_jump' into separate functions and
adapt it to the semantics of `on_failure_jump_smart'.
Remove jump_past_alt, dummy_failure_jump and push_dummy_failure.
Remove dummy_failure handling and handling of `failures to jump
to on_failure_jump' (this last one was already dead code, it seems).
((group|alt|common_op)_match_null_string_p): Remove.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 08 Mar 2000 23:25:41 +0000 |
parents | 6b5aacec5ace |
children | 1e525e729760 |
line wrap: on
line source
-*- text -*- For an order form for all Emacs and FSF distributions deliverable from the USA, see the file `ORDERS' in this directory (etc/ in the GNU Emacs distribution or /pub/gnu/GNUinfo on ftp.gnu.org). For a European order form, see `ORDERS.EUROPE'. For a Japan order form, see `ORDERS.JAPAN'. GNU Emacs availability information, April 1998 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document provided that the copyright notice and this permission notice are preserved. GNU Emacs is legally owned by the Free Software Foundation, but we regard the foundation more as its custodian on behalf of the public. In the GNU project, when we speak of "free software", this refers to liberty, not price. Specifically, it refers to the users' freedom to study, copy, change and improve the software. Sometimes users pay money for copies of GNU software, and sometimes they get copies at no charge. But regardless of how they got the software, or whether it was modified by anyone else along the way, they have the freedom to copy and change it--those freedoms are what "free software" means. The precise conditions for copying and modification are stated in the document "GNU General Public License," a copy of which is required to be distributed with every copy of GNU Emacs. It is usually in a file named `COPYING' in the same directory as this file. These conditions are designed to make sure that everyone who has a copy of GNU Emacs (including modified versions) has the freedom to redistribute and change it. If you do not know anyone to get a copy of GNU Emacs from, you can order a cd-rom from the Free Software Foundation. We distribute Emacs versions 19 and 20. We also distribute nicely typeset copies of the Emacs user manual, Emacs Lisp Reference Manual, the Emacs reference card, etc. See file `ORDERS'. If you have Internet access, you can copy the latest Emacs distribution from hosts, such as ftp.gnu.org. There are several ways to do this; see the file `FTP' for more information. Even better, get the latest version of the file from `/pub/gnu/GNUinfo/FTP' on ftp.gnu.org for the most current arrangements. It may also be possible to copy Emacs via uucp; the file `FTP' contains information on that too. Emacs has been run on both Berkeley Unix and System V Unix, on a variety of types of cpu. It also works on VMS and on Apollo computers, though with some deficiencies that reflect problems in these operating systems. See the file `MACHINES' in this directory (see above) for a full list of machines that GNU Emacs has been tested on, with machine-specific installation notes and warnings. There is also Demacs that works on newer MS-DOS machines (see file `ORDERS'). Note that there is significant variation between Unix systems supposedly running the same version of Unix; it is possible that what works in GNU Emacs for me does not work on your system due to such an incompatibility. Since I must avoid reading Unix source code, I cannot even guess what such problems may exist. GNU Emacs is distributed with no warranty (see the General Public License for full details, in the file `COPYING' in this directory (see above)), and neither I nor the Free Software Foundation promises any kind of support or assistance to users. The foundation keeps a list of people who are willing to offer support and assistance for hire. See the file `SERVICE'. You can get the latest version from ftp.gnu.org in file `/pub/gnu/GNUinfo/SERVICE'. However, we plan to continue to improve GNU Emacs and keep it reliable, so please send me any complaints and suggestions you have. I will probably fix anything that I consider a malfunction. I may make improvements that are suggested, but I may choose not to. Improving Emacs is not my highest priority now. If you are on the Internet, report bugs to bug-gnu-emacs@gnu.org. Otherwise, phone or write the Foundation at: Free Software Foundation 59 Temple Place - Suite 330 Boston, MA 02111-1307 Voice: +1-617-542-5942 Fax: +1-617-542-2652 General questions about the GNU Project can be asked of gnu@gnu.org. If you are a computer manufacturer, I encourage you to ship a copy of GNU Emacs with every computer you deliver. The same copying permission terms apply to computer manufacturers as to everyone else. You should consider making a donation to help support the GNU project; if you estimate what it would cost to distribute some commercial product and divide it by five, that is a good amount. If you like GNU Emacs, please express your satisfaction with a donation: send me or the Foundation what you feel Emacs has been worth to you. If you are glad that I developed GNU Emacs and distribute it as freeware, rather than following the obstructive and antisocial practices typical of software developers, reward me. If you would like the Foundation to develop more free software, contribute. Your donations will help to support the development of additional GNU software. GNU/Linux systems (variants of GNU, based on the kernel Linux) have millions of users, but there is still much to be done. For more information on GNU, see the file `GNU' in this directory (see above). Richard M Stallman Chief GNUisance, President of the Free Software Foundation