home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #1 / MONSTER.ISO / prog / gen / regex011.taz / regex011 / regex-0.11 / ChangeLog < prev    next >
Encoding:
Text File  |  1992-09-17  |  130.7 KB  |  2,866 lines

  1. Thu Sep 17 19:47:16 1992  Karl Berry  (karl@geech.gnu.ai.mit.edu)
  2.  
  3.         * Version 0.11.
  4.  
  5. Wed Sep 16 08:17:10 1992  Karl Berry  (karl@hayley)
  6.  
  7.         * regex.c (INIT_FAIL_STACK): rewrite as statements instead of a
  8.           complicated comma expr, to avoid compiler warnings (and also
  9.           simplify).
  10.         (re_compile_fastmap, re_match_2): change callers.
  11.  
  12.         * regex.c (POP_FAILURE_POINT): cast pop of regstart and regend
  13.           to avoid compiler warnings.
  14.  
  15.         * regex.h (RE_NEWLINE_ORDINARY): remove this syntax bit, and
  16.           remove uses.
  17.         * regex.c (at_{beg,end}line_loc_p): go the last mile: remove
  18.           the RE_NEWLINE_ORDINARY case which made the ^ in \n^ be an anchor.
  19.  
  20. Tue Sep 15 09:55:29 1992  Karl Berry  (karl@hayley)
  21.  
  22.         * regex.c (at_begline_loc_p): new fn.
  23.         (at_endline_loc_p): simplify at_endline_op_p.
  24.         (regex_compile): in ^/$ cases, call the above.
  25.  
  26.         * regex.c (POP_FAILURE_POINT): rewrite the fn as a macro again,
  27.           as lord's profiling indicates the function is 20% of the time.
  28.         (re_match_2): callers changed.
  29.  
  30.         * configure.in (AC_MEMORY_H): remove, since we never use memcpy et al.
  31.  
  32. Mon Sep 14 17:49:27 1992  Karl Berry  (karl@hayley)
  33.  
  34.         * Makefile.in (makeargs): include MFLAGS.
  35.  
  36. Sun Sep 13 07:41:45 1992  Karl Berry  (karl@hayley)
  37.  
  38.         * regex.c (regex_compile): in \1..\9 case, make it always
  39.           invalid to use \<digit> if there is no preceding <digit>th subexpr.
  40.         * regex.h (RE_NO_MISSING_BK_REF): remove this syntax bit.
  41.  
  42.         * regex.c (regex_compile): remove support for invalid empty groups.
  43.         * regex.h (RE_NO_EMPTY_GROUPS): remove this syntax bit.
  44.  
  45.         * regex.c (FREE_VARIABLES) [!REGEX_MALLOC]: define as alloca (0), 
  46.           to reclaim memory.
  47.  
  48.         * regex.h (RE_SYNTAX_POSIX_SED): don't bother with this.
  49.  
  50. Sat Sep 12 13:37:21 1992  Karl Berry  (karl@hayley)
  51.  
  52.         * README: incorporate emacs.diff.
  53.  
  54.         * regex.h (_RE_ARGS) [!__STDC__]: define as empty parens.
  55.  
  56.         * configure.in: add AC_ALLOCA.
  57.  
  58.         * Put test files in subdir test, documentation in subdir doc.
  59.         Adjust Makefile.in and configure.in accordingly.
  60.  
  61. Thu Sep 10 10:29:11 1992  Karl Berry  (karl@hayley)
  62.  
  63.         * regex.h (RE_SYNTAX_{POSIX_,}SED): new definitions.
  64.  
  65. Wed Sep  9 06:27:09 1992  Karl Berry  (karl@hayley)
  66.  
  67.         * Version 0.10.
  68.  
  69. Tue Sep  8 07:32:30 1992  Karl Berry  (karl@hayley)
  70.  
  71.         * xregex.texinfo: put the day of month into the date.
  72.  
  73.         * Makefile.in (realclean): remove Texinfo-generated files.
  74.         (distclean): remove empty sorted index files.
  75.         (clean): remove dvi files, etc.
  76.  
  77.         * configure.in: test for more Unix variants.
  78.  
  79.         * fileregex.c: new file.
  80.         Makefile.in (fileregex): new target.
  81.  
  82.         * iregex.c (main): move variable decls to smallest scope.
  83.  
  84.         * regex.c (FREE_VARIABLES): free reg_{,info_}dummy.
  85.         (re_match_2): check that the allocation for those two succeeded.
  86.  
  87.         * regex.c (FREE_VAR): replace FREE_NONNULL with this.
  88.         (FREE_VARIABLES): call it.
  89.         (re_match_2) [REGEX_MALLOC]: initialize all our vars to NULL.
  90.  
  91.         * tregress.c (do_match): generalize simple_match.
  92.         (SIMPLE_NONMATCH): new macro.
  93.         (SIMPLE_MATCH): change from routine.
  94.  
  95.         * Makefile.in (regex.texinfo): make file readonly, so we don't
  96.           edit it by mistake.
  97.  
  98.         * many files (re_default_syntax): rename to `re_syntax_options';
  99.           call re_set_syntax instead of assigning to the variable where
  100.           possible.
  101.  
  102. Mon Sep  7 10:12:16 1992  Karl Berry  (karl@hayley)
  103.  
  104.         * syntax.skel: don't use prototypes.
  105.  
  106.         * {configure,Makefile}.in: new files.
  107.  
  108.         * regex.c: include <string.h> `#if USG || STDC_HEADERS'; remove
  109.           obsolete test for `POSIX', and test for BSRTING.
  110.         Include <strings.h> if we are not USG or STDC_HEADERS.
  111.         Do not include <unistd.h>.  What did we ever need that for?
  112.  
  113.         * regex.h (RE_NO_EMPTY_ALTS): remove this.
  114.         (RE_SYNTAX_AWK): remove from here, too.
  115.         * regex.c (regex_compile): remove the check.
  116.         * xregex.texinfo (Alternation Operator): update.
  117.         * other.c (test_others): remove tests for this.
  118.  
  119.         * regex.h (RE_DUP_MAX): undefine if already defined.
  120.  
  121.         * regex.h: (RE_SYNTAX_POSIX*): redo to allow more operators, and
  122.           define new syntaxes with the minimal set.
  123.  
  124.         * syntax.skel (main): used sscanf instead of scanf.
  125.  
  126.         * regex.h (RE_SYNTAX_*GREP): new definitions from mike.
  127.  
  128.         * regex.c (regex_compile): initialize the upper bound of
  129.           intervals at the beginning of the interval, not the end.
  130.           (From pclink@qld.tne.oz.au.)
  131.  
  132.         * regex.c (handle_bar): rename to `handle_alt', for consistency.
  133.  
  134.         * regex.c ({store,insert}_{op1,op2}): new routines (except the last).
  135.         ({STORE,INSERT}_JUMP{,2}): macros to replace the old routines,
  136.          which took arguments in different orders, and were generally weird.
  137.  
  138.         * regex.c (PAT_PUSH*): rename to `BUF_PUSH*' -- we're not
  139.           appending info to the pattern!
  140.  
  141. Sun Sep  6 11:26:49 1992  Karl Berry  (karl@hayley)
  142.  
  143.         * regex.c (regex_compile): delete the variable
  144.           `following_left_brace', since we never use it.
  145.  
  146.         * regex.c (print_compiled_pattern): don't print the fastmap if
  147.           it's null.
  148.  
  149.         * regex.c (re_compile_fastmap): handle
  150.           `on_failure_keep_string_jump' like `on_failure_jump'.
  151.  
  152.         * regex.c (re_match_2): in `charset{,_not' case, cast the bit
  153.           count to unsigned, not unsigned char, in case we have a full
  154.           32-byte bit list.
  155.  
  156.         * tregress.c (simple_match): remove.
  157.         (simple_test): rename as `simple_match'.
  158.         (simple_compile): print the error string if the compile failed.
  159.  
  160.         * regex.c (DO_RANGE): rewrite as a function, `compile_range', so
  161.           we can debug it.  Change pattern characters to unsigned char
  162.           *'s, and change the range variable to an unsigned.
  163.         (regex_compile): change calls.
  164.  
  165. Sat Sep  5 17:40:49 1992  Karl Berry  (karl@hayley)
  166.  
  167.         * regex.h (_RE_ARGS): new macro to put in argument lists (if
  168.           ANSI) or omit them (if K&R); don't declare routines twice.
  169.  
  170.         * many files (obscure_syntax): rename to `re_default_syntax'.
  171.  
  172. Fri Sep  4 09:06:53 1992  Karl Berry  (karl@hayley)
  173.  
  174.         * GNUmakefile (extraclean): new target.
  175.         (realclean): delete the info files.
  176.  
  177. Wed Sep  2 08:14:42 1992  Karl Berry  (karl@hayley)
  178.  
  179.         * regex.h: doc fix.
  180.  
  181. Sun Aug 23 06:53:15 1992  Karl Berry  (karl@hayley)
  182.  
  183.         * regex.[ch] (re_comp): no const in the return type (from djm).
  184.  
  185. Fri Aug 14 07:25:46 1992  Karl Berry  (karl@hayley)
  186.  
  187.         * regex.c (DO_RANGE): declare variables as unsigned chars, not
  188.           signed chars (from jimb).
  189.  
  190. Wed Jul 29 18:33:53 1992  Karl Berry  (karl@claude.cs.umb.edu)
  191.  
  192.         * Version 0.9.
  193.  
  194.         * GNUmakefile (distclean): do not remove regex.texinfo.
  195.         (realclean): remove it here.
  196.  
  197.         * tregress.c (simple_test): initialize buf.buffer.
  198.  
  199. Sun Jul 26 08:59:38 1992  Karl Berry  (karl@hayley)
  200.  
  201.         * regex.c (push_dummy_failure): new opcode and corresponding
  202.           case in the various routines.  Pushed at the end of
  203.           alternatives.
  204.  
  205.         * regex.c (jump_past_next_alt): rename to `jump_past_alt', for
  206.           brevity.
  207.         (no_pop_jump): rename to `jump'.
  208.  
  209.         * regex.c (regex_compile) [DEBUG]: terminate printing of pattern
  210.           with a newline.
  211.  
  212.         * NEWS: new file.
  213.  
  214.         * tregress.c (simple_{compile,match,test}): routines to simplify all
  215.           these little tests.
  216.  
  217.         * tregress.c: test for matching as much as possible.
  218.  
  219. Fri Jul 10 06:53:32 1992  Karl Berry  (karl@hayley)
  220.  
  221.         * Version 0.8.
  222.  
  223. Wed Jul  8 06:39:31 1992  Karl Berry  (karl@hayley)
  224.  
  225.         * regex.c (SIGN_EXTEND_CHAR): #undef any previous definition, as
  226.           ours should always work properly.
  227.  
  228. Mon Jul  6 07:10:50 1992  Karl Berry  (karl@hayley)
  229.  
  230.         * iregex.c (main) [DEBUG]: conditionalize the call to
  231.           print_compiled_pattern.
  232.  
  233.         * iregex.c (main): initialize buf.buffer to NULL.
  234.         * tregress (test_regress): likewise.
  235.  
  236.         * regex.c (alloca) [sparc]: #if on HAVE_ALLOCA_H instead.
  237.  
  238.         * tregress.c (test_regress): didn't have jla's test quite right.
  239.  
  240. Sat Jul  4 09:02:12 1992  Karl Berry  (karl@hayley)
  241.  
  242.         * regex.c (re_match_2): only REGEX_ALLOCATE all the register
  243.           vectors if the pattern actually has registers.
  244.         (match_end): new variable to avoid having to use best_regend[0].
  245.  
  246.         * regex.c (IS_IN_FIRST_STRING): rename to FIRST_STRING_P.
  247.  
  248.         * regex.c: doc fixes.
  249.  
  250.         * tregess.c (test_regress): new fastmap test forwarded by rms.
  251.  
  252.         * tregress.c (test_regress): initialize the fastmap field.
  253.  
  254.         * tregress.c (test_regress): new test from jla that aborted
  255.           in re_search_2.
  256.  
  257. Fri Jul  3 09:10:05 1992  Karl Berry  (karl@hayley)
  258.  
  259.         * tregress.c (test_regress): add tests for translating charsets,
  260.           from kaoru.
  261.  
  262.         * GNUmakefile (common): add alloca.o.
  263.         * alloca.c: new file, copied from bison.
  264.  
  265.         * other.c (test_others): remove var `buf', since it's no longer used.
  266.  
  267.     * Below changes from ro@TechFak.Uni-Bielefeld.DE.
  268.  
  269.         * tregress.c (test_regress): initialize buf.allocated.
  270.  
  271.         * regex.c (re_compile_fastmap): initialize `succeed_n_p'.
  272.  
  273.         * GNUmakefile (regex): depend on $(common).
  274.  
  275. Wed Jul  1 07:12:46 1992  Karl Berry  (karl@hayley)
  276.  
  277.         * Version 0.7.
  278.  
  279.         * regex.c: doc fixes.
  280.  
  281. Mon Jun 29 08:09:47 1992  Karl Berry  (karl@fosse)
  282.  
  283.         * regex.c (pop_failure_point): change string vars to
  284.     `const char *' from `unsigned char *'.
  285.  
  286.         * regex.c: consolidate debugging stuff.
  287.         (print_partial_compiled_pattern): avoid enum clash.
  288.  
  289. Mon Jun 29 07:50:27 1992  Karl Berry  (karl@hayley)
  290.  
  291.         * xmalloc.c: new file.
  292.         * GNUmakefile (common): add it.
  293.  
  294.         * iregex.c (print_regs): new routine (from jimb).
  295.         (main): call it.
  296.  
  297. Sat Jun 27 10:50:59 1992  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
  298.  
  299.     * xregex.c (re_match_2): When we have accepted a match and 
  300.     restored d from best_regend[0], we need to set dend
  301.     appropriately as well.
  302.  
  303. Sun Jun 28 08:48:41 1992  Karl Berry  (karl@hayley)
  304.  
  305.         * tregress.c: rename from regress.c.
  306.  
  307.         * regex.c (print_compiled_pattern): improve charset case to ease
  308.             byte-counting.
  309.           Also, don't distinguish between Emacs and non-Emacs
  310.            {not,}wordchar opcodes.
  311.  
  312.         * regex.c (print_fastmap): move here.
  313.         * test.c: from here.
  314.         * regex.c (print_{{partial,}compiled_pattern,double_string}):
  315.           rename from ..._printer.  Change calls here and in test.c.
  316.  
  317.         * regex.c: create from xregex.c and regexinc.c for once and for
  318.           all, and change the debug fns to be extern, instead of static.
  319.         * GNUmakefile: remove traces of xregex.c.
  320.         * test.c: put in externs, instead of including regexinc.c.
  321.  
  322.         * xregex.c: move interactive main program and scanstring to iregex.c.
  323.         * iregex.c: new file.
  324.         * upcase.c, printchar.c: new files.
  325.  
  326.         * various doc fixes and other cosmetic changes throughout.
  327.  
  328.         * regexinc.c (compiled_pattern_printer): change variable name,
  329.           for consistency.
  330.         (partial_compiled_pattern_printer): print other info about the
  331.           compiled pattern, besides just the opcodes.
  332.         * xregex.c (regex_compile) [DEBUG]: print the compiled pattern
  333.           when we're done.
  334.  
  335.         * xregex.c (re_compile_fastmap): in the duplicate case, set
  336.             `can_be_null' and return.
  337.           Also, set `bufp->can_be_null' according to a new variable,
  338.             `path_can_be_null'.
  339.           Also, rewrite main while loop to not test `p != NULL', since
  340.             we never set it that way.
  341.           Also, eliminate special `can_be_null' value for the endline case.
  342.         (re_search_2): don't test for the special value.
  343.        * regex.h (struct re_pattern_buffer): remove the definition.
  344.  
  345. Sat Jun 27 15:00:40 1992  Karl Berry  (karl@hayley)
  346.  
  347.         * xregex.c (re_compile_fastmap): remove the `RE_' from
  348.             `REG_RE_MATCH_NULL_AT_END'.
  349.           Also, assert the fastmap in the pattern buffer is non-null.
  350.           Also, reset `succeed_n_p' after we've
  351.             paid attention to it, instead of every time through the loop.
  352.           Also, in the `anychar' case, only clear fastmap['\n'] if the
  353.            syntax says to, and don't return prematurely.
  354.           Also, rearrange cases in some semblance of a rational order.
  355.         * regex.h (REG_RE_MATCH_NULL_AT_END): remove the `RE_' from the name.
  356.  
  357.         * other.c: take bug reports from here.
  358.         * regress.c: new file for them.
  359.         * GNUmakefile (test): add it.
  360.         * main.c (main): new possible test.
  361.         * test.h (test_type): new value in enum.
  362.  
  363. Thu Jun 25 17:37:43 1992  Karl Berry  (karl@hayley)
  364.  
  365.         * xregex.c (scanstring) [test]: new function from jimb to allow some
  366.           escapes.
  367.         (main) [test]: call it (on the string, not the pattern).
  368.  
  369.         * xregex.c (main): make return type `int'.
  370.  
  371. Wed Jun 24 10:43:03 1992  Karl Berry  (karl@hayley)
  372.  
  373.         * xregex.c (pattern_offset_t): change to `int', for the benefit
  374.           of patterns which compile to more than 2^15 bytes.
  375.  
  376.         * xregex.c (GET_BUFFER_SPACE): remove spurious braces.
  377.  
  378.         * xregex.texinfo (Using Registers): put in a stub to ``document''
  379.           the new function.
  380.         * regex.h (re_set_registers) [!__STDC__]: declare.
  381.         * xregex.c (re_set_registers): declare K&R style (also move to a
  382.           different place in the file).
  383.  
  384. Mon Jun  8 18:03:28 1992  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
  385.  
  386.     * regex.h (RE_NREGS): Doc fix.
  387.  
  388.     * xregex.c (re_set_registers): New function.
  389.     * regex.h (re_set_registers): Declaration for new function.
  390.  
  391. Fri Jun  5 06:55:18 1992  Karl Berry  (karl@hayley)
  392.  
  393.         * main.c (main): `return 0' instead of `exit (0)'.  (From Paul Eggert)
  394.  
  395.         * regexinc.c (SIGN_EXTEND_CHAR): cast to unsigned char.
  396.         (extract_number, EXTRACT_NUMBER): don't bother to cast here.
  397.  
  398. Tue Jun  2 07:37:53 1992  Karl Berry  (karl@hayley)
  399.  
  400.         * Version 0.6.
  401.  
  402.         * Change copyrights to `1985, 89, ...'.
  403.  
  404.         * regex.h (REG_RE_MATCH_NULL_AT_END): new macro.
  405.         * xregex.c (re_compile_fastmap): initialize `can_be_null' to
  406.           `p==pend', instead of in the test at the top of the loop (as
  407.           it was, it was always being set).
  408.           Also, set `can_be_null'=1 if we would jump to the end of the
  409.             pattern in the `on_failure_jump' cases.
  410.         (re_search_2): check if `can_be_null' is 1, not nonzero.  This
  411.           was the original test in rms' regex; why did we change this?
  412.  
  413.         * xregex.c (re_compile_fastmap): rename `is_a_succeed_n' to
  414.           `succeed_n_p'.
  415.  
  416. Sat May 30 08:09:08 1992  Karl Berry  (karl@hayley)
  417.  
  418.         * xregex.c (re_compile_pattern): declare `regnum' as `unsigned',
  419.           not `regnum_t', for the benefit of those patterns with more
  420.           than 255 groups.
  421.  
  422.         * xregex.c: rename `failure_stack' to `fail_stack', for brevity;
  423.           likewise for `match_nothing' to `match_null'.
  424.  
  425.         * regexinc.c (REGEX_REALLOCATE): take both the new and old
  426.           sizes, and copy only the old bytes.
  427.         * xregex.c (DOUBLE_FAILURE_STACK): pass both old and new.
  428.         * This change from Thorsten Ohl.
  429.  
  430. Fri May 29 11:45:22 1992  Karl Berry  (karl@hayley)
  431.  
  432.         * regexinc.c (SIGN_EXTEND_CHAR): define as `(signed char) c'
  433.           instead of relying on __CHAR_UNSIGNED__, to work with
  434.           compilers other than GCC.  From Per Bothner.
  435.  
  436.         * main.c (main): change return type to `int'.
  437.  
  438. Mon May 18 06:37:08 1992  Karl Berry  (karl@hayley)
  439.  
  440.         * regex.h (RE_SYNTAX_AWK): typo in RE_RE_UNMATCHED...
  441.  
  442. Fri May 15 10:44:46 1992  Karl Berry  (karl@hayley)
  443.  
  444.         * Version 0.5.
  445.  
  446. Sun May  3 13:54:00 1992  Karl Berry  (karl@hayley)
  447.  
  448.         * regex.h (struct re_pattern_buffer): now it's just `regs_allocated'.
  449.         (REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED): new constants.
  450.         * xregex.c (regexec, re_compile_pattern): set the field appropriately.
  451.         (re_match_2): and use it.  bufp can't be const any more.
  452.  
  453. Fri May  1 15:43:09 1992  Karl Berry  (karl@hayley)
  454.  
  455.         * regexinc.c: unconditionally include <sys/types.h>, first.
  456.  
  457.         * regex.h (struct re_pattern_buffer): rename
  458.           `caller_allocated_regs' to `regs_allocated_p'.
  459.         * xregex.c (re_compile_pattern): same change here.
  460.         (regexec): and here.
  461.         (re_match_2): reallocate registers if necessary.
  462.  
  463. Fri Apr 10 07:46:50 1992  Karl Berry  (karl@hayley)
  464.  
  465.         * regex.h (RE_SYNTAX{_POSIX,}_AWK): new definitions from Arnold.
  466.  
  467. Sun Mar 15 07:34:30 1992  Karl Berry  (karl at hayley)
  468.  
  469.         * GNUmakefile (dist): versionize regex.{c,h,texinfo}.
  470.  
  471. Tue Mar 10 07:05:38 1992  Karl Berry  (karl at hayley)
  472.  
  473.         * Version 0.4.
  474.  
  475.         * xregex.c (PUSH_FAILURE_POINT): always increment the failure id.
  476.         (DEBUG_STATEMENT) [DEBUG]: execute the statement even if `debug'==0.
  477.  
  478.         * xregex.c (pop_failure_point): if the saved string location is
  479.           null, keep the current value.
  480.         (re_match_2): at fail, test for a dummy failure point by
  481.           checking the restored pattern value, not string value.
  482.         (re_match_2): new case, `on_failure_keep_string_jump'.
  483.         (regex_compile): output this opcode in the .*\n case.
  484.         * regexinc.c (re_opcode_t): define the opcode.
  485.         (partial_compiled_pattern_pattern): add the new case.
  486.  
  487. Mon Mar  9 09:09:27 1992  Karl Berry  (karl at hayley)
  488.  
  489.         * xregex.c (regex_compile): optimize .*\n to output an
  490.           unconditional jump to the ., instead of pushing failure points
  491.           each time through the loop.
  492.  
  493.         * xregex.c (DOUBLE_FAILURE_STACK): compute the maximum size
  494.           ourselves (and correctly); change callers.
  495.  
  496. Sun Mar  8 17:07:46 1992  Karl Berry  (karl at hayley)
  497.  
  498.         * xregex.c (failure_stack_elt_t): change to `const char *', to
  499.           avoid warnings.
  500.  
  501.         * regex.h (re_set_syntax): declare this.
  502.  
  503.         * xregex.c (pop_failure_point) [DEBUG]: conditionally pass the
  504.           original strings and sizes; change callers.
  505.  
  506. Thu Mar  5 16:35:35 1992  Karl Berry  (karl at claude.cs.umb.edu)
  507.  
  508.         * xregex.c (regnum_t): new type for register/group numbers.
  509.         (compile_stack_elt_t, regex_compile): use it.
  510.  
  511.         * xregex.c (regexec): declare len as `int' to match re_search.
  512.  
  513.         * xregex.c (re_match_2): don't declare p1 twice.
  514.  
  515.         * xregex.c: change `while (1)' to `for (;;)' to avoid silly
  516.           compiler warnings.
  517.  
  518.         * regex.h [__STDC__]: use #if, not #ifdef.
  519.  
  520.         * regexinc.c (REGEX_REALLOCATE): cast the result of alloca to
  521.           (char *), to avoid warnings.
  522.  
  523.         * xregex.c (regerror): declare variable as const.
  524.  
  525.         * xregex.c (re_compile_pattern, re_comp): define as returning a const
  526.           char *.
  527.         * regex.h (re_compile_pattern, re_comp): likewise.
  528.  
  529. Thu Mar  5 15:57:56 1992  Karl Berry  (karl@hal)
  530.  
  531.         * xregex.c (regcomp): declare `syntax' as unsigned.
  532.  
  533.         * xregex.c (re_match_2): try to avoid compiler warnings about
  534.           unsigned comparisons.
  535.  
  536.         * GNUmakefile (test-xlc): new target.
  537.  
  538.         * regex.h (reg_errcode_t): remove trailing comma from definition.
  539.         * regexinc.c (re_opcode_t): likewise.
  540.  
  541. Thu Mar  5 06:56:07 1992  Karl Berry  (karl at hayley)
  542.  
  543.         * GNUmakefile (dist): add version numbers automatically.
  544.         (versionfiles): new variable.
  545.         (regex.{c,texinfo}): don't add version numbers here.
  546.         * regex.h: put in placeholder instead of the version number.
  547.  
  548. Fri Feb 28 07:11:33 1992  Karl Berry  (karl at hayley)
  549.  
  550.         * xregex.c (re_error_msg): declare const, since it is.
  551.  
  552. Sun Feb 23 05:41:57 1992  Karl Berry  (karl at fosse)
  553.  
  554.         * xregex.c (PAT_PUSH{,_2,_3}, ...): cast args to avoid warnings.
  555.         (regex_compile, regexec): return REG_NOERROR, instead
  556.           of 0, on success.
  557.         (boolean): define as char, and #define false and true.
  558.         * regexinc.c (STREQ): cast the result.
  559.  
  560. Sun Feb 23 07:45:38 1992  Karl Berry  (karl at hayley)
  561.  
  562.         * GNUmakefile (test-cc, test-hc, test-pcc): new targets.
  563.  
  564.         * regex.inc (extract_number, extract_number_and_incr) [DEBUG]:
  565.           only define if we are debugging.
  566.  
  567.         * xregex.c [_AIX]: do #pragma alloca first if necessary.
  568.         * regexinc.c [_AIX]: remove the #pragma from here.
  569.  
  570.         * regex.h (reg_syntax_t): declare as unsigned, and redo the enum
  571.           as #define's again.  Some compilers do stupid things with enums.
  572.  
  573. Thu Feb 20 07:19:47 1992  Karl Berry  (karl at hayley)
  574.  
  575.         * Version 0.3.
  576.  
  577.         * xregex.c, regex.h (newline_anchor_match_p): rename to
  578.           `newline_anchor'; dumb idea to change the name.
  579.  
  580. Tue Feb 18 07:09:02 1992  Karl Berry  (karl at hayley)
  581.  
  582.         * regexinc.c: go back to original, i.e., don't include
  583.           <string.h> or define strchr.
  584.         * xregex.c (regexec): don't bother with adding characters after
  585.           newlines to the fastmap; instead, just don't use a fastmap.
  586.         * xregex.c (regcomp): set the buffer and fastmap fields to zero.
  587.  
  588.         * xregex.texinfo (GNU r.e. compiling): have to initialize more
  589.           than two fields.
  590.  
  591.         * regex.h (struct re_pattern_buffer): rename `newline_anchor' to
  592.           `newline_anchor_match_p', as we're back to two cases.
  593.         * xregex.c (regcomp, re_compile_pattern, re_comp): change
  594.           accordingly.
  595.         (re_match_2): at begline and endline, POSIX is not a special
  596.           case anymore; just check newline_anchor_match_p.
  597.  
  598. Thu Feb 13 16:29:33 1992  Karl Berry  (karl at hayley)
  599.  
  600.         * xregex.c (*empty_string*): rename to *null_string*, for brevity.
  601.  
  602. Wed Feb 12 06:36:22 1992  Karl Berry  (karl at hayley)
  603.  
  604.         * xregex.c (re_compile_fastmap): at endline, don't set fastmap['\n'].
  605.         (re_match_2): rewrite the begline/endline cases to take account
  606.           of the new field newline_anchor.
  607.  
  608. Tue Feb 11 14:34:55 1992  Karl Berry  (karl at hayley)
  609.  
  610.         * regexinc.c [!USG etc.]: include <strings.h> and define strchr
  611.           as index.
  612.  
  613.         * xregex.c (re_search_2): when searching backwards, declare `c'
  614.           as a char and use casts when using it as an array subscript.
  615.  
  616.         * xregex.c (regcomp): if REG_NEWLINE, set
  617.           RE_HAT_LISTS_NOT_NEWLINE.  Set the `newline_anchor' field
  618.           appropriately.
  619.         (regex_compile): compile [^...] as matching a \n according to
  620.           the syntax bit.
  621.         (regexec): if doing REG_NEWLINE stuff, compile a fastmap and add
  622.           characters after any \n's to the newline.
  623.         * regex.h (RE_HAT_LISTS_NOT_NEWLINE): new syntax bit.
  624.         (struct re_pattern_buffer): rename `posix_newline' to
  625.           `newline_anchor', define constants for its values.
  626.  
  627. Mon Feb 10 07:22:50 1992  Karl Berry  (karl at hayley)
  628.  
  629.         * xregex.c (re_compile_fastmap): combine the code at the top and
  630.           bottom of the loop, as it's essentially identical.
  631.  
  632. Sun Feb  9 10:02:19 1992  Karl Berry  (karl at hayley)
  633.  
  634.         * xregex.texinfo (POSIX Translate Tables): remove this, as it
  635.           doesn't match the spec.
  636.  
  637.         * xregex.c (re_compile_fastmap): if we finish off a path, go
  638.           back to the top (to set can_be_null) instead of returning
  639.           immediately.
  640.  
  641.         * xregex.texinfo: changes from bob.
  642.  
  643. Sat Feb  1 07:03:25 1992  Karl Berry  (karl at hayley)
  644.  
  645.         * xregex.c (re_search_2): doc fix (from rms).
  646.  
  647. Fri Jan 31 09:52:04 1992  Karl Berry  (karl at hayley)
  648.  
  649.         * xregex.texinfo (GNU Searching): clarify the range arg.
  650.  
  651.         * xregex.c (re_match_2, at_endline_op_p): add extra parens to
  652.           get rid of GCC 2's (silly, IMHO) warning about && within ||.
  653.  
  654.         * xregex.c (common_op_match_empty_string_p): use
  655.           MATCH_NOTHING_UNSET_VALUE, not -1.
  656.  
  657. Thu Jan 16 08:43:02 1992  Karl Berry  (karl at hayley)
  658.  
  659.         * xregex.c (SET_REGS_MATCHED): only set the registers from
  660.           lowest to highest.
  661.  
  662.         * regexinc.c (MIN): new macro.
  663.         * xregex.c (re_match_2): only check min (num_regs,
  664.           regs->num_regs) when we set the returned regs.
  665.  
  666.         * xregex.c (re_match_2): set registers after the first
  667.           num_regs to -1 before we return.
  668.  
  669. Tue Jan 14 16:01:42 1992  Karl Berry  (karl at hayley)
  670.  
  671.         * xregex.c (re_match_2): initialize max (RE_NREGS, re_nsub + 1)
  672.           registers (from rms).
  673.  
  674.         * xregex.c, regex.h: don't abbreviate `19xx' to `xx'.
  675.  
  676.         * regexinc.c [!emacs]: include <sys/types.h> before <unistd.h>.
  677.           (from ro@thp.Uni-Koeln.DE).
  678.  
  679. Thu Jan  9 07:23:00 1992  Karl Berry  (karl at hayley)
  680.  
  681.         * xregex.c (*unmatchable): rename to `match_empty_string_p'.
  682.         (CAN_MATCH_NOTHING): rename to `REG_MATCH_EMPTY_STRING_P'.
  683.  
  684.         * regexinc.c (malloc, realloc): remove prototypes, as they can
  685.           cause clashes (from rms).
  686.  
  687. Mon Jan  6 12:43:24 1992  Karl Berry  (karl at claude.cs.umb.edu)
  688.  
  689.         * Version 0.2.
  690.  
  691. Sun Jan  5 10:50:38 1992  Karl Berry  (karl at hayley)
  692.  
  693.         * xregex.texinfo: bring more or less up-to-date.
  694.         * GNUmakefile (regex.texinfo): generate from regex.h and
  695.           xregex.texinfo.
  696.         * include.awk: new file.
  697.  
  698.         * xregex.c: change all calls to the fn extract_number_and_incr
  699.           to the macro.
  700.  
  701.         * xregex.c (re_match_2) [emacs]: in at_dot, use PTR_CHAR_POS + 1,
  702.           instead of bf_* and sl_*.  Cast d to unsigned char *, to match
  703.           the declaration in Emacs' buffer.h.
  704.         [emacs19]: in before_dot, at_dot, and after_dot, likewise.
  705.  
  706.         * regexinc.c: unconditionally include <sys/types.h>.
  707.  
  708.         * regexinc.c (alloca) [!alloca]: Emacs config files sometimes
  709.           define this, so don't define it if it's already defined.
  710.  
  711. Sun Jan  5 06:06:53 1992  Karl Berry  (karl at fosse)
  712.  
  713.         * xregex.c (re_comp): fix type conflicts with regex_compile (we
  714.           haven't been compiling this).
  715.  
  716.         * regexinc.c (SIGN_EXTEND_CHAR): use `__CHAR_UNSIGNED__', not
  717.           `CHAR_UNSIGNED'.
  718.  
  719.         * regexinc.c (NULL) [!NULL]: define it (as zero).
  720.  
  721.         * regexinc.c (extract_number): remove the temporaries.
  722.  
  723. Sun Jan  5 07:50:14 1992  Karl Berry  (karl at hayley)
  724.  
  725.         * regex.h (regerror) [!__STDC__]: return a size_t, not a size_t *.
  726.  
  727.         * xregex.c (PUSH_FAILURE_POINT, ...): declare `destination' as
  728.           `char *' instead of `void *', to match alloca declaration.
  729.  
  730.         * xregex.c (regerror): use `size_t' for the intermediate values
  731.           as well as the return type.
  732.  
  733.         * xregex.c (regexec): cast the result of malloc.
  734.  
  735.         * xregex.c (regexec): don't initialize `private_preg' in the
  736.           declaration, as old C compilers can't do that.
  737.  
  738.         * xregex.c (main) [test]: declare printchar void.
  739.  
  740.         * xregex.c (assert) [!DEBUG]: define this to do nothing, and
  741.           remove #ifdef DEBUG's from around asserts.
  742.  
  743.         * xregex.c (re_match_2): remove error message when not debugging.
  744.  
  745. Sat Jan  4 09:45:29 1992  Karl Berry  (karl at hayley)
  746.  
  747.         * other.c: test the bizarre duplicate case in re_compile_fastmap
  748.           that I just noticed.
  749.  
  750.         * test.c (general_test): don't test registers beyond the end of
  751.           correct_regs, as well as regs.
  752.  
  753.         * xregex.c (regex_compile): at handle_close, don't assign to
  754.           *inner_group_loc if we didn't push a start_memory (because the
  755.           group number was too big).  In fact, don't push or pop the
  756.           inner_group_offset in that case.
  757.  
  758.         * regex.c: rename to xregex.c, since it's not the whole thing.
  759.         * regex.texinfo: likewise.
  760.         * GNUmakefile: change to match.
  761.  
  762.         * regex.c [DEBUG]: only include <stdio.h> if debugging.
  763.  
  764.         * regexinc.c (SIGN_EXTEND_CHAR) [CHAR_UNSIGNED]: if it's already
  765.           defined, don't redefine it.
  766.  
  767.         * regex.c: define _GNU_SOURCE at the beginning.
  768.         * regexinc.c (isblank) [!isblank]: define it.
  769.         (isgraph) [!isgraph]: change conditional to this, and remove the
  770.           sequent stuff.
  771.  
  772.         * regex.c (regex_compile): add `blank' character class.
  773.  
  774.         * regex.c (regex_compile): don't use a uchar variable to loop
  775.           through all characters.
  776.  
  777.         * regex.c (regex_compile): at '[', improve logic for checking
  778.           that we have enough space for the charset.
  779.  
  780.         * regex.h (struct re_pattern_buffer): declare translate as char
  781.           * again.  We only use it as an array subscript once, I think.
  782.  
  783.         * regex.c (TRANSLATE): new macro to cast the data character
  784.           before subscripting.
  785.         (num_internal_regs): rename to `num_regs'.
  786.  
  787. Fri Jan  3 07:58:01 1992  Karl Berry  (karl at hayley)
  788.  
  789.         * regex.h (struct re_pattern_buffer): declare `allocated' and
  790.           `used' as unsigned long, since these are never negative.
  791.  
  792.         * regex.c (compile_stack_element): rename to compile_stack_elt_t.
  793.         (failure_stack_element): similarly.
  794.  
  795.         * regexinc.c (TALLOC, RETALLOC): new macros to simplify
  796.           allocation of arrays.
  797.           
  798.         * regex.h (re_*) [__STDC__]: don't declare string args unsigned
  799.           char *; that makes them incompatible with string constants.
  800.         (struct re_pattern_buffer): declare the pattern and translate
  801.           table as unsigned char *.
  802.         * regex.c (most routines): use unsigned char vs. char consistently.
  803.  
  804.         * regex.h (re_compile_pattern): do not declare the length arg as
  805.           const.
  806.         * regex.c (re_compile_pattern): likewise.
  807.  
  808.         * regex.c (POINTER_TO_REG): rename to `POINTER_TO_OFFSET'.
  809.  
  810.         * regex.h (re_registers): declare `start' and `end' as
  811.           `regoff_t', instead of `int'.
  812.  
  813.         * regex.c (regexec): if either of the malloc's for the register
  814.           information fail, return failure.
  815.  
  816.         * regex.h (RE_NREGS): define this again, as 30 (from jla).
  817.         (RE_ALLOCATE_REGISTERS): remove this.
  818.         (RE_SYNTAX_*): remove it from definitions.
  819.         (re_pattern_buffer): remove `return_default_num_regs', add
  820.           `caller_allocated_regs'.
  821.         * regex.c (re_compile_pattern): clear no_sub and
  822.           caller_allocated_regs in the pattern.
  823.         (regcomp): set caller_allocated_regs.
  824.         (re_match_2): do all register allocation at the end of the
  825.           match; implement new semantics.
  826.  
  827.         * regex.c (MAX_REGNUM): new macro.
  828.         (regex_compile): at handle_open and handle_close, if the group
  829.           number is too large, don't push the start/stop memory.
  830.  
  831. Thu Jan  2 07:56:10 1992  Karl Berry  (karl at hayley)
  832.  
  833.         * regex.c (re_match_2): if the back reference is to a group that
  834.           never matched, then goto fail, not really_fail.  Also, don't
  835.           test if the pattern can match the empty string.  Why did we
  836.           ever do that?
  837.         (really_fail): this label no longer needed.
  838.  
  839.         * regexinc.c [STDC_HEADERS]: use only this to test if we should
  840.           include <stdlib.h>.
  841.  
  842.         * regex.c (DO_RANGE, regex_compile): translate in all cases
  843.           except the single character after a \.
  844.  
  845.         * regex.h (RE_AWK_CLASS_HACK): rename to
  846.           RE_BACKSLASH_ESCAPE_IN_LISTS.
  847.         * regex.c (regex_compile): change use.
  848.  
  849.         * regex.c (re_compile_fastmap): do not translate the characters
  850.           again; we already translated them at compilation.  (From ylo@ngs.fi.)
  851.  
  852.         * regex.c (re_match_2): in case for at_dot, invert sense of
  853.           comparison and find the character number properly.  (From
  854.           worley@compass.com.)
  855.         (re_match_2) [emacs]: remove the cases for before_dot and
  856.           after_dot, since there's no way to specify them, and the code
  857.           is wrong (judging from this change).
  858.  
  859. Wed Jan  1 09:13:38 1992  Karl Berry  (karl at hayley)
  860.  
  861.         * psx-{interf,basic,extend}.c, other.c: set `t' as the first
  862.           thing, so that if we run them in sucession, general_test's
  863.           kludge to see if we're doing POSIX tests works.
  864.  
  865.         * test.h (test_type): add `all_test'.
  866.         * main.c: add case for `all_test'.
  867.  
  868.         * regexinc.c (partial_compiled_pattern_printer,
  869.           double_string_printer): don't print anything if we're passed null.
  870.  
  871.         * regex.c (PUSH_FAILURE_POINT): do not scan for the highest and
  872.           lowest active registers.
  873.         (re_match_2): compute lowest/highest active regs at start_memory and
  874.           stop_memory.
  875.         (NO_{LOW,HIGH}EST_ACTIVE_REG): new sentinel values.
  876.         (pop_failure_point): return the lowest/highest active reg values
  877.           popped; change calls.
  878.  
  879.         * regex.c [DEBUG]: include <assert.h>.
  880.         (various routines) [DEBUG]: change conditionals to assertions.
  881.  
  882.         * regex.c (DEBUG_STATEMENT): new macro.
  883.         (PUSH_FAILURE_POINT): use it to increment num_regs_pushed.
  884.         (re_match_2) [DEBUG]: only declare num_regs_pushed if DEBUG.
  885.  
  886.         * regex.c (*can_match_nothing): rename to *unmatchable.
  887.  
  888.         * regex.c (re_match_2): at stop_memory, adjust argument reading.
  889.  
  890.         * regex.h (re_pattern_buffer): declare `can_be_null' as a 2-bit
  891.           bit field.
  892.  
  893.         * regex.h (re_pattern_buffer): declare `buffer' unsigned char *;
  894.           no, dumb idea.  The pattern can have signed number.
  895.  
  896.         * regex.c (re_match_2): in maybe_pop_jump case, skip over the
  897.           right number of args to the group operators, and don't do
  898.           anything with endline if posix_newline is not set.
  899.  
  900.         * regex.c, regexinc.c (all the things we just changed): go back
  901.           to putting the inner group count after the start_memory,
  902.           because we need it in the on_failure_jump case in re_match_2.
  903.           But leave it after the stop_memory also, since we need it
  904.           there in re_match_2, and we don't have any way of getting back
  905.           to the start_memory.
  906.  
  907.         * regexinc.c (partial_compiled_pattern_printer): adjust argument
  908.           reading for start/stop_memory.
  909.         * regex.c (re_compile_fastmap, group_can_match_nothing): likewise.
  910.  
  911. Tue Dec 31 10:15:08 1991  Karl Berry  (karl at hayley)
  912.  
  913.         * regex.c (bits list routines): remove these.
  914.         (re_match_2): get the number of inner groups from the pattern,
  915.           instead of keeping track of it at start and stop_memory.
  916.           Put the count after the stop_memory, not after the
  917.           start_memory.
  918.         (compile_stack_element): remove `fixup_inner_group' member,
  919.           since we now put it in when we can compute it.
  920.         (regex_compile): at handle_open, don't push the inner group
  921.           offset, and at handle_close, don't pop it.
  922.  
  923.         * regex.c (level routines): remove these, and their uses in
  924.           regex_compile.  This was another manifestation of having to find
  925.           $'s that were endlines.
  926.  
  927.         * regex.c (regexec): this does searching, not matching (a
  928.           well-disguised part of the standard).  So rewrite to use
  929.           `re_search' instead of `re_match'.
  930.         * psx-interf.c (test_regexec): add tests to, uh, match.
  931.  
  932.         * regex.h (RE_TIGHT_ALT): remove this; nobody uses it.
  933.         * regex.c: remove the code that was supposed to implement it.
  934.  
  935.         * other.c (test_others): ^ and $ never match newline characters;
  936.           RE_CONTEXT_INVALID_OPS doesn't affect anchors.
  937.  
  938.         * psx-interf.c (test_regerror): update for new error messages.
  939.  
  940.         * psx-extend.c: it's now ok to have an alternative be just a $,
  941.           so remove all the tests which supposed that was invalid.
  942.  
  943. Wed Dec 25 09:00:05 1991  Karl Berry  (karl at hayley)
  944.  
  945.         * regex.c (regex_compile): in handle_open, don't skip over ^ and
  946.           $ when checking for an empty group.  POSIX has changed the
  947.           grammar.
  948.         * psx-extend.c (test_posix_extended): thus, move (^$) tests to
  949.           valid section.
  950.  
  951.         * regexinc.c (boolean): move from here to test.h and regex.c.
  952.         * test files: declare verbose, omit_register_tests, and
  953.           test_should_match as boolean.
  954.  
  955.         * psx-interf.c (test_posix_c_interface): remove the `c_'.
  956.         * main.c: likewise.
  957.  
  958.         * psx-basic.c (test_posix_basic): ^ ($) is an anchor after
  959.           (before) an open (close) group.
  960.  
  961.         * regex.c (re_match_2): in endline, correct precedence of
  962.           posix_newline condition.
  963.  
  964. Tue Dec 24 06:45:11 1991  Karl Berry  (karl at hayley)
  965.  
  966.         * test.h: incorporate private-tst.h.  
  967.         * test files: include test.h, not private-tst.h.
  968.  
  969.         * test.c (general_test): set posix_newline to zero if we are
  970.           doing POSIX tests (unfortunately, it's difficult to call
  971.           regcomp in this case, which is what we should really be doing).
  972.  
  973.         * regex.h (reg_syntax_t): make this an enumeration type which
  974.           defines the syntax bits; renames re_syntax_t.
  975.  
  976.         * regex.c (at_endline_op_p): don't preincrement p; then if it's
  977.           not an empty string op, we lose.
  978.  
  979.         * regex.h (reg_errcode_t): new enumeration type of the error
  980.           codes.
  981.         * regex.c (regex_compile): return that type.
  982.  
  983.         * regex.c (regex_compile): in [, initialize
  984.           just_had_a_char_class to false; somehow I had changed this to
  985.           true.
  986.  
  987.         * regex.h (RE_NO_CONSECUTIVE_REPEATS): remove this, since we
  988.           don't use it, and POSIX doesn't require this behavior anymore.
  989.         * regex.c (regex_compile): remove it from here.
  990.  
  991.         * regex.c (regex_compile): remove the no_op insertions for
  992.           verify_and_adjust_endlines, since that doesn't exist anymore.
  993.  
  994.         * regex.c (regex_compile) [DEBUG]: use printchar to print the
  995.           pattern, so unprintable bytes will print properly.
  996.  
  997.         * regex.c: move re_error_msg back.
  998.         * test.c (general_test): print the compile error if the pattern
  999.           was invalid.
  1000.  
  1001. Mon Dec 23 08:54:53 1991  Karl Berry  (karl at hayley)
  1002.  
  1003.         * regexinc.c: move re_error_msg here.
  1004.  
  1005.         * regex.c (re_error_msg): the ``message'' for success must be
  1006.           NULL, to keep the interface to re_compile_pattern the same.
  1007.         (regerror): if the msg is null, use "Success".
  1008.  
  1009.         * rename most test files for consistency.  Change Makefile
  1010.           correspondingly.
  1011.  
  1012.         * test.c (most routines): add casts to (unsigned char *) when we
  1013.           call re_{match,search}{,_2}.
  1014.  
  1015. Sun Dec 22 09:26:06 1991  Karl Berry  (karl at hayley)
  1016.  
  1017.         * regex.c (re_match_2): declare string args as unsigned char *
  1018.           again; don't declare non-pointer args const; declare the
  1019.           pattern buffer const.
  1020.         (re_match): likewise.
  1021.         (re_search_2, re_search): likewise, except don't declare the
  1022.           pattern const, since we make a fastmap.
  1023.         * regex.h [__STDC__]: change prototypes.
  1024.  
  1025.         * regex.c (regex_compile): return an error code, not a string.
  1026.         (re_err_list): new table to map from error codes to string.
  1027.         (re_compile_pattern): return an element of re_err_list.
  1028.         (regcomp): don't test all the strings.
  1029.         (regerror): just use the list.
  1030.         (put_in_buffer): remove this.
  1031.  
  1032.         * regex.c (equivalent_failure_points): remove this.
  1033.  
  1034.         * regex.c (re_match_2): don't copy the string arguments into
  1035.           non-const pointers.  We never alter the data.
  1036.  
  1037.         * regex.c (re_match_2): move assignment to `is_a_jump_n' out of
  1038.           the main loop.  Just initialize it right before we do
  1039.           something with it.
  1040.  
  1041.         * regex.[ch] (re_match_2): don't declare the int parameters const.
  1042.  
  1043. Sat Dec 21 08:52:20 1991  Karl Berry  (karl at hayley)
  1044.  
  1045.         * regex.h (re_syntax_t): new type; declare to be unsigned
  1046.           (previously we used int, but since we do bit operations on
  1047.           this, unsigned is better, according to H&S).
  1048.         (obscure_syntax, re_pattern_buffer): use that type.
  1049.         * regex.c (re_set_syntax, regex_compile): likewise.
  1050.  
  1051.         * regex.h (re_pattern_buffer): new field `posix_newline'.
  1052.         * regex.c (re_comp, re_compile_pattern): set to zero.
  1053.         (regcomp): set to REG_NEWLINE.
  1054.         * regex.h (RE_HAT_LISTS_NOT_NEWLINE): remove this (we can just
  1055.           check `posix_newline' instead.)
  1056.  
  1057.         * regex.c (op_list_type, op_list, add_op): remove these.
  1058.         (verify_and_adjust_endlines): remove this.
  1059.         (pattern_offset_list_type, *pattern_offset* routines): and these.
  1060.           These things all implemented the nonleading/nontrailing position
  1061.           code, which was very long, had a few remaining problems, and
  1062.           is no longer needed.  So...
  1063.  
  1064.         * regexinc.c (STREQ): new macro to abbreviate strcmp(,)==0, for
  1065.           brevity.  Change various places in regex.c to use it.
  1066.  
  1067.         * regex{,inc}.c (enum regexpcode): change to a typedef
  1068.           re_opcode_t, for brevity.
  1069.  
  1070.         * regex.h (re_syntax_table) [SYNTAX_TABLE]: remove this; it
  1071.           should only be in regex.c, I think, since we don't define it
  1072.           in this case.  Maybe it should be conditional on !SYNTAX_TABLE?
  1073.  
  1074.         * regexinc.c (partial_compiled_pattern_printer): simplify and
  1075.           distinguish the emacs/not-emacs (not)wordchar cases.
  1076.  
  1077. Fri Dec 20 08:11:38 1991  Karl Berry  (karl at hayley)
  1078.  
  1079.         * regexinc.c (regexpcode) [emacs]: only define the Emacs opcodes
  1080.           if we are ifdef emacs.
  1081.  
  1082.         * regex.c (BUF_PUSH*): rename to PAT_PUSH*.
  1083.  
  1084.         * regex.c (regex_compile): in $ case, go back to essentially the
  1085.           original code for deciding endline op vs. normal char.
  1086.         (at_endline_op_p): new routine.
  1087.         * regex.h (RE_ANCHORS_ONLY_AT_ENDS, RE_CONTEXT_INVALID_ANCHORS,
  1088.           RE_REPEATED_ANCHORS_AWAY, RE_NO_ANCHOR_AT_NEWLINE): remove
  1089.           these.  POSIX has simplified the rules for anchors in draft
  1090.           11.2.
  1091.         (RE_NEWLINE_ORDINARY): new syntax bit.
  1092.         (RE_CONTEXT_INDEP_ANCHORS): change description to be compatible
  1093.           with POSIX.
  1094.         * regex.texinfo (Syntax Bits): remove the descriptions.
  1095.  
  1096. Mon Dec 16 08:12:40 1991  Karl Berry  (karl at hayley)
  1097.  
  1098.         * regex.c (re_match_2): in jump_past_next_alt, unconditionally
  1099.           goto no_pop.  The only register we were finding was one which
  1100.           enclosed the whole alternative expression, not one around an
  1101.           individual alternative.  So we were never doing what we
  1102.           thought we were doing, and this way makes (|a) against the
  1103.           empty string fail.
  1104.  
  1105.         * regex.c (regex_compile): remove `highest_ever_regnum', and
  1106.           don't restore regnum from the stack; just put it into a
  1107.           temporary to put into the stop_memory.  Otherwise, groups
  1108.           aren't numbered consecutively.
  1109.  
  1110.         * regex.c (is_in_compile_stack): rename to
  1111.           `group_in_compile_stack'; remove unnecessary test for the
  1112.           stack being empty.
  1113.  
  1114.         * regex.c (re_match_2): in on_failure_jump, skip no_op's before
  1115.           checking for the start_memory, in case we were called from
  1116.           succeed_n.
  1117.  
  1118. Sun Dec 15 16:20:48 1991  Karl Berry  (karl at hayley)
  1119.  
  1120.         * regex.c (regex_compile): in duplicate case, use
  1121.           highest_ever_regnum instead of regnum, since the latter is
  1122.           reverted at stop_memory.
  1123.  
  1124.         * regex.c (re_match_2): in on_failure_jump, if the * applied to
  1125.           a group, save the information for that group and all inner
  1126.           groups (by making it active), even though we're not inside it
  1127.           yet.
  1128.  
  1129. Sat Dec 14 09:50:59 1991  Karl Berry  (karl at hayley)
  1130.  
  1131.         * regex.c (PUSH_FAILURE_ITEM, POP_FAILURE_ITEM): new macros.
  1132.           Use them instead of copying the stack manipulating a zillion
  1133.           times.
  1134.  
  1135.         * regex.c (PUSH_FAILURE_POINT, pop_failure_point) [DEBUG]: save
  1136.           and restore a unique identification value for each failure point.
  1137.  
  1138.         * regexinc.c (partial_compiled_pattern_printer): don't print an
  1139.           extra / after duplicate commands.
  1140.  
  1141.         * regex.c (regex_compile): in back-reference case, allow a back
  1142.           reference to register `regnum'.  Otherwise, even `\(\)\1'
  1143.           fails, since regnum is 1 at the back-reference.
  1144.  
  1145.         * regex.c (re_match_2): in fail, don't examine the pattern if we
  1146.           restored to pend.
  1147.  
  1148.         * test_private.h: rename to private_tst.h.  Change includes.
  1149.  
  1150.         * regex.c (extend_bits_list): compute existing size for realloc
  1151.           in bytes, not blocks.
  1152.  
  1153.         * regex.c (re_match_2): in jump_past_next_alt, the for loop was
  1154.           missing its (empty) statement.  Even so, some register tests
  1155.           still fail, although in a different way than in the previous change.
  1156.  
  1157. Fri Dec 13 15:55:08 1991  Karl Berry  (karl at hayley)
  1158.  
  1159.         * regex.c (re_match_2): in jump_past_next_alt, unconditionally
  1160.           goto no_pop, since we weren't properly detecting if the
  1161.           alternative matched something anyway.  No, we need to not jump
  1162.           to keep the register values correct; just change to not look at
  1163.           register zero and not test RE_NO_EMPTY_ALTS (which is a
  1164.           compile-time thing).
  1165.  
  1166.         * regex.c (SET_REGS_MATCHED): start the loop at 1, since we never
  1167.           care about register zero until the very end.  (I think.)
  1168.  
  1169.         * regex.c (PUSH_FAILURE_POINT, pop_failure_point): go back to
  1170.           pushing and popping the active registers, instead of only doing
  1171.           the registers before a group: (fooq|fo|o)*qbar against fooqbar
  1172.           fails, since we restore back into the middle of group 1, yet it
  1173.           isn't active, because the previous restore clobbered the active flag.
  1174.  
  1175. Thu Dec 12 17:25:36 1991  Karl Berry  (karl at hayley)
  1176.  
  1177.         * regex.c (PUSH_FAILURE_POINT): do not call
  1178.           `equivalent_failure_points' after all; it causes the registers
  1179.           to be ``wrong'' (according to POSIX), and an infinite loop on
  1180.           `((a*)*)*' against `ab'.
  1181.  
  1182.         * regex.c (re_compile_fastmap): don't push `pend' on the failure
  1183.           stack.
  1184.  
  1185. Tue Dec 10 10:30:03 1991  Karl Berry  (karl at hayley)
  1186.  
  1187.         * regex.c (PUSH_FAILURE_POINT): if pushing same failure point that
  1188.           is on the top of the stack, fail.
  1189.         (equivalent_failure_points): new routine.
  1190.  
  1191.         * regex.c (re_match_2): add debug statements for every opcode we
  1192.           execute.
  1193.  
  1194.         * regex.c (regex_compile/handle_close): restore
  1195.           `fixup_inner_group_count' and `regnum' from the stack.
  1196.  
  1197. Mon Dec  9 13:51:15 1991  Karl Berry  (karl at hayley)
  1198.  
  1199.         * regex.c (PUSH_FAILURE_POINT): declare `this_reg' as int, so
  1200.           unsigned arithmetic doesn't happen when we don't want to save 
  1201.           the registers.
  1202.  
  1203. Tue Dec  3 08:11:10 1991  Karl Berry  (karl at hayley)
  1204.  
  1205.         * regex.c (extend_bits_list): divide size by bits/block.
  1206.  
  1207.         * regex.c (init_bits_list): remove redundant assignmen to
  1208.           `bits_list_ptr'.
  1209.  
  1210.         * regexinc.c (partial_compiled_pattern_printer): don't do *p++
  1211.           twice in the same expr.
  1212.  
  1213.         * regex.c (re_match_2): at on_failure_jump, use the correct
  1214.           pattern positions for getting the stuff following the start_memory.
  1215.  
  1216.         * regex.c (struct register_info): remove the bits_list for the
  1217.           inner groups; make that a separate variable.
  1218.  
  1219. Mon Dec  2 10:42:07 1991  Karl Berry  (karl at hayley)
  1220.  
  1221.         * regex.c (PUSH_FAILURE_POINT): don't pass `failure_stack' as an
  1222.           arg; change callers.
  1223.  
  1224.         * regex.c (PUSH_FAILURE_POINT): print items in order they are
  1225.           pushed.
  1226.         (pop_failure_point): likewise.
  1227.  
  1228.         * regex.c (main): prompt for the pattern and string.
  1229.  
  1230.         * regex.c (FREE_VARIABLES) [!REGEX_MALLOC]: declare as nothing;
  1231.           remove #ifdefs from around calls.
  1232.  
  1233.         * regex.c (extract_number, extract_number_and_incr): declare static.
  1234.  
  1235.         * regex.c: remove the canned main program.
  1236.         * main.c: new file.
  1237.         * Makefile (COMMON): add main.o.
  1238.  
  1239. Tue Sep 24 06:26:51 1991  Kathy Hargreaves  (kathy at fosse)
  1240.  
  1241.         * regex.c (re_match_2): Made `pend' and `dend' not register variables.
  1242.           Only set string2 to string1 if string1 isn't null.
  1243.           Send address of p, d, regstart, regend, and reg_info to
  1244.           pop_failure_point.
  1245.           Put in more debug statements.
  1246.  
  1247.         * regex.c [debug]: Added global variable.
  1248.           (DEBUG_*PRINT*): Only print if `debug' is true.
  1249.           (DEBUG_DOUBLE_STRING_PRINTER): Changed DEBUG_STRING_PRINTER's
  1250.           name to this.
  1251.           Changed some comments.
  1252.           (PUSH_FAILURE_POINT): Moved and added some debugging statements.
  1253.           Was saving regstart on the stack twice instead of saving both
  1254.           regstart and regend; remedied this.
  1255.           [NUM_REGS_ITEMS]: Changed from 3 to 4, as now save lowest and
  1256.           highest active registers instead of highest used one.
  1257.           [NUM_NON_REG_ITEMS]: Changed name of NUM_OTHER_ITEMS to this.
  1258.           (NUM_FAILURE_ITEMS): Use active registers instead of number 0
  1259.           through highest used one.
  1260.           (re_match_2): Have pop_failure_point put things in the variables.
  1261.           (pop_failure_point): Have it do what the fail case in re_match_2 
  1262.           did with the failure stack, instead of throwing away the stuff
  1263.           popped off.  re_match_2 can ignore results when it doesn't
  1264.           need them.
  1265.           
  1266.  
  1267. Thu Sep  5 13:23:28 1991  Kathy Hargreaves  (kathy at fosse)
  1268.  
  1269.         * regex.c (banner): Changed copyright years to be separate.
  1270.         
  1271.         * regex.c [CHAR_UNSIGNED]: Put __ at both ends of this name.
  1272.           [DEBUG, debug_count, *debug_p, DEBUG_PRINT_1, DEBUG_PRINT_2,
  1273.            DEBUG_COMPILED_PATTERN_PRINTER ,DEBUG_STRING_PRINTER]:
  1274.            defined these for debugging.
  1275.           (extract_number): Added this (debuggable) routine version of
  1276.           the macro EXTRACT_NUMBER.  Ditto for EXTRACT_NUMBER_AND_INCR.
  1277.           (re_compile_pattern): Set return_default_num_regs if the
  1278.           syntax bit RE_ALLOCATE_REGISTERS is set.
  1279.           [REGEX_MALLOC]: Renamed USE_ALLOCA to this.
  1280.           (BUF_POP): Got rid of this, as don't ever use it.
  1281.           (regex_compile): Made the type of `pattern' not be register.
  1282.           If DEBUG, print the pattern to compile.
  1283.           (re_match_2): If had a `$' in the pattern before a `^' then
  1284.           don't record the `^' as an anchor.
  1285.           Put (enum regexpcode) before references to b, as suggested
  1286.           [RE_NO_BK_BRACES]: Changed RE_NO_BK_CURLY_BRACES to this.
  1287.           (remove_pattern_offset): Removed this unused routine.
  1288.           (PUSH_FAILURE_POINT): Changed to only save active registers.
  1289.           Put in debugging statements.
  1290.           (re_compile_fastmap): Made `pattern' not a register variable.
  1291.           Use routine for extracting numbers instead of macro.
  1292.           (re_match_2): Made `p', `mcnt' and `mcnt2' not register variables.
  1293.           Added `num_regs_pushed' for debugging.
  1294.           Only malloc registers if the syntax bit RE_ALLOCATE_REGISTERS is set.
  1295.           Put in debug statements.
  1296.           Put the macro NOTE_INNER_GROUP's code inline, as it was the
  1297.           only called in one place.
  1298.           For debugging, extract numbers using routines instead of macros.
  1299.           In case fail: only restore pushed active registers, and added
  1300.           debugging statements.
  1301.           (pop_failure_point): Test for underfull stack.
  1302.           (group_can_match_nothing, common_op_can_match_nothing): For
  1303.           debugging, extract numbers using routines instead of macros.
  1304.           (regexec): Changed formal parameters to not be prototypes.
  1305.           Don't initialize `regs' or `private_preg' in their declarations.
  1306.           
  1307. Tue Jul 23 18:38:36 1991  Kathy Hargreaves  (kathy at hayley)
  1308.  
  1309.         * regex.h [RE_CONTEX_INDEP_OPS]: Moved the anchor stuff out of
  1310.           this bit.
  1311.           [RE_UNMATCHED_RIGHT_PAREN_ORD]: Defined this bit.
  1312.           [RE_CONTEXT_INVALID_ANCHORS]: Defined this bit.
  1313.           [RE_CONTEXT_INDEP_ANCHORS]: Defined this bit.
  1314.           Added RE_CONTEXT_INDEP_ANCHORS to all syntaxes which had
  1315.           RE_CONTEXT_INDEP_OPS. 
  1316.           Took RE_ANCHORS_ONLY_AT_ENDS out of the POSIX basic syntax.
  1317.           Added RE_UNMATCHED_RIGHT_PAREN_ORD to the POSIX extended
  1318.           syntax.
  1319.           Took RE_REPEATED_ANCHORS_AWAY out of the POSIX extended syntax.
  1320.           Defined REG_NOERROR (which will probably have to go away again).
  1321.           Changed the type `off_t' to `regoff_t'.
  1322.  
  1323.         * regex.c: Changed some commments.
  1324.           (regex_compile): Added variable `had_an_endline' to keep track
  1325.           of if hit a `$' since the beginning of the pattern or the last
  1326.           alternative (if any).
  1327.           Changed RE_CONTEXT_INVALID_OPS and RE_CONTEXT_INDEP_OPS to
  1328.           RE_CONTEXT_INVALID_ANCHORS and RE_CONTEXT_INDEP_ANCHORS where
  1329.           appropriate. 
  1330.           Put a `no_op' in the pattern if a repeat is only zero or one
  1331.           times; in this case and if it is many times (whereupon a jump
  1332.           backwards is pushed instead), keep track of the operator for
  1333.           verify_and_adjust_endlines.
  1334.           If RE_UNMATCHED_RIGHT_PAREN is set, make an unmatched
  1335.           close-group operator match `)'.
  1336.           Changed all error exits to exit (1).
  1337.           (remove_pattern_offset): Added this routine, but don't use it.
  1338.           (verify_and_adjust_endlines): At top of routine, if initialize
  1339.           routines run out of memory, return true after setting
  1340.           enough_memory false.
  1341.           At end of endline, et al. case, don't set *p to no_op.
  1342.           Repetition operators also set the level and active groups'
  1343.           match statuses, unless RE_REPEATED_ANCHORS_AWAY is set.
  1344.           (get_group_match_status): Put a return in front of call to get_bit.
  1345.           (re_compile_fastmap): Changed is_a_succeed_n to a boolean.
  1346.           If at end of pattern, then if the failure stack isn't empty,
  1347.           go back to the failure point.
  1348.           In *jump* case, only pop the stack if what's on top of it is
  1349.           where we've just jumped to.
  1350.           (re_search_2): Return -2 instead of val if val is -2.
  1351.           (group_can_match_nothing, alternative_can_match_nothing,
  1352.           common_op_can-match_nothing): Now pass in reg_info for the
  1353.           `duplicate' case.
  1354.           (re_match_2): Don't skip over the next alternative also if
  1355.           empty alternatives aren't allowed.
  1356.           In fail case, if failed to a backwards jump that's part of a
  1357.           repetition loop, pop the current failure point and use the
  1358.           next one.
  1359.           (pop_failure_point): Check that there's as many register items
  1360.           on the failure stack as the stack says there are.
  1361.           (common_op_can_match_nothing): Added variables `ret' and
  1362.           `reg_no' so can set reg_info for the group encountered.
  1363.           Also break without doing anything if hit a no_op or the other
  1364.           kinds of `endline's.
  1365.           If not done already, set reg_info in start_memory case.
  1366.           Put in no_pop_jump for an optimized succeed_n of zero repetitions.
  1367.           In succeed_n case, if the number isn't zero, then return false.
  1368.           Added `duplicate' case.
  1369.           
  1370. Sat Jul 13 11:27:38 1991  Kathy Hargreaves  (kathy at hayley)
  1371.  
  1372.         * regex.h (REG_NOERROR): Added this error code definition.
  1373.         
  1374.         * regex.c: Took some redundant parens out of macros.
  1375.           (enum regexpcode): Added jump_past_next_alt.
  1376.           Wrapped some macros in `do..while (0)'.
  1377.           Changed some comments.
  1378.           (regex_compile): Use `fixup_alt_jump' instead of `fixup_jump'.
  1379.           Use `maybe_pop_jump' instead of `maybe_pop_failure_jump'.
  1380.           Use `jump_past_next_alt' instead of `no_pop_jump' when at the
  1381.           end of an alternative.
  1382.           (re_match_2): Used REGEX_ALLOCATE for the registers stuff.
  1383.           In stop_memory case: Add more boolean tests to see if the
  1384.           group is in a loop.
  1385.           Added jump_past_next_alt case, which doesn't jump over the
  1386.           next alternative if the last one didn't match anything.
  1387.           Unfortunately, to make this work with, e.g., `(a+?*|b)*'
  1388.           against `bb', I also had to pop the alternative's failure
  1389.           point, which in turn broke backtracking!
  1390.           In fail case: Detect a dummy failure point by looking at
  1391.           failure_stack.avail - 2, not stack[-2].
  1392.           (pop_failure_point): Only pop if the stack isn't empty; don't
  1393.           give an error if it is.  (Not sure yet this is correct.)
  1394.           (group_can_match_nothing): Make it return a boolean instead of int.
  1395.           Make it take an argument indicating the end of where it should look.
  1396.           If find a group that can match nothing, set the pointer
  1397.           argument to past the group in the pattern.  
  1398.           Took out cases which can share with alternative_can_match_nothing
  1399.           and call common_op_can_match_nothing.
  1400.           Took ++ out of switch, so could call common_op_can_match_nothing.
  1401.           Wrote lots more for on_failure_jump case to handle alternatives.
  1402.           Main loop now doesn't look for matching stop_memory, but
  1403.           rather the argument END; return true if hit the matching
  1404.           stop_memory; this way can call itself for inner groups.
  1405.           (alternative_can_match_nothing): Added for alternatives.
  1406.           (common_op_can_match_nothing):  Added for previous two routines' 
  1407.           common operators.
  1408.           (regerror): Returns a message saying there's no error if gets
  1409.           sent REG_NOERROR.
  1410.           
  1411. Wed Jul  3 10:43:15 1991  Kathy Hargreaves  (kathy at hayley)
  1412.  
  1413.         * regex.c: Removed unnecessary enclosing parens from several macros.
  1414.           Put `do..while (0)' around a few.
  1415.           Corrected some comments.
  1416.           (INIT_FAILURE_STACK_SIZE): Deleted in favor of using
  1417.           INIT_FAILURE_ALLOC.
  1418.           (INIT_FAILURE_STACK, DOUBLE_FAILURE_STACK, PUSH_PATTERN_OP,
  1419.           PUSH_FAILURE_POINT): Made routines of the same name (but with all
  1420.           lowercase letters) into these macros, so could use `alloca'
  1421.           when USE_ALLOCA is defined.  The reason is stated below for
  1422.           bits lists.  Deleted analogous routines.
  1423.           (re_compile_fastmap): Added variable void *destination for
  1424.           PUSH_PATTERN_OP.
  1425.           (re_match_2): Added variable void *destination for REGEX_REALLOCATE.
  1426.           Used the failure stack macros in place of the routines.
  1427.           Detected a dummy failure point by inspecting the failure stack's
  1428.           (avail - 2)th element, not failure_stack.stack[-2].  This bug
  1429.           arose when used the failure stack macros instead of the routines.
  1430.  
  1431.         * regex.c [USE_ALLOCA]: Put this conditional around previous
  1432.           alloca stuff and defined these to work differently depending
  1433.           on whether or not USE_ALLOCA is defined:
  1434.           (REGEX_ALLOCATE): Uses either `alloca' or `malloc'.
  1435.           (REGEX_REALLOCATE): Uses either `alloca' or `realloc'.
  1436.           (INIT_BITS_LIST, EXTEND_BITS_LIST, SET_BIT_TO_VALUE): Defined
  1437.           macro versions of routines with the same name (only with all
  1438.           lowercase letters) so could use `alloc' in re_match_2.  This
  1439.           is to prevent core leaks when C-g is used in Emacs and to make
  1440.           things faster and avoid storage fragmentation.  These things
  1441.           have to be macros because the results of `alloca' go away with
  1442.           the routine by which it's called.  
  1443.           (BITS_BLOCK_SIZE, BITS_BLOCK, BITS_MASK): Moved to above the
  1444.           above-mentioned macros instead of before the routines defined
  1445.           below regex_compile.
  1446.           (set_bit_to_value): Compacted some code.
  1447.           (reg_info_type): Changed inner_groups field to be bits_list_type 
  1448.           so could be arbitrarily long and thus handle arbitrary nesting.
  1449.           (NOTE_INNER_GROUP): Put `do...while (0)' around it so could
  1450.           use as a statement.  
  1451.           Changed code to use bits lists.
  1452.           Added variable void *destination for REGEX_REALLOCATE (whose call
  1453.           is several levels in).
  1454.           Changed variable name of `this_bit' to `this_reg'.
  1455.           (FREE_VARIABLES): Only define and use if USE_ALLOCA is defined.
  1456.           (re_match_2): Use REGEX_ALLOCATE instead of malloc.
  1457.           Instead of setting INNER_GROUPS of reg_info to zero, have to
  1458.           use INIT_BITS_LIST and return -2 (and free variables if
  1459.           USE_ALLOCA isn't defined) if it fails.
  1460.  
  1461. Fri Jun 28 13:45:07 1991  Karl Berry  (karl at hayley)
  1462.  
  1463.         * regex.c (re_match_2): set value of `dend' when we restore `d'.
  1464.  
  1465.         * regex.c: remove declaration of alloca.
  1466.  
  1467.         * regex.c (MISSING_ISGRAPH): rename to `ISGRAPH_MISSING'.
  1468.  
  1469.         * regex.h [_POSIX_SOURCE]: remove these conditionals; always
  1470.           define POSIX stuff.
  1471.         * regex.c (_POSIX_SOURCE): change conditionals to use `POSIX'
  1472.           instead.
  1473.  
  1474. Sat Jun  1 16:56:50 1991  Kathy Hargreaves  (kathy at hayley)
  1475.  
  1476.         * regex.*: Changed RE_CONTEXTUAL_* to RE_CONTEXT_*,
  1477.           RE_TIGHT_VBAR to RE_TIGHT_ALT, RE_NEWLINE_OR to
  1478.           RE_NEWLINE_ALT, and RE_DOT_MATCHES_NEWLINE to RE_DOT_NEWLINE.
  1479.  
  1480. Wed May 29 09:24:11 1991  Karl Berry  (karl at hayley)
  1481.  
  1482.         * regex.texinfo (POSIX Pattern Buffers): cross-reference the
  1483.           correct node name (Match-beginning-of-line, not ..._line).
  1484.           (Syntax Bits): put @code around all syntax bits.
  1485.  
  1486. Sat May 18 16:29:58 1991  Karl Berry  (karl at hayley)
  1487.  
  1488.         * regex.c (global): add casts to keep broken compilers from
  1489.           complaining about malloc and realloc calls.
  1490.  
  1491.         * regex.c (isgraph) [MISSING_ISGRAPH]: change test to this,
  1492.           instead of `#ifndef isgraph', since broken compilers can't
  1493.           have both a macro and a symbol by the same name.
  1494.  
  1495.         * regex.c (re_comp, re_exec) [_POSIX_SOURCE]: do not define.
  1496.         (regcomp, regfree, regexec, regerror) [_POSIX_SOURCE && !emacs]:
  1497.          only define in this case.
  1498.  
  1499. Mon May  6 17:37:04 1991  Kathy Hargreaves  (kathy at hayley)
  1500.  
  1501.         * regex.h (re_search, re_search_2): Changed BUFFER to not be const.
  1502.  
  1503.         * regex.c (re_compile_pattern): `^' is in a leading position if
  1504.           it precedes a newline.
  1505.           (various routines): Added or changed header comments.
  1506.           (double_pattern_offsets_list): Changed name from 
  1507.           `extend_pattern_offsets_list'.
  1508.           (adjust_pattern_offsets_list): Changed return value from
  1509.           unsigned to void.
  1510.           (verify_and_adjust_endlines): Now returns `true' and `false'
  1511.           instead of 1 and 0.
  1512.           `$' is in a leading position if it follows a newline.
  1513.           (set_bit_to_value, get_bit_value): Exit with error if POSITION < 0 
  1514.           so now calling routines don't have to.
  1515.           (init_failure_stack, inspect_failure_stack_top,
  1516.           pop_failure_stack_top, push_pattern_op, double_failure_stack):
  1517.           Now return value unsigned instead of boolean.
  1518.           (re_search, re_search_2): Changed BUFP to not be const.
  1519.           (re_search_2): Added variable const `private_bufp' to send to
  1520.           re_match_2. 
  1521.           (push_failure_point): Made return value unsigned instead of boolean.
  1522.  
  1523. Sat May  4 15:32:22 1991  Kathy Hargreaves  (kathy at hayley)
  1524.  
  1525.         * regex.h (re_compile_fastmap): Added extern for this.
  1526.           Changed some comments.
  1527.           
  1528.         * regex.c (re_compile_pattern): In case handle_bar: put invalid
  1529.           pattern test before levels matching stuff.
  1530.           Changed some commments.
  1531.           Added optimizing test for detecting an empty alternative that
  1532.           ends with a trailing '$' at the end of the pattern.
  1533.           (re_compile_fastmap): Moved failure_stack stuff to before this
  1534.           so could use it.  Made its stack dynamic.
  1535.           Made it return an int so that it could return -2 if its stack
  1536.           couldn't be allocated.
  1537.           Added to header comment (about the return values).
  1538.           (init_failure_stack): Wrote so both re_match_2 and
  1539.           re_compile_fastmap could use it similar stacks.
  1540.           (double_failure_stack): Added for above reasons.
  1541.           (push_pattern_op): Wrote for re_compile_fastmap.
  1542.           (re_search_2): Now return -2 if re_compile_fastmap does.
  1543.           (re_match_2): Made regstart and regend type failure_stack_element*.
  1544.           (push_failure_point): Made pattern_place and string_place type
  1545.           failure_stack_element*.
  1546.           Call double_failure_stack now.
  1547.           Return true instead of 1.
  1548.  
  1549. Wed May  1 12:57:21 1991  Kathy Hargreaves  (kathy at hayley)
  1550.  
  1551.         * regex.c (remove_intervening_anchors): Avoid erroneously making
  1552.           ops into no_op's by making them no_op only when they're beglines.
  1553.           (verify_and_adjust_endlines): Don't make '$' a normal character 
  1554.           if it's before a newline.  
  1555.           Look for the endline op in *p, not p[1].
  1556.           (failure_stack_element): Added this declaration.
  1557.           (failure_stack_type): Added this declaration.
  1558.           (INIT_FAILURE_STACK_SIZE, FAILURE_STACK_EMPTY, 
  1559.           FAILURE_STACK_PTR_EMPTY, REMAINING_AVAIL_SLOTS): Added for
  1560.           failure stack.
  1561.           (FAILURE_ITEM_SIZE, PUSH_FAILURE_POINT): Deleted.
  1562.           (FREE_VARIABLES): Now free failure_stack.stack instead of stackb.
  1563.           (re_match_2): deleted variables `initial_stack', `stackb',
  1564.           `stackp', and `stacke' and added `failure_stack' to replace them.
  1565.           Replaced calls to PUSH_FAILURE_POINT with those to
  1566.           push_failure_point.
  1567.           (push_failure_point): Added for re_match_2.
  1568.           (pop_failure_point): Rewrote to use a failure_stack_type of stack.
  1569.           (can_match_nothing): Moved definition to below re_match_2.
  1570.           (bcmp_translate): Moved definition to below re_match_2.
  1571.  
  1572. Mon Apr 29 14:20:54 1991  Kathy Hargreaves  (kathy at hayley)
  1573.  
  1574.         * regex.c (enum regexpcode): Added codes endline_before_newline
  1575.           and repeated_endline_before_newline so could detect these
  1576.           types of endlines in the intermediate stages of a compiled
  1577.           pattern.
  1578.           (INIT_FAILURE_ALLOC): Renamed NFAILURES to this and set it to 5.
  1579.           (BUF_PUSH): Put `do {...} while 0' around this.
  1580.           (BUF_PUSH_2): Defined this to cut down on expansion of EXTEND_BUFFER.
  1581.           (regex_compile): Changed some comments.
  1582.           Now push endline_before_newline if find a `$' before a newline
  1583.           in the pattern.
  1584.           If a `$' might turn into an ordinary character, set laststart
  1585.           to point to it.
  1586.           In '^' case, if syntax bit RE_TIGHT_VBAR is set, then for `^'
  1587.           to be in a leading position, it must be first in the pattern.
  1588.           Don't have to check in one of the else clauses that it's not set.
  1589.           If RE_CONTEXTUAL_INDEP_OPS isn't set but RE_ANCHORS_ONLY_AT_ENDS 
  1590.           is, make '^' a normal character if it isn't first in the pattern. 
  1591.           Can only detect at the end if a '$' after an alternation op is a
  1592.           trailing one, so can't immediately detect empty alternatives
  1593.           if a '$' follows a vbar.
  1594.           Added a picture of the ``success jumps'' in alternatives.
  1595.           Have to set bufp->used before calling verify_and_adjust_endlines.
  1596.           Also do it before returning all error strings.
  1597.           (remove_intervening_anchors): Now replaces the anchor with
  1598.           repeated_endline_before_newline if it's an endline_before_newline.
  1599.           (verify_and_adjust_endlines): Deleted SYNTAX parameter (could
  1600.           use bufp's) and added GROUP_FORWARD_MATCH_STATUS so could
  1601.           detect back references referring to empty groups.
  1602.           Added variable `bend' to point past the end of the pattern buffer. 
  1603.           Added variable `previous_p' so wouldn't have to reinspect the
  1604.           pattern buffer to see what op we just looked at.
  1605.           Added endline_before_newline and repeated_endline_before_newline
  1606.           cases.
  1607.           When checking if in a trailing position, added case where '$'
  1608.           has to be at the pattern's end if either of the syntax bits
  1609.           RE_ANCHORS_ONLY_AT_ENDS or RE_TIGHT_VBAR are set.
  1610.           Since `endline' can have the intermediate form `endline_in_repeat', 
  1611.           have to change it to `endline' if RE_REPEATED_ANCHORS_AWAY
  1612.           isn't set.
  1613.           Now disallow empty alternatives with trailing endlines in them
  1614.           if RE_NO_EMPTY_ALTS is set.
  1615.           Now don't make '$' an ordinary character if it precedes a newline.
  1616.           Don't make it an ordinary character if it's before a newline.
  1617.           Back references now affect the level matching something only if
  1618.           they refer to nonempty groups.
  1619.           (can_match_nothing): Now increment p1 in the switch, which
  1620.           changes many of the cases, but makes the code more like what
  1621.           it was derived from.
  1622.           Adjust the return statement to reflect above.
  1623.           (struct register_info): Made `can_match_nothing' field an int
  1624.           instead of a bit so could have -1 in it if never set.
  1625.           (MAX_FAILURE_ITEMS): Changed name from MAX_NUM_FAILURE_ITEMS.
  1626.           (FAILURE_ITEM_SIZE): Defined how much space a failure items uses.
  1627.           (PUSH_FAILURE_POINT): Changed variable `last_used_reg's name
  1628.           to `highest_used_reg'.
  1629.           Added variable `num_stack_items' and changed `len's name to
  1630.           `stack_length'. 
  1631.           Test failure stack limit in terms of number of items in it, not 
  1632.           in terms of its length.  rms' fix tested length against number
  1633.           of items, which was a misunderstanding.
  1634.           Use `realloc' instead of `alloca' to extend the failure stack.
  1635.           Use shifts instead of multiplying by 2.
  1636.           (FREE_VARIABLES): Free `stackb' instead of `initial_stack', as
  1637.           might may have been reallocated.
  1638.           (re_match_2): When mallocing `initial_stack', now multiply
  1639.           the number of items wanted (what was there before) by
  1640.           FAILURE_ITEM_SIZE.
  1641.           (pop_failure_point): Need this procedure form of the macro of
  1642.           the same name for debugging, so left it in and deleted the
  1643.           macro.
  1644.           (recomp): Don't free the pattern buffer's translate field.
  1645.           
  1646. Mon Apr 15 09:47:47 1991  Kathy Hargreaves  (kathy at hayley)
  1647.  
  1648.         * regex.h (RE_DUP_MAX): Moved to outside of #ifdef _POSIX_SOURCE.
  1649.         * regex.c (#include <sys/types.h>): Removed #ifdef _POSIX_SOURCE
  1650.           condition. 
  1651.           (malloc, realloc): Made return type void* #ifdef __STDC__.
  1652.           (enum regexpcode): Added endline_in_repeat for the compiler's
  1653.           use; this never ends up on the final compiled pattern.
  1654.           (INIT_PATTERN_OFFSETS_LIST_SIZE): Initial size for
  1655.           pattern_offsets_list_type. 
  1656.           (pattern_offset_type): Type for pattern offsets.
  1657.           (pattern_offsets_list_type): Type for keeping a list of
  1658.           pattern offsets.  
  1659.           (anchor_list_type): Changed to above type.
  1660.           (PATTERN_OFFSETS_LIST_PTR_FULL): Tests if a pattern offsets
  1661.           list is full.
  1662.           (ANCHOR_LIST_PTR_FULL): Changed to above.
  1663.           (BIT_BLOCK_SIZE): Changed to BITS_BLOCK_SIZE and moved to
  1664.           above bits list routines below regex_compile.
  1665.           (op_list_type): Defined to be pattern_offsets_list_type.
  1666.           (compile_stack_type): Changed offsets to be
  1667.           pattern_offset_type instead of unsigned.
  1668.           (pointer): Changed the name of all structure fields from this
  1669.           to `avail'.
  1670.           (COMPILE_STACK_FULL): Changed so the stack is full if `avail'
  1671.           is equal to `size' instead of `size' - 1.
  1672.           (GET_BUFFER_SPACE): Changed `>=' to `>' in the while statement.
  1673.           (regex_compile): Added variable `enough_memory' so could check
  1674.           that routine that verifies '$' positions could return an
  1675.           allocation error.
  1676.           (group_count): Deleted this variable, as `regnum' already does
  1677.           this work.
  1678.           (op_list): Added this variable to keep track of operations
  1679.           needed for verifying '$' positions.
  1680.           (anchor_list): Now initialize using routine
  1681.           `init_pattern_offsets_list'. 
  1682.           Consolidated the three bits_list initializations.
  1683.           In case '$': Instead of trying to go past constructs which can
  1684.           follow '$', merely detect the special case where it has to be
  1685.           at the pattern's end, fix up any fixup jumps if necessary,
  1686.           record the anchor if necessary and add an `endline' (and
  1687.           possibly two `no-op's) to the pattern; will call a routine at
  1688.           the end to verify if it's in a valid position or not.
  1689.           (init_pattern_offsets_list): Added to initialize pattern
  1690.           offsets lists.
  1691.           (extend_anchor_list): Renamed this extend_pattern_offsets_list
  1692.           and renamed parameters and internal variables appropriately.
  1693.           (add_pattern_offset): Added this routine which both
  1694.           record_anchor_position and add_op call.
  1695.           (adjust_pattern_offsets_list): Add this routine to adjust by
  1696.           some increment all the pattern offsets a list of such after a
  1697.           given position.
  1698.           (record_anchor_position): Now send in offset instead of
  1699.           calculating it and just call add_pattern_offset.
  1700.           (adjust_anchor_list): Replaced by above routine.
  1701.           (remove_intervening_anchors): If the anchor is an `endline'
  1702.           then replace it with `endline_in_repeat' instead of `no_op'.
  1703.           (add_op):  Added this routine to call in regex_compile
  1704.           wherever push something relevant to verifying '$' positions.
  1705.           (verify_and_adjust_endlines): Added routine to (1) verify that
  1706.           '$'s in a pattern buffer (represented by `endline') were in
  1707.           valid positions and (2) whether or not they were anchors.  
  1708.           (BITS_BLOCK_SIZE): Renamed BIT_BLOCK_SIZE and moved to right
  1709.           above bits list routines.
  1710.           (BITS_BLOCK): Defines which array element of a bits list the
  1711.           bit corresponding to a given position is in.
  1712.           (BITS_MASK): Has a 1 where the bit (in a bit list array element)
  1713.           for a given position is.
  1714.           
  1715. Mon Apr  1 12:09:06 1991  Kathy Hargreaves  (kathy at hayley)
  1716.  
  1717.         * regex.c (BIT_BLOCK_SIZE): Defined this for using with
  1718.           bits_list_type, abstracted from level_list_type so could use
  1719.           for more things than just the level match status.
  1720.           (regex_compile): Renamed `level_list' variable to
  1721.           `level_match_status'. 
  1722.           Added variable `group_match_status' of type bits_list_type.
  1723.           Kept track of whether or not for all groups any of them
  1724.           matched other than the empty string, so detect if a back
  1725.           reference in front of a '^' made it nonleading or not.
  1726.           Do this by setting a match status bit for all active groups
  1727.           whenever leave a group that matches other than the empty string.
  1728.           Could detect which groups are active by going through the
  1729.           stack each time, but or-ing a bits list of active groups with
  1730.           a bits list of group match status is faster, so make a bits
  1731.           list of active groups instead.
  1732.           Have to check that '^' isn't in a leading position before
  1733.           going to normal_char.
  1734.           Whenever set level match status of the current level, also set
  1735.           the match status of all active groups.
  1736.           Increase the group count and make that group active whenever
  1737.           open a group.
  1738.           When close a group, only set the next level down if the
  1739.           current level matches other than the empty string, and make
  1740.           the current group inactive.
  1741.           At a back reference, only set a level's match status if the
  1742.           group to which the back reference refers matches other than
  1743.           the empty string.
  1744.           (init_bits_list): Added to initialize a bits list.
  1745.           (get_level_value): Deleted this.  (Made into
  1746.           get_level_match_status.)
  1747.           (extend_bits_list): Added to extend a bits list.  (Made this
  1748.           from deleted routine `extend_level_list'.)
  1749.           (get_bit): Added to get a bit value from a bits list.  (Made
  1750.           this from deleted routine `get_level_value'.)
  1751.           (set_bit_to_value): Added to set a bit in a bits list.  (Made
  1752.           this from deleted routine `set_level_value'.)
  1753.           (get_level_match_status): Added this to get the match status
  1754.           of a given level.  (Made from get_level_value.)
  1755.           (set_this_level, set_next_lower_level): Made all routines
  1756.           which set bits extend the bits list if necessary, thus they
  1757.           now return an unsigned value to indicate whether or not the
  1758.           reallocation failed.
  1759.           (increase_level): No longer extends the level list.
  1760.           (make_group_active): Added to mark as active a given group in
  1761.           an active groups list.
  1762.           (make_group_inactive): Added to mark as inactive a given group
  1763.           in an active groups list.
  1764.           (set_match_status_of_active_groups): Added to set the match
  1765.           status of all currently active groups.
  1766.           (get_group_match_status): Added to get a given group's match status.
  1767.           (no_levels_match_anything): Removed the paramenter LEVEL.
  1768.           (PUSH_FAILURE_POINT): Added rms' bug fix and changed RE_NREGS
  1769.           to num_internal_regs.
  1770.           
  1771. Sun Mar 31 09:04:30 1991  Kathy Hargreaves  (kathy at hayley)
  1772.  
  1773.         * regex.h (RE_ANCHORS_ONLY_AT_ENDS): Added syntax so could
  1774.           constrain '^' and '$' to only be anchors if at the beginning
  1775.           and end of the pattern.
  1776.           (RE_SYNTAX_POSIX_BASIC): Added the above bit.
  1777.           
  1778.         * regex.c (enum regexcode): Changed `unused' to `no_op'.
  1779.           (this_and_lower_levels_match_nothing): Deleted forward reference.
  1780.           (regex_compile): case '^': if the syntax bit RE_ANCHORS_ONLY_AT_ENDS
  1781.           is set, then '^' is only an anchor if at the beginning of the
  1782.           pattern; only record anchor position if the syntax bit
  1783.           RE_REPEATED_ANCHORS_AWAY is set; the '^' is a normal char if
  1784.           the syntax bit RE_ANCHORS_ONLY_AT_END is set and we're not at
  1785.           the beginning of the pattern (and neither RE_CONTEXTUAL_INDEP_OPS
  1786.           nor RE_CONTEXTUAL_INDEP_OPS syntax bits are set).
  1787.           Only adjust the anchor list if the syntax bit
  1788.           RE_REPEATED_ANCHORS_AWAY is set.
  1789.  
  1790.         * regex.c (level_list_type): Use to detect when '^' is
  1791.           in a leading position.  
  1792.           (regex_compile): Added level_list_type level_list variable in
  1793.           which we keep track of whether or not a grouping level (in its
  1794.           current or most recent incarnation) matches anything besides the
  1795.           empty string.  Set the bit for the i-th level when detect it
  1796.           should match something other than the empty string and the bit
  1797.           for the (i-1)-th level when leave the i-th group.  Clear all
  1798.           bits for the i-th and higher levels if none of 0--(i - 1)-th's
  1799.           bits are set when encounter an alternation operator on that
  1800.           level.  If no levels are set when hit a '^', then it is in a
  1801.           leading position.  We keep track of which level we're at by
  1802.           increasing a variable current_level whenever we encounter an
  1803.           open-group operator and decreasing it whenever we encounter a
  1804.           close-group operator.
  1805.           Have to adjust the anchor list contents whenever insert
  1806.           something ahead of them (such as on_failure_jump's) in the
  1807.           pattern. 
  1808.           (adjust_anchor_list): Adjusts the offsets in an anchor list by
  1809.           a given increment starting at a given start position.
  1810.           (get_level_value): Returns the bit setting of a given level.
  1811.           (set_level_value): Sets the bit of a given level to a given value.
  1812.           (set_this_level): Sets (to 1) the bit of a given level.
  1813.           (set_next_lower_level): Sets (to 1) the bit of (LEVEL - 1) for a
  1814.           given LEVEL.
  1815.           (clear_this_and_higher_levels): Clears the bits for a given
  1816.           level and any higher levels.
  1817.           (extend_level_list): Adds sizeof(unsigned) more bits to a level list.
  1818.           (increase_level): Increases by 1 the value of a given level variable.
  1819.           (decrease_level): Decreases by 1 the value of a given level variable.
  1820.           (lower_levels_match_nothing): Checks if any levels lower than
  1821.           the given one match anything.
  1822.           (no_levels_match_anything): Checks if any levels match anything.
  1823.           (re_match_2): At case wordbeg: before looking at d-1, check that
  1824.           we're not at the string's beginning.
  1825.           At case wordend: Added some illuminating parentheses.
  1826.         
  1827. Mon Mar 25 13:58:51 1991  Kathy Hargreaves  (kathy at hayley)
  1828.  
  1829.         * regex.h (RE_NO_ANCHOR_AT_NEWLINE): Changed syntax bit name
  1830.           from RE_ANCHOR_NOT_NEWLINE because an anchor never matches the
  1831.           newline itself, just the empty string either before or after it.
  1832.           (RE_REPEATED_ANCHORS_AWAY): Added this syntax bit for ignoring
  1833.           anchors inside groups which are operated on by repetition
  1834.           operators. 
  1835.           (RE_DOT_MATCHES_NEWLINE): Added this bit so the match-any-character
  1836.           operator could match a newline when it's set.
  1837.           (RE_SYNTAX_POSIX_BASIC): Set RE_DOT_MATCHES_NEWLINE in this.
  1838.           (RE_SYNTAX_POSIX_EXTENDED): Set RE_DOT_MATCHES_NEWLINE and 
  1839.           RE_REPEATED_ANCHORS_AWAY in this.
  1840.           (regerror): Changed prototypes to new POSIX spec.
  1841.  
  1842.         * regex.c (anchor_list_type): Added so could null out anchors inside
  1843.           repeated groups.
  1844.           (ANCHOR_LIST_PTR_FULL): Added for above type.
  1845.           (compile_stack_element): Changed name from stack_element.
  1846.           (compile_stack_type): Changed name from compile_stack.
  1847.           (INIT_COMPILE_STACK_SIZE): Changed name from INIT_STACK_SIZE.
  1848.           (COMPILE_STACK_EMPTY): Changed name from STACK_EMPTY.
  1849.           (COMPILE_STACK_FULL): Changed name from STACK_FULL.
  1850.           (regex_compile): Changed SYNTAX parameter to non-const.
  1851.           Changed variable name `stack' to `compile_stack'.
  1852.           If syntax bit RE_REPEATED_ANCHORS_AWAY is set, then naively put
  1853.           anchors in a list when encounter them and then set them to
  1854.           `unused' when detect they are within a group operated on by a
  1855.           repetition operator.  Need something more sophisticated than
  1856.           this, as they should only get set to `unused' if they are in
  1857.           positions where they would be anchors.  Also need a better way to
  1858.           detect contextually invalid anchors.
  1859.           Changed some commments.
  1860.           (is_in_compile_stack): Changed name from `is_in_stack'.
  1861.           (extend_anchor_list): Added to do anchor stuff.
  1862.           (record_anchor_position): Added to do anchor stuff.
  1863.           (remove_intervening_anchors): Added to do anchor stuff.
  1864.           (re_match_2): Now match a newline with the match-any-character
  1865.           operator if RE_DOT_MATCHES_NEWLINE is set.
  1866.           Compacted some code.
  1867.           (regcomp): Added new POSIX newline information to the header
  1868.           commment. 
  1869.           If REG_NEWLINE cflag is set, then now unset RE_DOT_MATCHES_NEWLINE
  1870.           in syntax.
  1871.           (put_in_buffer): Added to do new POSIX regerror spec.  Called
  1872.           by regerror.
  1873.           (regerror): Changed to take a pattern buffer, error buffer and
  1874.           its size, and return type `size_t', the size of the full error
  1875.           message, and the first ERRBUF_SIZE - 1 characters of the full
  1876.           error message in the error buffer.
  1877.           
  1878. Wed Feb 27 16:38:33 1991  Kathy Hargreaves  (kathy at hayley)
  1879.  
  1880.         * regex.h (#include <sys/types.h>): Removed this as new POSIX
  1881.           standard has the user include it.
  1882.           (RE_SYNTAX_POSIX_BASIC and RE_SYNTAX_POSIX_EXTENDED): Removed
  1883.           RE_HAT_LISTS_NOT_NEWLINE as new POSIX standard has the cflag
  1884.           REG_NEWLINE now set this.  Similarly, added syntax bit
  1885.           RE_ANCHOR_NOT_NEWLINE as this is now unset by REG_NEWLINE.
  1886.           (RE_SYNTAX_POSIX_BASIC): Removed syntax bit
  1887.           RE_NO_CONSECUTIVE_REPEATS as POSIX now allows them.
  1888.           
  1889.         * regex.c (#include <sys/types.h>): Added this as new POSIX
  1890.           standard has the user include it instead of us putting it in
  1891.           regex.h.
  1892.           (extern char *re_syntax_table): Made into an extern so the
  1893.           user could allocate it.
  1894.           (DO_RANGE): If don't find a range end, now goto invalid_range_end 
  1895.           instead of unmatched_left_bracket.
  1896.           (regex_compile): Made variable SYNTAX non-const.????
  1897.           Reformatted some code.
  1898.           (re_compile_fastmap): Moved is_a_succeed_n's declaration to
  1899.           inner braces.
  1900.           Compacted some code.
  1901.           (SET_NEWLINE_FLAG): Removed and put inline.
  1902.           (regcomp): Made variable `syntax' non-const so can unset
  1903.           RE_ANCHOR_NOT_NEWLINE syntax bit if cflag RE_NEWLINE is set.
  1904.           If cflag RE_NEWLINE is set, set the RE_HAT_LISTS_NOT_NEWLINE
  1905.           syntax bit and unset RE_ANCHOR_NOT_NEWLINE one of `syntax'.
  1906.                     
  1907. Wed Feb 20 16:33:38 1991  Kathy Hargreaves  (kathy at hayley)
  1908.  
  1909.         * regex.h (RE_NO_CONSECUTIVE_REPEATS): Changed name from
  1910.           RE_NO_CONSEC_REPEATS.
  1911.           (REG_ENESTING): Deleted this POSIX return value, as the stack
  1912.           is now unbounded.
  1913.           (struct re_pattern_buffer): Changed some comments.
  1914.           (re_compile_pattern): Changed a comment.
  1915.           Deleted check on stack upper bound and corresponding error.
  1916.           Now when there's no interval contents and it's the end of the
  1917.           pattern, go to unmatched_left_curly_brace instead of end_of_pattern.
  1918.           Removed nesting_too_deep error, as the stack is now unbounded.
  1919.           (regcomp): Removed REG_ENESTING case, as the stack is now unbounded.
  1920.           (regerror): Removed REG_ENESTING case, as the stack is now unbounded.
  1921.           
  1922.         * regex.c (MAX_STACK_SIZE): Deleted because don't need upper
  1923.           bound on array indexed with an unsigned number.
  1924.  
  1925. Sun Feb 17 15:50:24 1991  Kathy Hargreaves  (kathy at hayley)
  1926.  
  1927.         * regex.h: Changed and added some comments.
  1928.         
  1929.         * regex.c (init_syntax_once): Made `_' a word character.
  1930.           (re_compile_pattern): Added a comment.
  1931.           (re_match_2): Redid header comment.
  1932.           (regexec): With header comment about PMATCH, corrected and
  1933.           removed details found regex.h, adding a reference.
  1934.  
  1935. Fri Feb 15 09:21:31 1991  Kathy Hargreaves  (kathy at hayley)
  1936.  
  1937.         * regex.c (DO_RANGE): Removed argument parentheses.
  1938.           Now get untranslated range start and end characters and set
  1939.           list bits for the translated (if at all) versions of them and
  1940.           all characters between them.
  1941.           (re_match_2): Now use regs->num_regs instead of num_regs_wanted
  1942.           wherever possible.
  1943.           (regcomp): Now build case-fold translate table using isupper
  1944.           and tolower facilities so will work on foreign language characters.
  1945.  
  1946. Sat Feb  9 16:40:03 1991  Kathy Hargreaves  (kathy at hayley)
  1947.  
  1948.         * regex.h (RE_HAT_LISTS_NOT_NEWLINE): Changed syntax bit name 
  1949.           from RE_LISTS_NOT_NEWLINE as it only affects nonmatching lists.
  1950.           Changed all references to the match-beginning-of-string
  1951.           operator to match-beginning-of-line operator, as this is what
  1952.           it does.
  1953.           (RE_NO_CONSEC_REPEATS): Added this syntax bit.
  1954.           (RE_SYNTAX_POSIX_BASIC): Added above bit to this.
  1955.           (REG_PREMATURE_END): Changed name to REG_EEND.
  1956.           (REG_EXCESS_NESTING): Changed name to REG_ENESTING.
  1957.           (REG_TOO_BIG): Changed name to REG_ESIZE.
  1958.           (REG_INVALID_PREV_RE): Deleted this return POSIX value.
  1959.           Added and changed some comments.
  1960.           
  1961.         * regex.c (re_compile_pattern): Now sets the pattern buffer's 
  1962.           `return_default_num_regs' field.
  1963.           (typedef struct stack_element, stack_type, INIT_STACK_SIZE,
  1964.           MAX_STACK_SIZE, STACK_EMPTY, STACK_FULL): Added for regex_compile.
  1965.           (INIT_BUF_SIZE): Changed value from 28 to 32.
  1966.           (BUF_PUSH): Changed name from BUFPUSH.
  1967.           (MAX_BUF_SIZE): Added so could use in many places.
  1968.           (IS_CHAR_CLASS_STRING): Replaced is_char_class with this.
  1969.           (regex_compile): Added a stack which could grow dynamically
  1970.           and which has struct elements.
  1971.           Go back to initializing `zero_times_ok' and `many_time_ok' to
  1972.           0 and |=ing them inside the loop.
  1973.           Now disallow consecutive repetition operators if the syntax
  1974.           bit RE_NO_CONSEC_REPEATS is set.
  1975.           Now detect trailing backslash when the compiler is expecting a
  1976.           `?' or a `+'.
  1977.           Changed calls to GET_BUFFER_SPACE which asked for 6 to ask for
  1978.           3, as that's all they needed.
  1979.           Now check for trailing backslash inside lists.
  1980.           Now disallow an empty alternative right before an end-of-line
  1981.           operator. 
  1982.           Now get buffer space before leaving space for a fixup jump.
  1983.           Now check if at pattern end when at open-interval operator.
  1984.           Added some comments.
  1985.           Now check if non-interval repetition operators follow an
  1986.           interval one if the syntax bit RE_NO_CONSEC_REPEATS is set.
  1987.           Now only check if what precedes an interval repetition
  1988.           operator isn't a regular expression which matches one
  1989.           character if the syntax bit RE_NO_CONSEC_REPEATS is set.
  1990.           Now return "Unmatched [ or [^" instead of "Unmatched [".
  1991.           (is_in_stack): Added to check if a given register number is in
  1992.           the stack.
  1993.           (re_match_2): If initial variable allocations fail, return -2,
  1994.           instead of -1.
  1995.           Now set reg's `num_regs' field when allocating regs.
  1996.           Now before allocating them, free regs->start and end if they
  1997.           aren't NULL and return -2 if either allocation fails.
  1998.           Now use regs->num_regs instead of num_regs_wanted to control
  1999.           regs loops. 
  2000.           Now increment past the newline when matching it with an
  2001.           end-of-line operator.
  2002.           (recomp): Added to the header comment.
  2003.           Now return REG_ESUBREG if regex_compile returns "Unmatched [
  2004.           or [^" instead of doing so if it returns "Unmatched [".
  2005.           Now return REG_BADRPT if in addition to returning "Missing
  2006.           preceding regular expression", regex_compile returns "Invalid
  2007.           preceding regular expression".
  2008.           Now return new return value names (see regex.h changes).
  2009.           (regexec): Added to header comment.
  2010.           Initialize regs structure.
  2011.           Now match whole string.
  2012.           Now always free regs.start and regs.end instead of just when
  2013.           the string matched.
  2014.           (regerror): Now return "Regex error: Unmatched [ or [^.\n"
  2015.           instead of "Regex error: Unmatched [.\n".
  2016.           Now return "Regex error: Preceding regular expression either
  2017.           missing or not simple.\n" instead of "Regex error: Missing
  2018.           preceding regular expression.\n".
  2019.           Removed REG_INVALID_PREV_RE case (it got subsumed into the
  2020.           REG_BADRPT case).
  2021.           
  2022. Thu Jan 17 09:52:35 1991  Kathy Hargreaves  (kathy at hayley)
  2023.  
  2024.         * regex.h: Changed a comment.
  2025.         
  2026.         * regex.c: Changed and added large header comments.  
  2027.           (re_compile_pattern): Now if detect that `laststart' for an
  2028.           interval points to a byte code for a regular expression which
  2029.           matches more than one character, make it an internal error.
  2030.           (regerror): Return error message, don't print it.
  2031.  
  2032. Tue Jan 15 15:32:49 1991  Kathy Hargreaves  (kathy at hayley)
  2033.  
  2034.         * regex.h (regcomp return codes): Added GNU ones.
  2035.           Updated some comments.
  2036.           
  2037.         * regex.c (DO_RANGE): Changed `obscure_syntax' to `syntax'.
  2038.           (regex_compile): Added `following_left_brace' to keep track of
  2039.           where pseudo interval following a valid interval starts.
  2040.           Changed some instances that returned "Invalid regular
  2041.           expression" to instead return error strings coinciding with
  2042.           POSIX error codes.
  2043.           Changed some comments.
  2044.           Now consider only things between `[:' and `:]' to be possible
  2045.           character class names.
  2046.           Now a character class expression can't end a pattern; at
  2047.           least a `]' must close the list.
  2048.           Now if the syntax bit RE_NO_BK_CURLY_BRACES is set, then a
  2049.           valid interval must be followed by yet another to get an error
  2050.           for preceding an interval (in this case, the second one) with
  2051.           a regular expression that matches more than one character.
  2052.           Now if what follows a valid interval begins with a open
  2053.           interval operator but doesn't begin a valid interval, then set
  2054.           following_left_bracket to it, put it in C and go to
  2055.           normal_char label.
  2056.           Added some comments.
  2057.           Return "Invalid character class name" instead of "Invalid
  2058.           character class".
  2059.           (regerror): Return messages for all POSIX error codes except
  2060.           REG_ECOLLATE and REG_NEWLINE, along with all GNU error codes.
  2061.           Added `break's after all cases.
  2062.           (main): Call re_set_syntax instead of setting `obscure_syntax'
  2063.           directly. 
  2064.           
  2065. Sat Jan 12 13:37:59 1991  Kathy Hargreaves  (kathy at hayley)
  2066.  
  2067.         * regex.h (Copyright): Updated date.
  2068.           (#include <sys/types.h>): Include unconditionally.
  2069.           (RE_CANNOT_MATCH_NEWLINE): Deleted this syntax bit.
  2070.           (RE_SYNTAX_POSIX_BASIC, RE_SYNTAX_POSIX_EXTENDED): Removed
  2071.           setting the RE_ANCHOR_NOT_NEWLINE syntax bit from these.
  2072.           Changed and added some comments.
  2073.           (struct re_pattern_buffer):  Changed some flags from chars to bits.
  2074.           Added field `syntax'; holds which syntax pattern was compiled with.
  2075.           Added bit flag `return_default_num_regs'.
  2076.           (externs for GNU and Berkeley UNIX routines): Added `const's to 
  2077.           parameter types to be compatible with POSIX.
  2078.           (#define const): Added to support old C compilers.
  2079.           
  2080.         * regex.c (Copyright): Updated date.
  2081.           (enum regexpcode): Deleted `newline'.
  2082.           (regex_compile): Renamed re_compile_pattern to this, added a
  2083.           syntax parameter so it can set the pattern buffer's `syntax'
  2084.           field.
  2085.           Made `pattern', and `size' `const's so could pass to POSIX
  2086.           interface routines; also made `const' whatever interval
  2087.           variables had to be to make this work.
  2088.           Changed references to `obscure_syntax' to new parameter `syntax'.
  2089.           Deleted putting `newline' in buffer when see `\n'.
  2090.           Consider invalid character classes which have nothing wrong
  2091.           except the character class name; if so, return character-class error.
  2092.           (is_char_class): Added routine for regex_compile.
  2093.           (re_compile_pattern): added a new one which calls
  2094.           regex_compile with `obscure_syntax' as the actual parameter
  2095.           for the formal `syntax'. 
  2096.           Gave this the old routine's header comments.
  2097.           Made `pattern', and `size' `const's so could use POSIX interface
  2098.           routine parameters.
  2099.           (re_search, re_search_2, re_match, re_match_2): Changed
  2100.           `pbufp' to `bufp'.
  2101.           (re_search_2, re_match_2): Changed `mstop' to `stop'.
  2102.           (re_search, re_search_2): Made all parameters except `regs'
  2103.           `const's so could use POSIX interface routines parameters.
  2104.           (re_search_2): Added private copies of `const' parameters so
  2105.           could change their values.
  2106.           (re_match_2): Made all parameters except `regs' `const's so
  2107.           could use POSIX interface routines parameters.
  2108.           Changed `size1' and `size2' parameters to `size1_arg' and
  2109.           `size2_arg' and so could change; added local `size1' and
  2110.           `size2' and set to these.
  2111.           Added some comments.
  2112.           Deleted `newline' case.
  2113.           `begline' can also possibly match if `d' contains a newline;
  2114.           if it does, we have to increment d to point past the newline.
  2115.           Replaced references to `obscure_syntax' with `bufp->syntax'.
  2116.           (re_comp, re_exec): Made parameter `s' a `const' so could use POSIX
  2117.           interface routines parameters.
  2118.           Now call regex_compile, passing `obscure_syntax' via the
  2119.           `syntax' parameter. 
  2120.           (re_exec): Made local `len' a `const' so could pass to re_search.
  2121.           (regcomp): Added header comment.
  2122.           Added local `syntax' to set and pass to regex_compile rather
  2123.           than setting global `obscure_syntax' and passing it.
  2124.           Call regex_compile with its `syntax' parameter rather than
  2125.           re_compile_pattern.
  2126.           Return REG_ECTYPE if character-class error.
  2127.           (regexec): Don't initialize `regs' to anything.
  2128.           Made `private_preg' a nonpointer so could set to what the
  2129.           constant `preg' points.
  2130.           Initialize `private_preg's `return_default_num_regs' field to
  2131.           zero because want to return `nmatch' registers, not however
  2132.           many there are subexpressions in the pattern.
  2133.           Also test if `nmatch' > 0 to see if should pass re_match `regs'.
  2134.  
  2135. Tue Jan  8 15:57:17 1991  Kathy Hargreaves  (kathy at hayley)
  2136.  
  2137.         * regex.h (struct re_pattern_buffer): Reworded comment.
  2138.         
  2139.         * regex.c (EXTEND_BUFFER): Also reset beg_interval.
  2140.           (re_search_2): Return val if val = -2.
  2141.           (NUM_REG_ITEMS): Listed items in comment.
  2142.           (NUM_OTHER_ITEMS): Defined this for using in > 1 definition.
  2143.           (MAX_NUM_FAILURE_ITEMS): Replaced `+ 2' with NUM_OTHER_ITEMS.
  2144.           (NUM_FAILURE_ITEMS): As with definition above and added to
  2145.           comment. 
  2146.           (PUSH_FAILURE_POINT): Replaced `* 2's with `<< 1's.
  2147.           (re_match_2): Test with equality with 1 to see pbufp->bol and
  2148.           pbufp->eol are set.
  2149.           
  2150. Fri Jan  4 15:07:22 1991  Kathy Hargreaves  (kathy at hayley)
  2151.  
  2152.         * regex.h (struct re_pattern_buffer): Reordered some fields.
  2153.           Updated some comments.
  2154.           Added not_bol and not_eol fields.
  2155.           (extern regcomp, regexec, regerror): Added return types.
  2156.           (extern regfree): Added `extern'.
  2157.           
  2158.         * regex.c (min): Deleted unused macro.
  2159.           (re_match_2): Compacted some code.
  2160.           Removed call to macro `min' from `for' loop.
  2161.           Fixed so unused registers get filled with -1's.
  2162.           Fail if the pattern buffer's `not_bol' field is set and
  2163.           encounter a `begline'.  
  2164.           Fail if the pattern buffer's `not_eol' field is set and
  2165.           encounter a `endline'.  
  2166.           Deleted redundant check for empty stack in fail case.
  2167.           Don't free pattern buffer's components in re_comp.
  2168.           (regexec): Initialize variable regs.
  2169.           Added `private_preg' pattern buffer so could set `not_bol' and
  2170.           `not_eol' fields and hand to re_match.
  2171.           Deleted naive attempt to detect anchors.
  2172.           Set private pattern buffer's `not_bol' and `not_eol' fields
  2173.           according to eflags value.
  2174.           `nmatch' must also be > 0 for us to bother allocating
  2175.           registers to send to re_match and filling pmatch
  2176.           with their results after the call to re_match.
  2177.           Send private pattern buffer instead of argument to re_match.
  2178.           If use the registers, always free them and then set them to NULL.
  2179.           (regerror): Added this Posix routine.
  2180.           (regfree): Added this Posix routine.
  2181.           
  2182. Tue Jan  1 15:02:45 1991  Kathy Hargreaves  (kathy at hayley)
  2183.  
  2184.         * regex.h (RE_NREGS): Deleted this definition, as now the user
  2185.           can choose how many registers to have.  
  2186.           (REG_NOTBOL, REG_NOTEOL): Defined these Posix eflag bits.  
  2187.           (REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE,
  2188.           REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE,
  2189.           REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_ENEWLINE):
  2190.           Defined these return values for Posix's regcomp and regexec.
  2191.           Updated some comments.
  2192.           (struct re_pattern_buffer): Now typedef this as regex_t
  2193.           instead of the other way around.
  2194.           (struct re_registers): Added num_regs field.  Made start and
  2195.           end fields pointers to char instead of fixed size arrays.
  2196.           (regmatch_t): Added this Posix register type.
  2197.           (regcomp, regexec, regerror, regfree): Added externs for these
  2198.           Posix routines.
  2199.           
  2200.         * regex.c (enum boolean): Typedefed this.
  2201.           (re_pattern_buffer): Reformatted some comments.
  2202.           (re_compile_pattern): Updated some comments.
  2203.           Always push start_memory and its attendant number whenever
  2204.           encounter a group, not just when its number is less than the
  2205.           previous maximum number of registers; same for stop_memory.
  2206.           Get 4 bytes of buffer space instead of 2 when pushing a
  2207.           set_number_at.
  2208.           (can_match_nothing): Added this to elaborate on and replace
  2209.           code in re_match_2.
  2210.           (reg_info_type): Made can_match_nothing field a bit instead of int.
  2211.           (MIN): Added for re_match_2.
  2212.           (re_match_2 macros): Changed all `for' loops which used
  2213.           RE_NREGS to now use num_internal_regs as upper bounds.
  2214.           (MAX_NUM_FAILURE_ITEMS): Use num_internal_regs instead of RE_NREGS.
  2215.           (POP_FAILURE_POINT): Added check for empty stack.
  2216.           (FREE_VARIABLES): Added this to free (and set to NULL)
  2217.           variables allocated in re_match_2.
  2218.           (re_match_2): Rearranged parameters to be in order.
  2219.           Added variables num_regs_wanted (how many registers the user wants)
  2220.           and num_internal_regs (how many groups there are).
  2221.           Allocated initial_stack, regstart, regend, old_regstart,
  2222.           old_regend, reginfo, best_regstart, and best_regend---all
  2223.           which used to be fixed size arrays.  Free them all and return
  2224.           -1 if any fail.
  2225.           Free above variables if starting position pos isn't valid.
  2226.           Changed all `for' loops which used RE_NREGS to now use
  2227.           num_internal_regs as upper bounds---except for the loops which
  2228.           fill regs; then use num_regs_wanted.
  2229.           Allocate regs if the user has passed it and wants more than 0
  2230.           registers filled.
  2231.           Set regs->start[i] and regs->end[i] to -1 if either
  2232.           regstart[i] or regend[i] equals -1, not just the first.
  2233.           Free allocated variables before returning.
  2234.           Updated some comments.
  2235.           (regcomp): Return REG_ESPACE, REG_BADPAT, REG_EPAREN when
  2236.           appropriate.
  2237.           Free translate array.
  2238.           (regexec): Added this Posix interface routine.
  2239.           
  2240. Mon Dec 24 14:21:13 1990  Kathy Hargreaves  (kathy at hayley)
  2241.         
  2242.         * regex.h: If _POSIX_SOURCE is defined then #include <sys/types.h>.
  2243.           Added syntax bit RE_CANNOT_MATCH_NEWLINE.
  2244.           Defined Posix cflags: REG_EXTENDED, REG_NEWLINE, REG_ICASE, and
  2245.             REG_NOSUB.
  2246.           Added fields re_nsub and no_sub to struct re_pattern_buffer.
  2247.           Typedefed regex_t to be `struct re_pattern_buffer'.
  2248.         
  2249.         * regex.c (CHAR_SET_SIZE): Defined this to be 256 and replaced
  2250.           incidences of this value with this constant.
  2251.           (re_compile_pattern): Added switch case for `\n' and put
  2252.           `newline' into the pattern buffer when encounter this.
  2253.           Increment the pattern_buffer's `re_nsub' field whenever open a
  2254.           group. 
  2255.           (re_match_2): Match a newline with `newline'---provided the
  2256.           syntax bit RE_CANNOT_MATCH_NEWLINE isn't set.
  2257.           (regcomp): Added this Posix interface routine.
  2258.           (enum test_type): Added interface_test tag.
  2259.           (main): Added Posix interface test.
  2260.           
  2261. Tue Dec 18 12:58:12 1990  Kathy Hargreaves  (kathy at hayley)
  2262.  
  2263.         * regex.h (struct re_pattern_buffer): reformatted so would fit
  2264.           in texinfo documentation.
  2265.           
  2266. Thu Nov 29 15:49:16 1990  Kathy Hargreaves  (kathy at hayley)
  2267.  
  2268.         * regex.h (RE_NO_EMPTY_ALTS): Added this bit.
  2269.           (RE_SYNTAX_POSIX_EXTENDED): Added above bit.
  2270.         
  2271.         * regex.c (re_compile_pattern): Disallow empty alternatives only
  2272.           when RE_NO_EMPTY_ALTS is set, not when RE_CONTEXTUAL_INVALID_OPS is.
  2273.           Changed RE_NO_BK_CURLY_BRACES to RE_NO_BK_PARENS when testing
  2274.           for empty groups at label handle_open.
  2275.           At label handle_bar: disallow empty alternatives if RE_NO_EMPTY_ALTS
  2276.           is set.
  2277.           Rewrote some comments.
  2278.  
  2279.           (re_compile_fastmap): cleaned up code.
  2280.  
  2281.           (re_search_2): Rewrote comment.
  2282.  
  2283.           (struct register_info): Added field `inner_groups'; it records
  2284.           which groups are inside of the current one.  
  2285.           Added field can_match_nothing; it's set if the current group
  2286.           can match nothing.  
  2287.           Added field ever_match_something; it's set if current group
  2288.           ever matched something.
  2289.  
  2290.           (INNER_GROUPS): Added macro to access inner_groups field of
  2291.           struct register_info.
  2292.  
  2293.           (CAN_MATCH_NOTHING): Added macro to access can_match_nothing
  2294.           field of struct register_info.
  2295.  
  2296.           (EVER_MATCHED_SOMETHING): Added macro to access
  2297.           ever_matched_something field of struct register_info.
  2298.  
  2299.           (NOTE_INNER_GROUP): Defined macro to record that a given group
  2300.           is inside of all currently active groups.
  2301.           
  2302.           (re_match_2): Added variables *p1 and mcnt2 (multipurpose).
  2303.           Added old_regstart and old_regend arrays to hold previous
  2304.           register values if they need be restored.
  2305.           Initialize added fields and variables.
  2306.           case start_memory: Find out if the group can match nothing.
  2307.             Save previous register values in old_restart and old_regend.
  2308.             Record that current group is inside of all currently active
  2309.             groups. 
  2310.             If the group is inside a loop and it ever matched anything,
  2311.             restore its registers to values before the last failed match.
  2312.             Restore the registers for the inner groups, too.
  2313.           case duplicate: Can back reference to a group that never
  2314.             matched if it can match nothing.
  2315.  
  2316. Thu Nov 29 11:12:54 1990  Karl Berry  (karl at hayley)
  2317.  
  2318.         * regex.c (bcopy, ...): define these if either _POSIX_SOURCE or
  2319.           STDC_HEADERS is defined; same for including <stdlib.h>.
  2320.  
  2321. Sat Oct  6 16:04:55 1990  Kathy Hargreaves  (kathy at hayley)
  2322.  
  2323.         * regex.h (struct re_pattern_buffer): Changed field comments.
  2324.         
  2325.         * regex.c (re_compile_pattern): Allow a `$' to precede an
  2326.         alternation operator (`|' or `\|').
  2327.         Disallow `^' and/or `$' in empty groups if the syntax bit
  2328.         RE_NO_EMPTY_GROUPS is set.
  2329.         Wait until have parsed a valid `\{...\}' interval expression
  2330.         before testing RE_CONTEXTUAL_INVALID_OPS to see if it's
  2331.         invalidated by that.
  2332.         Don't use RE_NO_BK_CURLY_BRACES to test whether or not a validly
  2333.         parsed interval expression is invalid if it has no preceding re;
  2334.         rather, use RE_CONTEXTUAL_INVALID_OPS.
  2335.         If an interval parses, but there is no preceding regular
  2336.         expression, yet the syntax bit RE_CONTEXTUAL_INDEP_OPS is set,
  2337.         then that interval can match the empty regular expression; if
  2338.         the bit isn't set, then the characters in the interval
  2339.         expression are parsed as themselves (sans the backslashes).
  2340.         In unfetch_interval case: Moved PATFETCH to above the test for
  2341.         RE_NO_BK_CURLY_BRACES being set, which would force a goto
  2342.         normal_backslash; the code at both normal_backsl and normal_char
  2343.         expect a character in `c.'
  2344.         
  2345. Sun Sep 30 11:13:48 1990  Kathy Hargreaves  (kathy at hayley)
  2346.  
  2347.         * regex.h: Changed some comments to use the terms used in the
  2348.         documentation. 
  2349.         (RE_CONTEXTUAL_INDEP_OPS): Changed name from `RE_CONTEXT_INDEP_OPS'.
  2350.         (RE_LISTS_NOT_NEWLINE): Changed name from `RE_HAT_NOT_NEWLINE.'
  2351.         (RE_ANCHOR_NOT_NEWLINE): Added this syntax bit.
  2352.         (RE_NO_EMPTY_GROUPS): Added this syntax bit.
  2353.         (RE_NO_HYPHEN_RANGE_END): Deleted this syntax bit.
  2354.         (RE_SYNTAX_...): Reformatted.
  2355.         (RE_SYNTAX_POSIX_BASIC, RE_SYNTAX_EXTENDED): Added syntax bits 
  2356.         RE_ANCHOR_NOT_NEWLINE and RE_NO_EMPTY_GROUPS, and deleted
  2357.         RE_NO_HYPHEN_RANGE_END.
  2358.         (RE_SYNTAX_POSIX_EXTENDED): Added syntax bit RE_DOT_NOT_NULL.
  2359.  
  2360.         * regex.c (bcopy, bcmp, bzero): Define if _POSIX_SOURCE is defined.
  2361.         (_POSIX_SOURCE): ifdef this, #include <stdlib.h>
  2362.         (#ifdef emacs): Changed comment of the #endif for the its #else
  2363.         clause to be `not emacs', not `emacs.'
  2364.         (no_pop_jump): Changed name from `jump'.
  2365.         (pop_failure_jump): Changed name from `finalize_jump.'
  2366.         (maybe_pop_failure_jump): Changed name from `maybe_finalize_jump'.
  2367.         (no_pop_jump_n): Changed name from `jump_n.'
  2368.         (EXTEND_BUFFER): Use shift instead of multiplication to double
  2369.         buf->allocated.
  2370.         (DO_RANGE, recompile_pattern): Added macro to set the list bits
  2371.         for a range.
  2372.         (re_compile_pattern): Fixed grammar problems in some comments.
  2373.         Checked that RE_NO_BK_VBAR is set to make `$' valid before a `|'
  2374.         and not set to make it valid before a `\|'.
  2375.         Checked that RE_NO_BK_PARENS is set to make `$' valid before a ')' 
  2376.         and not set to make it valid before a `\)'.
  2377.         Disallow ranges starting with `-', unless the range is the
  2378.         first item in a list, rather than disallowing ranges which end
  2379.         with `-'.
  2380.         Disallow empty groups if the syntax bit RE_NO_EMPTY_GROUPS is set.
  2381.         Disallow nothing preceding `{' and `\{' if they represent the
  2382.         open-interval operator and RE_CONTEXTUAL_INVALID_OPS is set.
  2383.         (register_info_type): typedef-ed this using `struct register_info.'
  2384.         (SET_REGS_MATCHED): Compacted the code.
  2385.         (re_match_2): Made it fail if back reference a group which we've
  2386.         never matched.
  2387.         Made `^' not match a newline if the syntax bit
  2388.         RE_ANCHOR_NOT_NEWLINE is set.
  2389.         (really_fail): Added this label so could force a final fail that
  2390.         would not try to use the failure stack to recover.
  2391.         
  2392. Sat Aug 25 14:23:01 1990  Kathy Hargreaves  (kathy at hayley)
  2393.  
  2394.         * regex.h (RE_CONTEXTUAL_OPS): Changed name from RE_CONTEXT_OPS.
  2395.           (global): Rewrote comments and rebroke some syntax #define lines.
  2396.  
  2397.         * regex.c (isgraph): Added definition for sequents.  
  2398.         (global): Now refer to character set lists as ``lists.''
  2399.         Rewrote comments containing ``\('' or ``\)'' to now refer to
  2400.         ``groups.''
  2401.         (RE_CONTEXTUAL_OPS): Changed name from RE_CONTEXT_OPS.
  2402.         
  2403.         (re_compile_pattern): Expanded header comment.
  2404.  
  2405. Sun Jul 15 14:50:25 1990  Kathy Hargreaves  (kathy at hayley)
  2406.  
  2407.         * regex.h (RE_CONTEX_INDEP_OPS): the comment's sense got turned
  2408.         around when we changed how it read; changed it to be correct.
  2409.  
  2410. Sat Jul 14 16:38:06 1990  Kathy Hargreaves  (kathy at hayley)
  2411.  
  2412.         * regex.h (RE_NO_EMPTY_BK_REF): changed name to 
  2413.         RE_NO_MISSING_BK_REF, as this describes it better.
  2414.         
  2415.         * regex.c (re_compile_pattern): changed RE_NO_EMPTY_BK_REF
  2416.         to RE_NO_MISSING_BK_REF, as above.
  2417.         
  2418. Thu Jul 12 11:45:05 1990  Kathy Hargreaves  (kathy at hayley)
  2419.  
  2420.         * regex.h (RE_NO_EMPTY_BRACKETS): removed this syntax bit, as
  2421.         bracket expressions should *never* be empty regardless of the
  2422.         syntax.  Removes this bit from RE_SYNTAX_POSIX_BASIC and
  2423.         RE_SYNTAX_POSIX_EXTENDED. 
  2424.         
  2425.         * regex.c (SET_LIST_BIT): in the comment, now refer to character
  2426.         sets as (non)matching sets, as bracket expressions can now match
  2427.         other things in addition to characters.
  2428.         (re_compile_pattern): refer to groups as such instead of `\(...\)'
  2429.         or somesuch, because groups can now be enclosed in either plain
  2430.         parens or backslashed ones, depending on the syntax.
  2431.         In the '[' case, added a boolean just_had_a_char_class to detect
  2432.         whether or not a character class begins a range (which is invalid).
  2433.         Restore way of breaking out of a bracket expression to original way.
  2434.         Add way to detect a range if the last thing in a bracket
  2435.         expression was a character class.                
  2436.         Took out check for c != ']' at the end of a character class in
  2437.         the else clause, as it had already been checked in the if part
  2438.         that also checked the validity of the string.
  2439.         Set or clear just_had_a_char_class as appropriate.
  2440.         Added some comments.  Changed references to character sets to
  2441.         ``(non)matching lists.''
  2442.         
  2443. Sun Jul  1 12:11:29 1990  Karl Berry  (karl at hayley)
  2444.  
  2445.         * regex.h (BYTEWIDTH): moved back to regex.c.
  2446.  
  2447.         * regex.h (re_compile_fastmap): removed declaration; this
  2448.         shouldn't be advertised.
  2449.         
  2450. Mon May 28 15:27:53 1990  Kathy Hargreaves  (kathy at hayley)
  2451.  
  2452.         * regex.c (ifndef Sword): Made comments more specific.
  2453.         (global): include <stdio.h> so can write fatal messages on
  2454.         standard error.  Replaced calls to assert with fprintfs to
  2455.         stderr and exit (1)'s.
  2456.         (PREFETCH): Reformatted to make more readable.
  2457.         (AT_STRINGS_BEG): Defined to test if we're at the beginning of
  2458.         the virtual concatenation of string1 and string2.
  2459.         (AT_STRINGS_END): Defined to test if at the end of the virtual
  2460.         concatenation of string1 and string2.
  2461.         (AT_WORD_BOUNDARY): Defined to test if are at a word boundary.
  2462.         (IS_A_LETTER(d)): Defined to test if the contents of the pointer D
  2463.         is a letter.
  2464.         (re_match_2): Rewrote the wordbound, notwordbound, wordbeg, wordend,
  2465.         begbuf, and endbuf cases in terms of the above four new macros.
  2466.         Called SET_REGS_MATCHED in the matchsyntax, matchnotsyntax,
  2467.         wordchar, and notwordchar cases.
  2468.  
  2469. Mon May 14 14:49:13 1990  Kathy Hargreaves  (kathy at hayley)
  2470.  
  2471.     * regex.c (re_search_2): Fixed RANGE to not ever take STARTPOS
  2472.         outside of virtual concatenation of STRING1 and STRING2.
  2473.         Updated header comment as to this.
  2474.     (re_match_2): Clarified comment about MSTOP in header.
  2475.  
  2476. Sat May 12 15:39:00 1990  Kathy Hargreaves  (kathy at hayley)
  2477.  
  2478.     * regex.c (re_search_2): Checked for out-of-range STARTPOS.
  2479.         Added comments.
  2480.     When searching backwards, not only get the character with which
  2481.         to compare to the fastmap from string2 if the starting position
  2482.         >= size1, but also if size1 is zero; this is so won't get a
  2483.         segmentation fault if string1 is null.
  2484.         Reformatted code at label advance.
  2485.  
  2486. Thu Apr 12 20:26:21 1990  Kathy Hargreaves  (kathy at hayley)
  2487.  
  2488.     * regex.h: Added #pragma once and #ifdef...endif __REGEXP_LIBRARY.
  2489.         (RE_EXACTN_VALUE): Added for search.c to use.
  2490.         Reworded some comments.
  2491.         
  2492.         regex.c: Punctuated some comments correctly.
  2493.         (NULL): Removed this.
  2494.         (RE_EXACTN_VALUE): Added for search.c to use.
  2495.     (<ctype.h>): Moved this include to top of file.
  2496.     (<assert.h>): Added this include.
  2497.         (struct regexpcode): Assigned 0 to unused and 1 to exactn
  2498.         because of RE_EXACTN_VALUE. 
  2499.         Added comment.
  2500.         (various macros): Lined up backslashes near end of line.
  2501.     (insert_jump): Cleaned up the header comment.
  2502.         (re_search): Corrected the header comment.
  2503.         (re_search_2): Cleaned up and completed the header comment.
  2504.         (re_max_failures): Updated comment.
  2505.         (struct register_info): Constructed as bits so as to save space
  2506.         on the stack when pushing register information.
  2507.         (IS_ACTIVE): Macro for struct register_info.
  2508.         (MATCHED_SOMETHING): Macro for struct register_info.
  2509.         (NUM_REG_ITEMS): How many register information items for each
  2510.         register we have to push on the stack at each failure.
  2511.         (MAX_NUM_FAILURE_ITEMS): If push all the registers on failure,
  2512.         this is how many items we push on the stack.
  2513.     (PUSH_FAILURE_POINT): Now pushes whether or not the register is
  2514.         currently active, and whether or not it matched    something.
  2515.     Checks that there's enough space allocated to accomodate all the
  2516.         items we currently want to push. (Before, a test for an empty
  2517.         stack sufficed because we always pushed and popped the same
  2518.         number of items).
  2519.         Replaced ``2'' with MAX_NUM_FAILURE_POINTS when ``2'' refers
  2520.         to how many things get pushed on the stack each time.
  2521.         When copy the stack into the newly allocated storage, now only copy
  2522.         the area in use.
  2523.         Clarified comment.
  2524.         (POP_FAILURE_POINT): Defined to use in places where put number
  2525.         of registers on the stack into a variable before using it to
  2526.         decrement the stack, so as to not confuse the compiler.
  2527.         (IS_IN_FIRST_STRING): Defined to check if a pointer points into
  2528.         the first string.
  2529.         (SET_REGS_MATCHED): Changed to use the struct register_info
  2530.         bits; also set the matched-something bit to false if the
  2531.         register isn't currently active. (This is a redundant setting.)
  2532.         (re_match_2): Cleaned up and completed the header comment.
  2533.         Updated the failure stack comment.
  2534.         Replaced the ``2'' with MAX_NUM_FAILURE_ITEMS in the static
  2535.         allocation of initial_stack, because now more than two (now up
  2536.         to MAX_FAILURE_ITEMS) items get pushed on the failure stack each
  2537.         time.
  2538.         Ditto for stackb.
  2539.         Trashed restart_seg1, regend_seg1, best_regstart_seg1, and
  2540.         best_regend_seg1 because they could have erroneous information
  2541.         in them, such as when matching ``a'' (in string1) and ``ab'' (in
  2542.         string2) with ``(a)*ab''; before using IS_IN_FIRST_STRING to see
  2543.         whether or not the register starts or ends in string1,
  2544.         regstart[1] pointed past the end of string1, yet regstart_seg1
  2545.         was 0!
  2546.         Added variable reg_info of type struct register_info to keep
  2547.         track of currently active registers and whether or not they
  2548.     currently match anything.
  2549.         Commented best_regs_set.
  2550.         Trashed reg_active and reg_matched_something and put the
  2551.         information they held into reg_info; saves space on the stack.
  2552.         Replaced NULL with '\000'.
  2553.         In begline case, compacted the code.
  2554.         Used assert to exit if had an internal error.
  2555.     In begbuf case, because now force the string we're working on
  2556.         into string2 if there aren't two strings, now allow d == string2
  2557.         if there is no string1 (and the check for that is size1 == 0!);
  2558.         also now succeeds if there aren't any strings at all.
  2559.     (main, ifdef canned): Put test type into a variable so could
  2560.         change it while debugging.
  2561.         
  2562. Sat Mar 24 12:24:13 1990  Kathy Hargreaves  (kathy at hayley)
  2563.  
  2564.     * regex.c (GET_UNSIGNED_NUMBER): Deleted references to num_fetches.
  2565.         (re_compile_pattern): Deleted num_fetches because could keep
  2566.         track of the number of fetches done by saving a pointer into the
  2567.         pattern. 
  2568.     Added variable beg_interval to be used as a pointer, as above.
  2569.         Assert that beg_interval points to something when it's used as above.
  2570.         Initialize succeed_n's to lower_bound because re_compile_fastmap
  2571.         needs to know it.
  2572.         (re_compile_fastmap): Deleted unnecessary variable is_a_jump_n.
  2573.         Added comment.
  2574.         (re_match_2): Put number of registers on the stack into a
  2575.         variable before using it to decrement the stack, so as to not
  2576.         confuse the compiler.
  2577.         Updated comments.
  2578.         Used error routine instead of printf and exit.
  2579.         In exactn case, restored longer code from ``original'' regex.c
  2580.         which doesn't test translate inside a loop.
  2581.  
  2582.     * regex.h: Moved #define NULL and the enum regexpcode definition
  2583.         and to regex.c.  Changed some comments.
  2584.         
  2585.         regex.c (global): Updated comments about compiling and for the
  2586.         re_compile_pattern jump routines.
  2587.         Added #define NULL and the enum regexpcode definition (from
  2588.         regex.h).
  2589.         (enum regexpcode): Added set_number_at to reset the n's of
  2590.         succeed_n's and jump_n's.
  2591.         (re_set_syntax): Updated its comment.
  2592.     (re_compile_pattern): Moved its heading comment to after its macros.
  2593.         Moved its include statement to the top of the file.
  2594.         Commented or added to comments of its macros.
  2595.     In start_memory case: Push laststart value before adding
  2596.         start_memory and its register number to the buffer, as they
  2597.         might not get added.
  2598.     Added code to put a set_number_at before each succeed_n and one
  2599.         after each jump_n; rewrote code in what seemed a more
  2600.         straightforward manner to put all these things in the pattern so
  2601.         the succeed_n's would correctly jump to the set_number_at's of
  2602.         the matching jump_n's, and so the jump_n's would correctly jump
  2603.         to after the set_number_at's of the matching succeed_n's.
  2604.     Initialize succeed_n n's to -1.
  2605.         (insert_op_2): Added this to insert an operation followed by
  2606.         two integers.
  2607.         (re_compile_fastmap): Added set_number_at case.
  2608.         (re_match_2): Moved heading comment to after macros.
  2609.         Added mention of REGS to heading comment.
  2610.         No longer turn a succeed_n with n = 0 into an on_failure_jump,
  2611.         because n needs to be reset each time through a loop.
  2612.         Check to see if a succeed_n's n is set by its set_number_at.
  2613.     Added set_number_at case.
  2614.     Updated some comments.
  2615.     (main): Added another main to run posix tests, which is compiled
  2616.         ifdef both test and canned.  (Old main is still compiled ifdef
  2617.         test only).
  2618.  
  2619. Tue Mar 19 09:22:55 1990 Kathy Hargreaves (kathy at hayley)
  2620.  
  2621.     * regex.[hc]: Change all instances of the word ``legal'' to
  2622.     ``valid'' and all instances of ``illegal'' to ``invalid.''
  2623.  
  2624. Sun Mar  4 12:11:31 1990  Kathy Hargreaves  (kathy at hayley)
  2625.  
  2626.     * regex.h: Added syntax bit RE_NO_EMPTY_RANGES which is set if
  2627.         an ending range point has to collate higher or equal to the
  2628.         starting range point.
  2629.         Added syntax bit RE_NO_HYPHEN_RANGE_END which is set if a hyphen
  2630.         can't be an ending range point.
  2631.         Set to two above bits in RE_SYNTAX_POSIX_BASIC and 
  2632.         RE_SYNTAX_POSIX_EXTENDED.
  2633.         
  2634.         regex.c: (re_compile_pattern): Don't allow empty ranges if the
  2635.         RE_NO_EMPTY_RANGES syntax bit is set.
  2636.         Don't let a hyphen be a range end if the RE_NO_HYPHEN_RANGE_END 
  2637.     syntax bit is set.
  2638.     (ESTACK_PUSH_2): renamed this PUSH_FAILURE_POINT and made it
  2639.         push all the used registers on the stack, as well as the number
  2640.         of the highest numbered register used, and (as before) the two
  2641.         failure points.
  2642.     (re_match_2): Fixed up comments.
  2643.         Added arrays best_regstart[], best_regstart_seg1[], best_regend[], 
  2644.         and best_regend_seg1[] to keep track of the best match so far
  2645.         whenever reach the end of the pattern but not the end of the
  2646.         string, and there are still failure points on the stack with
  2647.         which to backtrack; if so, do the saving and force a fail.
  2648.     If reach the end of the pattern but not the end of the string,
  2649.         but there are no more failure points to try, restore the best
  2650.         match so far, set the registers and return.
  2651.     Compacted some code.
  2652.     In stop_memory case, if the subexpression we've just left is in
  2653.         a loop, push onto the stack the loop's on_failure_jump failure
  2654.         point along with the current pointer into the string (d).
  2655.         In finalize_jump case, in addition to popping the failure
  2656.         points, pop the saved registers.
  2657.     In the fail case, restore the registers, as well as the failure
  2658.         points. 
  2659.  
  2660. Sun Feb 18 15:08:10 1990  Kathy Hargreaves  (kathy at hayley)
  2661.  
  2662.     * regex.c: (global): Defined a macro GET_BUFFER_SPACE which
  2663.     makes sure you have a specified number of buffer bytes
  2664.         allocated. 
  2665.         Redefined the macro BUFPUSH to use this.
  2666.         Added comments.
  2667.         
  2668.         (re_compile_pattern): Call GET_BUFFER_SPACE before storing or
  2669.         inserting any jumps.
  2670.  
  2671.     (re_match_2): Set d to string1 + pos and dend to end_match_1
  2672.         only if string1 isn't null.
  2673.     Force exit from a loop if it's around empty parentheses.
  2674.         In stop_memory case, if found some jumps, increment p2 before
  2675.         extracting address to which to jump. Also, don't need to know
  2676.         how many more times can jump_n.
  2677.     In begline case, d must equal string1 or string2, in that order,
  2678.         only if they are not null.
  2679.         In maybe_finalize_jump case, skip over start_memorys' and
  2680.         stop_memorys' register numbers, too.
  2681.  
  2682. Thu Feb 15 15:53:55 1990  Kathy Hargreaves  (kathy at hayley)
  2683.  
  2684.     * regex.c (BUFPUSH): off by one goof in deciding whether to
  2685.     EXTEND_BUFFER.
  2686.  
  2687. Wed Jan 24 17:07:46 1990  Kathy Hargreaves  (kathy at hayley)
  2688.  
  2689.     * regex.h: Moved definition of NULL to here.
  2690.     Got rid of ``In other words...'' comment.
  2691.     Added to some comments.        
  2692.  
  2693.     regex.c: (re_compile_pattern): Tried to bulletproof some code,
  2694.         i.e., checked if backward references (e.g., p[-1]) were within
  2695.         the range of pattern.
  2696.  
  2697.         (re_compile_fastmap): Fixed a bug in succeed_n part where was
  2698.         getting the amount to jump instead of how many times to jump.
  2699.         
  2700.         (re_search_2): Changed the name of the variable ``total'' to
  2701.         ``total_size.''
  2702.         Condensed some code.
  2703.  
  2704.     (re_match_2): Moved the comment about duplicate from above the
  2705.         start_memory case to above duplicate case.
  2706.         
  2707.         (global): Rewrote some comments.
  2708.         Added commandline arguments to testing.
  2709.         
  2710. Wed Jan 17 11:47:27 1990  Kathy Hargreaves  (kathy at hayley)
  2711.  
  2712.     * regex.c: (global): Defined a macro STORE_NUMBER which stores a
  2713.         number into two contiguous bytes.  Also defined STORE_NUMBER_AND_INCR
  2714.     which does the same thing and then increments the pointer to the
  2715.     storage place to point after the number.
  2716.         Defined a macro EXTRACT_NUMBER which extracts a number from two
  2717.         continguous bytes.  Also defined EXTRACT_NUMBER_AND_INCR which
  2718.         does the same thing and then increments the pointer to the
  2719.         source to point to after where the number was.
  2720.         
  2721. Tue Jan 16 12:09:19 1990  Kathy Hargreaves  (kathy at hayley)
  2722.  
  2723.     * regex.h: Incorporated rms' changes.
  2724.     Defined RE_NO_BK_REFS syntax bit which is set when want to
  2725.         interpret back reference patterns as literals.
  2726.         Defined RE_NO_EMPTY_BRACKETS syntax bit which is set when want
  2727.         empty bracket expressions to be illegal.
  2728.         Defined RE_CONTEXTUAL_ILLEGAL_OPS syntax bit which is set when want
  2729.     it to be illegal for *, +, ? and { to be first in an re or come
  2730.         immediately after a | or a (, and for ^ not to appear in a
  2731.         nonleading position and $ in a nontrailing position (outside of
  2732.         bracket expressions, that is).        
  2733.         Defined RE_LIMITED_OPS syntax bit which is set when want +, ?
  2734.         and | to always be literals instead of ops.
  2735.         Fixed up the Posix syntax.
  2736.         Changed the syntax bit comments from saying, e.g., ``0 means...'' 
  2737.         to ``If this bit is set, it means...''.
  2738.         Changed the syntax bit defines to use shifts instead of integers.
  2739.  
  2740.         * regex.c: (global): Incorporated rms' changes.
  2741.  
  2742.         (re_compile_pattern): Incorporated rms' changes
  2743.         Made it illegal for a $ to appear anywhere but inside a bracket
  2744.         expression or at the end of an re when RE_CONTEXTUAL_ILLEGAL_OPS 
  2745.         is set. Made the same hold for $ except it has to be at the
  2746.         beginning of an re instead of the end. 
  2747.     Made the re "[]" illegal if RE_NO_EMPTY_BRACKETS is set.
  2748.         Made it illegal for | to be first or last in an re, or immediately 
  2749.         follow another | or a (.
  2750.         Added and embellished some comments.
  2751.     Allowed \{ to be interpreted as a literal if RE_NO_BK_CURLY_BRACES 
  2752.         is set.
  2753.         Made it illegal for *, +, ?, and { to appear first in an re, or
  2754.         immediately follow a | or a ( when RE_CONTEXTUAL_ILLEGAL_OPS is set.
  2755.     Made back references interpreted as literals if RE_NO_BK_REFS is set.
  2756.         Made recursive intervals either illegal (if RE_NO_BK_CURLY_BRACES 
  2757.         isn't set) or interpreted as literals (if is set), if RE_INTERVALS
  2758.         is set.
  2759.     Made it treat +, ? and | as literals if RE_LIMITED_OPS is set.
  2760.         Cleaned up some code.        
  2761.         
  2762. Thu Dec 21 15:31:32 1989  Kathy Hargreaves  (kathy at hayley)
  2763.  
  2764.     * regex.c: (global): Moved RE_DUP_MAX to regex.h and made it
  2765.     equal 2^15 - 1 instead of 1000.
  2766.         Defined NULL to be zero.
  2767.         Moved the definition of BYTEWIDTH to regex.h.
  2768.         Made the global variable obscure_syntax nonstatic so the tests in
  2769.         another file could use it.
  2770.         
  2771.         (re_compile_pattern): Defined a maximum length (CHAR_CLASS_MAX_LENGTH) 
  2772.         for character class strings (i.e., what's between the [: and the 
  2773.         :]'s).
  2774.     Defined a macro SET_LIST_BIT(c) which sets the bit for C in a
  2775.         character set list.
  2776.         Took out comments that EXTEND_BUFFER clobbers C.
  2777.         Made the string "^" match itself, if not RE_CONTEXT_IND_OPS.
  2778.     Added character classes to bracket expressions.
  2779.         Change the laststart pointer saved with the start of each
  2780.         subexpression to point to start_memory instead of after the
  2781.         following register number.  This is because the subexpression
  2782.         might be in a loop.
  2783.         Added comments and compacted some code.
  2784.     Made intervals only work if preceded by an re matching a single
  2785.         character or a subexpression.
  2786.         Made back references to nonexistent subexpressions illegal if
  2787.         using POSIX syntax.
  2788.     Made intervals work on the last preceding character of a
  2789.         concatenation of characters, e.g., ab{0,} matches abbb, not abab.
  2790.     Moved macro PREFETCH to outside the routine.
  2791.         
  2792.     (re_compile_fastmap): Added succeed_n to work analogously to
  2793.         on_failure_jump if n is zero and jump_n to work analogously to
  2794.         the other backward jumps.
  2795.         
  2796.         (re_match_2): Defined macro SET_REGS_MATCHED to set which
  2797.         current subexpressions had matches within them.
  2798.         Changed some comments.
  2799.     Added reg_active and reg_matched_something arrays to keep track
  2800.         of in which subexpressions currently have matched something.
  2801.         Defined MATCHING_IN_FIRST_STRING and replaced ``dend == end_match_1'' 
  2802.         with it to make code easier to understand.
  2803.     Fixed so can apply * and intervals to arbitrarily nested
  2804.         subexpressions.  (Lots of previous bugs here.)
  2805.     Changed so won't match a newline if syntax bit RE_DOT_NOT_NULL is set.
  2806.         Made the upcase array nonstatic so the testing file could use it also.
  2807.         
  2808.         (main.c): Moved the tests out to another file.
  2809.         
  2810.     (tests.c): Moved all the testing stuff here.
  2811.         
  2812. Sat Nov 18 19:30:30 1989  Kathy Hargreaves  (kathy at hayley)
  2813.         
  2814.         * regex.c: (re_compile_pattern): Defined RE_DUP_MAX, the maximum
  2815.         number of times an interval can match a pattern.
  2816.         Added macro GET_UNSIGNED_NUMBER (used to get below):
  2817.         Added variables lower_bound and upper_bound for upper and lower
  2818.         bounds of intervals.
  2819.         Added variable num_fetches so intervals could do backtracking.
  2820.     Added code to handle '{' and "\{" and intervals.
  2821.     Added to comments.
  2822.         
  2823.         (store_jump_n): (Added) Stores a jump with a number following the
  2824.         relative address (for intervals).
  2825.         
  2826.         (insert_jump_n): (Added) Inserts a jump_n.
  2827.  
  2828.         (re_match_2): Defined a macro ESTACK_PUSH_2 for the error stack; 
  2829.         it checks for overflow and reallocates if necessary.
  2830.  
  2831.     * regex.h: Added bits (RE_INTERVALS and RE_NO_BK_CURLY_BRACES)
  2832.     to obscure syntax to indicate whether or not
  2833.     a syntax handles intervals and recognizes either \{ and
  2834.     \} or { and } as operators.  Also added two syntaxes
  2835.     RE_SYNTAX_POSIX_BASIC and RE_POSIX_EXTENDED and two command codes
  2836.         to the enumeration regexpcode; they are succeed_n and jump_n.
  2837.  
  2838. Sat Nov 18 19:30:30 1989  Kathy Hargreaves  (kathy at hayley)
  2839.     
  2840.     * regex.c: (re_compile_pattern): Defined INIT_BUFF_SIZE to get rid
  2841.         of repeated constants in code.  Tested with value 1.
  2842.     Renamed PATPUSH as BUFPUSH, since it pushes things onto the
  2843.         buffer, not the pattern.  Also made this macro extend the buffer
  2844.         if it's full (so could do the following):
  2845.         Took out code at top of loop that checks to see if buffer is going
  2846.         to be full after 10 additions (and reallocates if necessary). 
  2847.  
  2848.         (insert_jump): Rearranged declaration lines so comments would read
  2849.         better.
  2850.  
  2851.     (re_match_2): Compacted exactn code and added more comments.
  2852.         
  2853.     (main): Defined macros TEST_MATCH and MATCH_SELF to do
  2854.         testing; took out loop so could use these instead.
  2855.         
  2856. Tue Oct 24 20:57:18 1989  Kathy Hargreaves  (kathy at hayley)
  2857.  
  2858.     * regex.c (re_set_syntax): Gave argument `syntax' a type.
  2859.         (store_jump, insert_jump): made them void functions.
  2860.  
  2861. Local Variables:
  2862. mode: indented-text
  2863. left-margin: 8
  2864. version-control: never
  2865. End:
  2866.