comparison src/regex.c @ 107640:a744b1df50bd

Merge from mainline.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 13 Mar 2010 04:02:01 -0500
parents 14ff9accfbd3
children 5582106cddf0
comparison
equal deleted inserted replaced
107639:844012bdb5dd 107640:a744b1df50bd
3068 /* Setup the gl_state object to its buffer-defined 3068 /* Setup the gl_state object to its buffer-defined
3069 value. This hardcodes the buffer-global 3069 value. This hardcodes the buffer-global
3070 syntax-table for ASCII chars, while the other chars 3070 syntax-table for ASCII chars, while the other chars
3071 will obey syntax-table properties. It's not ideal, 3071 will obey syntax-table properties. It's not ideal,
3072 but it's the way it's been done until now. */ 3072 but it's the way it's been done until now. */
3073 SETUP_SYNTAX_TABLE (BEGV, 0); 3073 SETUP_BUFFER_SYNTAX_TABLE ();
3074 3074
3075 for (ch = 0; ch < 256; ++ch) 3075 for (ch = 0; ch < 256; ++ch)
3076 { 3076 {
3077 c = RE_CHAR_TO_MULTIBYTE (ch); 3077 c = RE_CHAR_TO_MULTIBYTE (ch);
3078 if (! CHAR_BYTE8_P (c) 3078 if (! CHAR_BYTE8_P (c)
4494 4494
4495 /* See whether the pattern is anchored. */ 4495 /* See whether the pattern is anchored. */
4496 anchored_start = (bufp->buffer[0] == begline); 4496 anchored_start = (bufp->buffer[0] == begline);
4497 4497
4498 #ifdef emacs 4498 #ifdef emacs
4499 gl_state.object = re_match_object; 4499 gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
4500 { 4500 {
4501 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (startpos)); 4501 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (startpos));
4502 4502
4503 SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1); 4503 SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1);
4504 } 4504 }
5097 { 5097 {
5098 int result; 5098 int result;
5099 5099
5100 #ifdef emacs 5100 #ifdef emacs
5101 int charpos; 5101 int charpos;
5102 gl_state.object = re_match_object; 5102 gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
5103 charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (pos)); 5103 charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (pos));
5104 SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1); 5104 SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1);
5105 #endif 5105 #endif
5106 5106
5107 result = re_match_2_internal (bufp, (re_char*) string1, size1, 5107 result = re_match_2_internal (bufp, (re_char*) string1, size1,
6502 size_t length; 6502 size_t length;
6503 struct re_pattern_buffer *bufp; 6503 struct re_pattern_buffer *bufp;
6504 { 6504 {
6505 reg_errcode_t ret; 6505 reg_errcode_t ret;
6506 6506
6507 #ifdef emacs
6508 gl_state.current_syntax_table = current_buffer->syntax_table;
6509 #endif
6510
6511 /* GNU code is written to assume at least RE_NREGS registers will be set 6507 /* GNU code is written to assume at least RE_NREGS registers will be set
6512 (and at least one extra will be -1). */ 6508 (and at least one extra will be -1). */
6513 bufp->regs_allocated = REGS_UNALLOCATED; 6509 bufp->regs_allocated = REGS_UNALLOCATED;
6514 6510
6515 /* And GNU code determines whether or not to get register information 6511 /* And GNU code determines whether or not to get register information