summaryrefslogtreecommitdiff
path: root/lib/rx.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rx.h')
-rw-r--r--lib/rx.h490
1 files changed, 245 insertions, 245 deletions
diff --git a/lib/rx.h b/lib/rx.h
index b85c92a8ac..d3f1431ba1 100644
--- a/lib/rx.h
+++ b/lib/rx.h
@@ -67,7 +67,7 @@ typedef int (*rx_sp_comparer) (void * a, void * b);
typedef int (*rx_sp_comparer) ();
#endif
-struct rx_sp_node
+struct rx_sp_node
{
void * key;
void * data;
@@ -140,7 +140,7 @@ struct rx_se_list;
-/*
+/*
* GLOSSARY
*
* regexp
@@ -160,7 +160,7 @@ struct rx_se_list;
* of a matcher using the pattern.
*
* NFA - nondeterministic finite automata. Some people
- * use this term to a member of the class of
+ * use this term to a member of the class of
* regular automata (those corresponding to a regular
* language). However, in this code, the meaning is
* more general. The automata used by Rx are comperable
@@ -178,7 +178,7 @@ struct rx_se_list;
* side-effect edges - The NFA compiled from a pattern can have three
* kinds of edges. Epsilon edges can be taken freely anytime
* their source state is reached. Character set edges can be
- * taken when their source state is reached and when the next
+ * taken when their source state is reached and when the next
* character in the buffer is a member of the set. Side effect
* edges imply a transition that can only be taken after the
* indicated side effect has been successfully accomplished.
@@ -188,7 +188,7 @@ struct rx_se_list;
* location of a parentesized subexpression.
*
* Advancing the matcher over N characters if they
- * match the N characters previously matched by a
+ * match the N characters previously matched by a
* parentesized subexpression.
*
* Both of those kinds of edges occur in the NFA generated
@@ -215,10 +215,10 @@ struct rx_se_list;
* question. It compares two lists of side effects, and says
* which list comes first.
*/
-
+
#ifdef __STDC__
typedef int (*rx_se_list_order) (struct rx *,
- struct rx_se_list *,
+ struct rx_se_list *,
struct rx_se_list *);
#else
typedef int (*rx_se_list_order) ();
@@ -229,7 +229,7 @@ typedef int (*rx_se_list_order) ();
/* Struct RX holds a compiled regular expression - that is, an nfa
* ready to be converted on demand to a more efficient superstate nfa.
* This is for the low level interface. The high-level interfaces enclose
- * this in a `struct re_pattern_buffer'.
+ * this in a `struct re_pattern_buffer'.
*/
struct rx
{
@@ -249,12 +249,12 @@ struct rx
*/
int rx_id;
- /* This is memory mgt. state for superstates. This may be
+ /* This is memory mgt. state for superstates. This may be
* shared by more than one struct rx.
*/
struct rx_cache * cache;
- /* Every regex defines the size of its own character set.
+ /* Every regex defines the size of its own character set.
* A superstate has an array of this size, with each element
* a `struct rx_inx'. So, don't make this number too large.
* In particular, don't make it 2^16.
@@ -270,7 +270,7 @@ struct rx
/* Clients of RX can ask for some extra storage in the space pointed
* to by BUFFER. The field RESERVED is an input parameter to the
- * compiler. After compilation, this much space will be available
+ * compiler. After compilation, this much space will be available
* at (buffer + allocated - reserved)
*/
unsigned long reserved;
@@ -279,7 +279,7 @@ struct rx
/* --------- But! they must be initialized to 0. --------- */
/* NODEC is the number of nodes in the NFA with non-epsilon
- * transitions.
+ * transitions.
*/
int nodec;
@@ -291,12 +291,12 @@ struct rx
*/
/* Lists of side effects as stored in the NFA are `hash consed'..meaning
- * that lists with the same elements are ==. During compilation,
+ * that lists with the same elements are ==. During compilation,
* this table facilitates hash-consing.
*/
struct rx_hash se_list_memo;
- /* Lists of NFA states are also hashed.
+ /* Lists of NFA states are also hashed.
*/
struct rx_hash set_list_memo;
@@ -317,7 +317,7 @@ struct rx
/* The list of all states in an NFA.
* During compilation, the NEXT field of NFA states links this list.
* After compilation, all the states are compacted into an array,
- * ordered by state id numbers. At that time, this points to the base
+ * ordered by state id numbers. At that time, this points to the base
* of that array.
*/
struct rx_nfa_state *nfa_states;
@@ -339,9 +339,9 @@ struct rx
/* SYNTAX TREES */
-/* Compilation is in stages.
+/* Compilation is in stages.
*
- * In the first stage, a pattern specified by a string is
+ * In the first stage, a pattern specified by a string is
* translated into a syntax tree. Later stages will convert
* the syntax tree into an NFA optimized for conversion to a
* superstate-NFA.
@@ -361,8 +361,8 @@ enum rexp_node_type
/* A 2phase-star is a variation on a repeated subexpression.
* In this case, there are two subexpressions. The first, if matched,
* begins a repitition (otherwise, the whole expression is matches the
- * empth string).
- *
+ * empth string).
+ *
* After matching the first subexpression, a 2phase star either finishes,
* or matches the second subexpression. If the second subexpression is
* matched, then the whole construct repeats.
@@ -425,7 +425,7 @@ struct rx_nfa_state
struct rx_nfa_state *next;
/* After the NFA is built, states are given integer id's.
- * States whose outgoing transitions are all either epsilon or
+ * States whose outgoing transitions are all either epsilon or
* side effect edges are given ids less than 0. Other states
* are given successive non-negative ids starting from 0.
*/
@@ -443,11 +443,11 @@ struct rx_nfa_state
* epsilon and side effect edges. Consider the set of maximal paths
* of that sort from this state. Call it the epsilon-side-effect
* closure of the state.
- *
+ *
* The epsilon closure of the state is a subset of the epsilon-side-
- * effect closure. It consists of all the paths that contain
+ * effect closure. It consists of all the paths that contain
* no side effects -- only epsilon edges.
- *
+ *
* The paths in the epsilon-side-effect closure can be partitioned
* into equivalance sets. Two paths are equivalant if they have the
* same set of side effects, in the same order. The epsilon-closure
@@ -476,13 +476,13 @@ struct rx_nfa_state
* s1
* A ---> B
*
- * s2
+ * s2
* ---> C
*
* epsilon s1
* ---------> D ------> E
- *
- *
+ *
+ *
* In this example, A has two possible futures.
* One invokes the side effect `s1' and contains two paths,
* one ending in state B, the other in state E.
@@ -511,7 +511,7 @@ enum rx_nfa_etype
ne_cset,
/* An epsilon edge is taken whenever its starting state is
- * reached.
+ * reached.
*/
ne_epsilon,
@@ -582,7 +582,7 @@ struct rx_possible_future
* For a superstate edge EDGE starting in some superstate SUPER,
* the following is true (in pseudo-notation :-):
*
- * exists DEST in nfa_states s.t.
+ * exists DEST in nfa_states s.t.
* exists nfaEDGE in nfa_edges s.t.
* origin (nfaEDGE) == DEST
* && origin (nfaEDGE) is a member of nfa_states(SUPER)
@@ -602,7 +602,7 @@ struct rx_possible_future
* character and a superstate implies many transitions in the NFA --
* those that begin with an edge labeled with that character from a
* state in the set corresponding to the superstate.
- *
+ *
* The destinations of those transitions each have a set of possible
* futures. A possible future is a list of side effects and a set of
* destination NFA states. Two sets of possible futures can be
@@ -613,17 +613,17 @@ struct rx_possible_future
* and a character can be merged into a set of possible futures where
* no two elements of the set have the same set of side effects.
*
- * The destination of a possible future, being a set of NFA states,
+ * The destination of a possible future, being a set of NFA states,
* corresponds to a supernfa state. So, the merged set of possible
* futures we just created can serve as a set of edges in the
* supernfa.
*
* The representation of the superstate nfa and the nfa is critical.
* The nfa has to be compact, but has to facilitate the rapid
- * computation of missing superstates. The superstate nfa has to
+ * computation of missing superstates. The superstate nfa has to
* be fast to interpret, lazilly constructed, and bounded in space.
*
- * To facilitate interpretation, the superstate data structures are
+ * To facilitate interpretation, the superstate data structures are
* peppered with `instruction frames'. There is an instruction set
* defined below which matchers using the supernfa must be able to
* interpret.
@@ -633,32 +633,32 @@ struct rx_possible_future
* Therefore, we define an enumerated type of opcodes, and when
* writing one of these instructions into a data structure, use
* the opcode as an index into a table of instruction values.
- *
+ *
* Here are the opcodes that occur in the superstate nfa:
*/
-
-/* Every superstate contains a table of instruction frames indexed
+
+/* Every superstate contains a table of instruction frames indexed
* by characters. A normal `move' in a matcher is to fetch the next
* character and use it as an index into a superstates transition
* table.
*
* In the fasted case, only one edge follows from that character.
* In other cases there is more work to do.
- *
+ *
* The descriptions of the opcodes refer to data structures that are
- * described further below.
+ * described further below.
*/
enum rx_opcode
{
- /*
- * BACKTRACK_POINT is invoked when a character transition in
+ /*
+ * BACKTRACK_POINT is invoked when a character transition in
* a superstate leads to more than one edge. In that case,
* the edges have to be explored independently using a backtracking
* strategy.
*
- * A BACKTRACK_POINT instruction is stored in a superstate's
+ * A BACKTRACK_POINT instruction is stored in a superstate's
* transition table for some character when it is known that that
* character crosses more than one edge. On encountering this
* instruction, the matcher saves enough state to backtrack to this
@@ -666,7 +666,7 @@ enum rx_opcode
*/
rx_backtrack_point = 0, /* data is (struct transition_class *) */
- /*
+ /*
* RX_DO_SIDE_EFFECTS evaluates the side effects of an epsilon path.
* There is one occurence of this instruction per rx_distinct_future.
* This instruction is skipped if a rx_distinct_future has no side effects.
@@ -675,7 +675,7 @@ enum rx_opcode
/* data is (struct rx_distinct_future *) */
- /*
+ /*
* RX_CACHE_MISS instructions are stored in rx_distinct_futures whose
* destination superstate has been reclaimed (or was never built).
* It recomputes the destination superstate.
@@ -685,9 +685,9 @@ enum rx_opcode
rx_cache_miss = rx_do_side_effects + 1,
/* data is (struct rx_distinct_future *) */
- /*
+ /*
* RX_NEXT_CHAR is called to consume the next character and take the
- * corresponding transition. This is the only instruction that uses
+ * corresponding transition. This is the only instruction that uses
* the DATA field of the instruction frame instead of DATA_2.
* (see EXPLORE_FUTURE in regex.c).
*/
@@ -697,7 +697,7 @@ enum rx_opcode
*/
rx_backtrack = rx_next_char + 1, /* no data */
- /*
+ /*
* RX_ERROR_INX is stored only in places that should never be executed.
*/
rx_error_inx = rx_backtrack + 1, /* Not supposed to occur. */
@@ -710,7 +710,7 @@ enum rx_opcode
*/
extern void * rx_id_instruction_table[rx_num_instructions];
-/* The heart of the matcher is a `word-code-interpreter'
+/* The heart of the matcher is a `word-code-interpreter'
* (like a byte-code interpreter, except that instructions
* are a full word wide).
*
@@ -728,11 +728,11 @@ extern void * rx_id_instruction_table[rx_num_instructions];
* Instructions take at most one argument, but there are two
* slots in an instruction frame that might hold that argument.
* These are called data and data_2. The data slot is only
- * used for one instruction (RX_NEXT_CHAR). For all other
+ * used for one instruction (RX_NEXT_CHAR). For all other
* instructions, data should be set to 0.
*
* RX_NEXT_CHAR is the most important instruction by far.
- * By reserving the data field for its exclusive use,
+ * By reserving the data field for its exclusive use,
* instruction dispatch is sped up in that case. There is
* no need to fetch both the instruction and the data,
* only the data is needed. In other words, a `cycle' begins
@@ -744,7 +744,7 @@ extern void * rx_id_instruction_table[rx_num_instructions];
* dispatch on that.
*/
-struct rx_inx
+struct rx_inx
{
void * data;
void * data_2;
@@ -784,7 +784,7 @@ struct rx_superset
struct rx_superstate * superstate;
- /* There is another bookkeeping problem. It is expensive to
+ /* There is another bookkeeping problem. It is expensive to
* compute the starting nfa state set for an nfa. So, once computed,
* it is cached in the `struct rx'.
*
@@ -796,7 +796,7 @@ struct rx_superset
*
* Fortunately, even if this set is flushed from the cache, it is
* not freed. It just goes on the free-list of supersets.
- * So we can still examine it.
+ * So we can still examine it.
*
* So to validate a starting set memo, check to see if the
* starts_for field still points back to the struct rx in question,
@@ -815,7 +815,7 @@ struct rx_superset
/* The terminology may be confusing (rename this structure?).
* Every character occurs in at most one rx_super_edge per super-state.
* But, that structure might have more than one option, indicating a point
- * of non-determinism.
+ * of non-determinism.
*
* In other words, this structure holds a list of superstate edges
* sharing a common starting state and character label. The edges
@@ -834,7 +834,7 @@ struct rx_super_edge
/* A superstate is a set of nfa states (RX_SUPERSET) along
* with a transition table. Superstates are built on demand and reclaimed
* without warning. To protect a superstate from this ghastly fate,
- * use LOCK_SUPERSTATE.
+ * use LOCK_SUPERSTATE.
*/
struct rx_superstate
{
@@ -843,7 +843,7 @@ struct rx_superstate
/* Within a superstate cache, all the superstates are kept in a big
* queue. The tail of the queue is the state most likely to be
- * reclaimed. The *recyclable fields hold the queue position of
+ * reclaimed. The *recyclable fields hold the queue position of
* this state.
*/
struct rx_superstate * next_recyclable;
@@ -873,8 +873,8 @@ struct rx_superstate
* So, incoming transitions are only made expensive for states near
* the tail of the recyclable queue. The more cache contention
* there is, the more frequently a state will have to prove itself
- * and be moved back to the front of the queue. If there is less
- * contention, then popular states just aggregate in the front of
+ * and be moved back to the front of the queue. If there is less
+ * contention, then popular states just aggregate in the front of
* the queue and stay there.
*/
int is_semifree;
@@ -891,7 +891,7 @@ struct rx_superstate
};
-/* A list of distinct futures define the edges that leave from a
+/* A list of distinct futures define the edges that leave from a
* given superstate on a given character. c.f. rx_super_edge.
*/
@@ -912,7 +912,7 @@ struct rx_distinct_future
* Normally this is a next_char instruction, but it may be a
* cache_miss instruction as well, depending on whether or not
* the superstate is in the cache and semifree.
- *
+ *
* If this is the only future for a given superstate/char, and
* if there are no side effects to be performed, this frame is
* not used (directly) at all. Instead, its contents are copied
@@ -949,7 +949,7 @@ typedef void (*rx_morecore_fn)(struct rx_cache *);
typedef void (*rx_morecore_fn)();
#endif
-/* You use this to control the allocation of superstate data
+/* You use this to control the allocation of superstate data
* during matching. Most of it should be initialized to 0.
*
* A MORECORE function is necessary. It should allocate
@@ -960,10 +960,10 @@ typedef void (*rx_morecore_fn)();
* the system will try to allocate. The default is 128. Batch style
* applications that are very regexp intensive should use as high a number
* as possible without thrashing.
- *
+ *
* The LOCAL_CSET_SIZE is the number of characters in a character set.
* It is therefore the number of entries in a superstate transition table.
- * Generally, it should be 256. If your character set has 16 bits,
+ * Generally, it should be 256. If your character set has 16 bits,
* it is better to translate your regexps into equivalent 8 bit patterns.
*/
@@ -971,7 +971,7 @@ struct rx_cache
{
struct rx_hash_rules superset_hash_rules;
- /* Objects are allocated by incrementing a pointer that
+ /* Objects are allocated by incrementing a pointer that
* scans across rx_blocklists.
*/
struct rx_blocklist * memory;
@@ -1062,7 +1062,7 @@ typedef enum rx_get_burst_return
(*rx_get_burst_fn) (struct rx_string_position * pos,
void * app_closure,
int stop);
-
+
#else
typedef enum rx_get_burst_return (*rx_get_burst_fn) ();
#endif
@@ -1076,7 +1076,7 @@ enum rx_back_check_return
rx_back_check_fail
};
-/* Back_check should advance the position it is passed
+/* Back_check should advance the position it is passed
* over rparen - lparen characters and return pass iff
* the characters starting at POS match those indexed
* by [LPAREN..RPAREN].
@@ -1093,7 +1093,7 @@ typedef enum rx_back_check_return
unsigned char * translate,
void * app_closure,
int stop);
-
+
#else
typedef enum rx_back_check_return (*rx_back_check_fn) ();
#endif
@@ -1131,7 +1131,7 @@ enum rx_search_return
/* regex.h
- *
+ *
* The remaining declarations replace regex.h.
*/
@@ -1154,7 +1154,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -1187,8 +1187,8 @@ enum re_side_effects
};
/* These hold paramaters for the kinds of side effects that are possible
- * in the supported pattern languages. These include things like the
- * numeric bounds of {} operators and the index of paren registers for
+ * in the supported pattern languages. These include things like the
+ * numeric bounds of {} operators and the index of paren registers for
* subexpression measurement or backreferencing.
*/
struct re_se_params
@@ -1207,10 +1207,10 @@ struct re_pattern_buffer
unsigned int no_sub:1; /* If set, don't return register offsets. */
unsigned int not_bol:1; /* If set, the anchors ('^' and '$') don't */
- unsigned int not_eol:1; /* match at the ends of the string. */
+ unsigned int not_eol:1; /* match at the ends of the string. */
unsigned int newline_anchor:1;/* If true, an anchor at a newline matches.*/
unsigned int least_subs:1; /* If set, and returning registers, return
- * as few values as possible. Only
+ * as few values as possible. Only
* backreferenced groups and group 0 (the whole
* match) will be returned.
*/
@@ -1226,18 +1226,18 @@ struct re_pattern_buffer
unsigned int is_anchored:1; /* Anchorded by ^? */
unsigned int begbuf_only:1; /* Anchored to char position 0? */
-
+
/* If REGS_UNALLOCATED, allocate space in the `regs' structure
* for `max (RE_NREGS, re_nsub + 1)' groups.
* If REGS_REALLOCATE, reallocate space if necessary.
- * If REGS_FIXED, use what's there.
+ * If REGS_FIXED, use what's there.
*/
#define REGS_UNALLOCATED 0
#define REGS_REALLOCATE 1
#define REGS_FIXED 2
unsigned int regs_allocated:2;
-
+
/* Either a translate table to apply to all characters before
* comparing them, or zero for no translation. The translation
* is applied to a pattern when it is compiled and to a string
@@ -1245,11 +1245,11 @@ struct re_pattern_buffer
*/
unsigned char * translate;
- /* If this is a valid pointer, it tells rx not to store the extents of
+ /* If this is a valid pointer, it tells rx not to store the extents of
* certain subexpressions (those corresponding to non-zero entries).
* Passing 0x1 is the same as passing an array of all ones. Passing 0x0
* is the same as passing an array of all zeros.
- * The array should contain as many entries as their are subexps in the
+ * The array should contain as many entries as their are subexps in the
* regexp.
*
* For POSIX compatability, when using regcomp and regexec this field
@@ -1269,7 +1269,7 @@ struct re_pattern_buffer
char *fastmap;
unsigned int fastmap_accurate:1; /* These three are internal. */
- unsigned int can_match_empty:1;
+ unsigned int can_match_empty:1;
struct rx_nfa_state * start; /* The nfa starting state. */
/* This is the list of iterator bounds for {lo,hi} constructs.
@@ -1319,7 +1319,7 @@ typedef struct
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
+ literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -1335,7 +1335,7 @@ typedef struct
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -1346,7 +1346,7 @@ typedef struct
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
+ some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -1368,7 +1368,7 @@ typedef struct
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
+ interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -1393,7 +1393,7 @@ typedef struct
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and \| is literal.
+/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -1415,7 +1415,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
+ don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -1479,7 +1479,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
+#define RE_DUP_MAX ((1 << 15) - 1)
@@ -1492,7 +1492,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
-
+
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -1517,7 +1517,7 @@ extern reg_syntax_t re_syntax_options;
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
* `re_match_2' returns information about at least this many registers
- * the first time a `regs' structure is passed.
+ * the first time a `regs' structure is passed.
*
* Also, this is the greatest number of backreferenced subexpressions
* allowed in a pattern being matched without caller-supplied registers.
@@ -1534,7 +1534,7 @@ extern const char *rx_version_string;
#ifdef RX_WANT_RX_DEFS
/* This is decls to the interesting subsystems and lower layers
- * of rx. Everything which doesn't have a public counterpart in
+ * of rx. Everything which doesn't have a public counterpart in
* regex.c is declared here.
*/
@@ -1763,7 +1763,7 @@ struct rx_backtrack_frame
{
char * counter_stack_sp;
- /* A frame is used to save the matchers state when it crosses a
+ /* A frame is used to save the matchers state when it crosses a
* backtracking point. The `stk_' fields correspond to variables
* in re_search_2 (just strip off thes `stk_'). They are documented
* tere.
@@ -1776,7 +1776,7 @@ struct rx_backtrack_frame
int stk_test_ret;
/* This is the list of options left to explore at the backtrack
- * point for which this frame was created.
+ * point for which this frame was created.
*/
struct rx_distinct_future * df;
struct rx_distinct_future * first_df;
@@ -1852,15 +1852,15 @@ struct rx_search_state
regoff_t * best_lpspace; /* in case the user doesn't want these */
regoff_t * best_rpspace; /* values, we still need space to store
* them. Normally, this memoryis unused
- * and the space pointed to by REGS is
+ * and the space pointed to by REGS is
* used instead.
*/
-
+
int last_l; /* Highest index of a valid lparen. */
int last_r; /* It's dual. */
-
+
int * best_lparen; /* This contains the best known register */
- int * best_rparen; /* assignments.
+ int * best_rparen; /* assignments.
* This may point to the same mem as
* best_lpspace, or it might point to memory
* passed by the caller.
@@ -1869,7 +1869,7 @@ struct rx_search_state
int best_last_r;
- unsigned char * translate;
+ unsigned char * translate;
struct rx_string_position outer_pos;
@@ -1888,7 +1888,7 @@ struct rx_search_state
rx_get_burst_fn saved_get_burst;
rx_back_check_fn saved_back_check;
struct re_registers * saved_regs;
-
+
/**
** state for fastmap
**/
@@ -1900,23 +1900,23 @@ struct rx_search_state
enum rx_fastmap_entry fastmap_resume_pt;
/**
- ** state for test_match
+ ** state for test_match
**/
/* The current superNFA position of the matcher. */
struct rx_superstate * super;
-
+
/* The matcher interprets a series of instruction frames.
* This is the `instruction counter' for the interpretation.
*/
struct rx_inx * ifr;
-
+
/* We insert a ghost character in the string to prime
* the nfa. test_pos.pos, test_pos.str_half, and test_pos.end_half
* keep track of the test-match position and string-half.
*/
unsigned char c;
-
+
/* Position within the string. */
struct rx_string_position test_pos;
@@ -1926,7 +1926,7 @@ struct rx_search_state
int chunk_bytes;
struct rx_stack_chunk * free_chunks;
- /* To return from this function, set test_ret and
+ /* To return from this function, set test_ret and
* `goto test_do_return'.
*
* Possible return values are:
@@ -1946,14 +1946,14 @@ struct rx_search_state
int test_ret;
int could_have_continued;
-
+
#ifdef RX_DEBUG
int backtrack_depth;
/* There is a search tree with every node as set of deterministic
- * transitions in the super nfa. For every branch of a
+ * transitions in the super nfa. For every branch of a
* backtrack point is an edge in the tree.
* This counts up a pre-order of nodes in that tree.
- * It's saved on the search stack and printed when debugging.
+ * It's saved on the search stack and printed when debugging.
*/
int line_no;
int lines_found;
@@ -1966,7 +1966,7 @@ struct rx_search_state
struct rx_inx * saved_this_tr_table;
int saved_reg;
struct rx_backtrack_frame * saved_bf;
-
+
};
@@ -1981,7 +1981,7 @@ init_fastmap (rxb, search_state)
search_state->fastmap = (rxb->fastmap
? (char *)rxb->fastmap
: (char *)rx_slowmap);
- /* Update the fastmap now if not correct already.
+ /* Update the fastmap now if not correct already.
* When the regexp was compiled, the fastmap was computed
* and stored in a bitset. This expands the bitset into a
* character array containing 1s and 0s.
@@ -2033,7 +2033,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
* This sentinal will trap the fastmap loop when it reaches the last
* valid character in a string half.
*
- * This must be reset when the fastmap/search loop crosses a string
+ * This must be reset when the fastmap/search loop crosses a string
* boundry, and before returning to the caller. So sometimes,
* the fastmap loop is restarted with `continue', othertimes by
* `goto init_fastmap_sentinal'.
@@ -2052,7 +2052,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
search_state->fastmap_chr = -1;
search_state->fastmap_val = 0;
}
-
+
if (search_state->outer_pos.pos >= search_state->outer_pos.end)
goto fastmap_hit_bound;
else
@@ -2076,7 +2076,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
++search_state->outer_pos.pos;
if (*search_state->outer_pos.pos != search_state->fastmap_chr)
return rx_fastmap_ok;
- else
+ else
{
++search_state->outer_pos.pos;
if (search_state->outer_pos.pos == search_state->outer_pos.end)
@@ -2106,7 +2106,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
--search_state->outer_pos.pos;
if ((*search_state->outer_pos.pos != search_state->fastmap_chr) || search_state->fastmap_val)
return rx_fastmap_ok;
- else
+ else
{
--search_state->outer_pos.pos;
if (search_state->outer_pos.pos == bound)
@@ -2116,12 +2116,12 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
}
}
}
-
+
case rx_fastmap_string_break:
fastmap_hit_bound:
{
/* If we hit a bound, it may be time to fetch another burst
- * of string, or it may be time to return a continuation to
+ * of string, or it may be time to return a continuation to
* the caller, or it might be time to fail.
*/
@@ -2140,7 +2140,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
case rx_get_burst_ok:
goto init_fastmap_sentinal;
case rx_get_burst_no_more:
- /* ...not a string split, simply no more string.
+ /* ...not a string split, simply no more string.
*
* When searching backward, running out of string
* is reason to quit.
@@ -2162,7 +2162,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
#ifdef emacs
/* The `emacs' switch turns on certain matching commands
- * that make sense only in Emacs.
+ * that make sense only in Emacs.
*/
#include "config.h"
#include "lisp.h"
@@ -2178,7 +2178,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state)
#endif /* RX_RX_MEMDBUG */
/* We used to test for `BSTRING' here, but only GCC and Emacs define
- * `BSTRING', as far as I know, and neither of them use this code.
+ * `BSTRING', as far as I know, and neither of them use this code.
*/
#if HAVE_STRING_H || STDC_HEADERS
#include <string.h>
@@ -2217,7 +2217,7 @@ char *realloc ();
* This must be nonzero for the wordchar and notwordchar pattern
* commands in re_match_2.
*/
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
#define SYNTAX(c) re_syntax_table[c]
@@ -2226,7 +2226,7 @@ RX_DECL char re_syntax_table[CHAR_SET_SIZE];
/* Test if at very beginning or at very end of the virtual concatenation
- * of `string1' and `string2'. If only one string, it's `string2'.
+ * of `string1' and `string2'. If only one string, it's `string2'.
*/
#define AT_STRINGS_BEG() \
@@ -2245,14 +2245,14 @@ RX_DECL char re_syntax_table[CHAR_SET_SIZE];
* the first character in string2; and if before the beginning of
* string2, look at the last character in string1.
*
- * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG ().
+ * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG ().
*/
#define LETTER_P(POS,OFF) \
( SYNTAX (fetch_char(POS, OFF, app_closure, stop)) \
== Sword)
/* Test if the character at D and the one after D differ with respect
- * to being word-constituent.
+ * to being word-constituent.
*/
#define AT_WORD_BOUNDARY(d) \
(AT_STRINGS_BEG () || AT_STRINGS_END () || LETTER_P (d,0) != LETTER_P (d, 1))
@@ -2395,17 +2395,17 @@ rx_search (rxb, startpos, range, stop, total_size,
= search_state.best_lpspace
= search_state.best_rpspace
= 0);
-
+
/* figure the number of registers we may need for use in backreferences.
- * the number here includes an element for register zero.
+ * the number here includes an element for register zero.
*/
search_state.num_regs = rxb->re_nsub + 1;
-
-
+
+
/* check for out-of-range startpos. */
if ((startpos < 0) || (startpos > total_size))
return rx_search_fail;
-
+
/* fix up range if it might eventually take us outside the string. */
{
int endpos;
@@ -2415,7 +2415,7 @@ rx_search (rxb, startpos, range, stop, total_size,
else if (endpos > (total_size + 1))
range = total_size - startpos;
}
-
+
/* if the search isn't to be a backwards one, don't waste time in a
* long search for a pattern that says it is anchored.
*/
@@ -2426,7 +2426,7 @@ rx_search (rxb, startpos, range, stop, total_size,
else
range = 1;
}
-
+
/* decide whether to use internal or user-provided reg buffers. */
if (!regs || rxb->no_sub)
{
@@ -2438,7 +2438,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.best_rparen = search_state.best_rpspace;
}
else
- {
+ {
/* have the register data arrays been allocated? */
if (rxb->regs_allocated == REGS_UNALLOCATED)
{ /* no. so allocate them with malloc. we need one
@@ -2472,7 +2472,7 @@ rx_search (rxb, startpos, range, stop, total_size,
}
else if (rxb->regs_allocated != REGS_FIXED)
return rx_search_error;
-
+
if (regs->num_regs < search_state.num_regs + 1)
{
search_state.best_lpspace =
@@ -2490,38 +2490,38 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.best_rparen = regs->end;
}
}
-
+
search_state.lparen =
(regoff_t *) REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
search_state.rparen =
- (regoff_t *) REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
-
+ (regoff_t *) REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
+
if (! ( search_state.best_rparen
&& search_state.best_lparen
&& search_state.lparen && search_state.rparen))
return rx_search_error;
-
+
search_state.best_last_l = search_state.best_last_r = -1;
-
+
search_state.translate = (rxb->translate
? rxb->translate
: rx_id_translation);
-
-
-
+
+
+
/*
- * two nfa's were compiled.
+ * two nfa's were compiled.
* `0' is complete.
* `1' faster but gets registers wrong and ends too soon.
*/
search_state.nfa_choice = (regs && !rxb->least_subs) ? '\0' : '\1';
-
+
/* we have the option to look for the best match or the first
* one we can find. if the user isn't asking for register information,
* we don't need to find the best match.
*/
search_state.first_found = !regs;
-
+
if (range >= 0)
{
search_state.outer_pos.search_end = startpos + range;
@@ -2532,20 +2532,20 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.outer_pos.search_end = startpos + range;
search_state.outer_pos.search_direction = -1;
}
-
+
/* the vacuous search always turns up nothing. */
if ((search_state.outer_pos.search_direction == 1)
? (startpos > search_state.outer_pos.search_end)
: (startpos < search_state.outer_pos.search_end))
return rx_search_fail;
-
+
/* now we build the starting state of the supernfa. */
{
struct rx_superset * start_contents;
struct rx_nfa_state_set * start_nfa_set;
-
+
/* we presume here that the nfa start state has only one
- * possible future with no side effects.
+ * possible future with no side effects.
*/
start_nfa_set = rxb->start->futures->destset;
if ( rxb->rx.start_set
@@ -2557,10 +2557,10 @@ rx_search (rxb, startpos, range, stop, total_size,
rx_superstate_eclosure_union (&rxb->rx,
rx_superset_cons (&rxb->rx, 0, 0),
start_nfa_set);
-
+
if (!start_contents)
return rx_search_fail;
-
+
start_contents->starts_for = &rxb->rx;
rxb->rx.start_set = start_contents;
}
@@ -2573,7 +2573,7 @@ rx_search (rxb, startpos, range, stop, total_size,
else
{
rx_protect_superset (&rxb->rx, start_contents);
-
+
search_state.start_super = rx_superstate (&rxb->rx, start_contents);
if (!search_state.start_super)
return rx_search_fail;
@@ -2581,19 +2581,19 @@ rx_search (rxb, startpos, range, stop, total_size,
rx_release_superset (&rxb->rx, start_contents);
}
}
-
-
+
+
/* The outer_pos tracks the position within the strings
* as seen by loop that calls fastmap_search.
*
- * The caller supplied get_burst function actually
+ * The caller supplied get_burst function actually
* gives us pointers to chars.
- *
+ *
* Communication with the get_burst function is through an
* rx_string_position structure. Here, the structure for
* outer_pos is initialized. It is set to point to the
* NULL string, at an offset of STARTPOS. STARTPOS is out
- * of range of the NULL string, so the first call to
+ * of range of the NULL string, so the first call to
* getburst will patch up the rx_string_position to point
* to valid characters.
*/
@@ -2627,8 +2627,8 @@ rx_search (rxb, startpos, range, stop, total_size,
break;
}
}
-
- /* now the fastmap loop has brought us to a plausible
+
+ /* now the fastmap loop has brought us to a plausible
* starting point for a match. so, it's time to run the
* nfa and see if a match occured.
*/
@@ -2695,12 +2695,12 @@ rx_search (rxb, startpos, range, stop, total_size,
: (startpos > search_state.outer_pos.search_end))
goto pseudo_do;
-
+
finish:
uninit_fastmap (rxb, &search_state);
if (search_state.start_super)
rx_unlock_superstate (&rxb->rx, search_state.start_super);
-
+
#ifdef regex_malloc
if (search_state.lparen) free (search_state.lparen);
if (search_state.rparen) free (search_state.rparen);
@@ -2725,7 +2725,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.lparen[0] = startpos;
search_state.super = search_state.start_super;
search_state.c = search_state.nfa_choice;
- search_state.test_pos.pos = search_state.outer_pos.pos - 1;
+ search_state.test_pos.pos = search_state.outer_pos.pos - 1;
search_state.test_pos.string = search_state.outer_pos.string;
search_state.test_pos.end = search_state.outer_pos.end;
search_state.test_pos.offset = search_state.outer_pos.offset;
@@ -2741,8 +2741,8 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.chunk_bytes = search_state.backtrack_frame_bytes * 64;
search_state.test_ret = rx_test_line_finished;
search_state.could_have_continued = 0;
- }
- /* This is while (1)...except that the body of the loop is interrupted
+ }
+ /* This is while (1)...except that the body of the loop is interrupted
* by some alternative entry points.
*/
pseudo_while_1:
@@ -2757,42 +2757,42 @@ rx_search (rxb, startpos, range, stop, total_size,
case rx_test_start:
#ifdef RX_DEBUG
/* There is a search tree with every node as set of deterministic
- * transitions in the super nfa. For every branch of a
+ * transitions in the super nfa. For every branch of a
* backtrack point is an edge in the tree.
* This counts up a pre-order of nodes in that tree.
- * It's saved on the search stack and printed when debugging.
+ * It's saved on the search stack and printed when debugging.
*/
search_state.line_no = 0;
search_state.lines_found = 0;
#endif
-
+
top_of_cycle:
- /* A superstate is basicly a transition table, indexed by
- * characters from the string being tested, and containing
+ /* A superstate is basicly a transition table, indexed by
+ * characters from the string being tested, and containing
* RX_INX (`instruction frame') structures.
*/
search_state.ifr = &search_state.super->transitions [search_state.c];
-
+
recurse_test_match:
/* This is the point to which control is sent when the
* test matcher `recurses'. Before jumping here, some variables
* need to be saved on the stack and the next instruction frame
* has to be computed.
*/
-
+
restart:
/* Some instructions don't advance the matcher, but just
* carry out some side effects and fetch a new instruction.
* To dispatch that new instruction, `goto restart'.
*/
-
+
{
struct rx_inx * next_tr_table;
struct rx_inx * this_tr_table;
- /* The fastest route through the loop is when the instruction
+ /* The fastest route through the loop is when the instruction
* is RX_NEXT_CHAR. This case is detected when SEARCH_STATE.IFR->DATA
* is non-zero. In that case, it points to the next
- * superstate.
+ * superstate.
*
* This allows us to not bother fetching the bytecode.
*/
@@ -2804,19 +2804,19 @@ rx_search (rxb, startpos, range, stop, total_size,
if (rx_debug_trace)
{
struct rx_superset * setp;
-
+
fprintf (stderr, "%d %d>> re_next_char @ %d (%d)",
search_state.line_no,
search_state.backtrack_depth,
(search_state.test_pos.pos - search_state.test_pos.string
+ search_state.test_pos.offset), search_state.c);
-
+
search_state.super =
((struct rx_superstate *)
((char *)this_tr_table
- ((unsigned long)
((struct rx_superstate *)0)->transitions)));
-
+
setp = search_state.super->contents;
fprintf (stderr, " superstet (rx=%d, &=%x: ",
rxb->rx.rx_id, setp);
@@ -2843,22 +2843,22 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.saved_next_tr_table = next_tr_table;
test_pc = rx_test_cache_hit_loop;
goto test_return_continuation;
-
+
resume_continuation_1:
/* Continuation one jumps here to do its work: */
search_state.saved_this_tr_table = this_tr_table;
search_state.saved_next_tr_table = next_tr_table;
goto try_burst_1;
-
+
case rx_get_burst_ok:
/* get_burst succeeded...keep going */
break;
-
+
case rx_get_burst_no_more:
search_state.test_ret = rx_test_line_finished;
search_state.could_have_continued = 1;
goto test_do_return;
-
+
case rx_get_burst_error:
/* An error... */
search_state.test_ret = rx_test_internal_error;
@@ -2869,8 +2869,8 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.ifr = this_tr_table + search_state.c;
next_tr_table = (struct rx_inx *)search_state.ifr->data;
} /* Fast loop through cached transition tables */
-
- /* Here when we ran out of cached next-char transitions.
+
+ /* Here when we ran out of cached next-char transitions.
* So, it will be necessary to do a more expensive
* dispatch on the current instruction. The superstate
* pointer is allowed to become invalid during next-char
@@ -2882,7 +2882,7 @@ rx_search (rxb, startpos, range, stop, total_size,
- ((unsigned long)
((struct rx_superstate *)0)->transitions)));
}
-
+
/* We've encountered an instruction other than next-char.
* Dispatch that instruction:
*/
@@ -2891,13 +2891,13 @@ rx_search (rxb, startpos, range, stop, total_size,
if (rx_debug_trace)
{
struct rx_superset * setp = search_state.super->contents;
-
+
fprintf (stderr, "%d %d>> %s @ %d (%d)", search_state.line_no,
search_state.backtrack_depth,
inx_names[inx],
(search_state.test_pos.pos - search_state.test_pos.string
+ (test_pos.half == 0 ? 0 : size1)), search_state.c);
-
+
fprintf (stderr, " superstet (rx=%d, &=%x: ",
rxb->rx.rx_id, setp);
while (setp)
@@ -2911,8 +2911,8 @@ rx_search (rxb, startpos, range, stop, total_size,
switch ((enum rx_opcode)inx)
{
case rx_do_side_effects:
-
- /* RX_DO_SIDE_EFFECTS occurs when we cross epsilon
+
+ /* RX_DO_SIDE_EFFECTS occurs when we cross epsilon
* edges associated with parentheses, backreferencing, etc.
*/
{
@@ -2932,7 +2932,7 @@ rx_search (rxb, startpos, range, stop, total_size,
if (rx_debug_trace)
{
struct rx_superset * setp = search_state.super->contents;
-
+
fprintf (stderr, "....%d %d>> %s\n", search_state.line_no,
search_state.backtrack_depth,
efnames[-effect]);
@@ -3059,7 +3059,7 @@ rx_search (rxb, startpos, range, stop, total_size,
else
goto test_do_return;
}
-
+
case re_se_try:
/* This is the first side effect in every
* expression.
@@ -3067,7 +3067,7 @@ rx_search (rxb, startpos, range, stop, total_size,
* FOR NO GOOD REASON...get rid of it...
*/
break;
-
+
case re_se_pushpos:
{
int urhere =
@@ -3090,7 +3090,7 @@ rx_search (rxb, startpos, range, stop, total_size,
cf->cdr = old_cf;
break;
}
-
+
case re_se_chkpos:
{
int urhere =
@@ -3106,18 +3106,18 @@ rx_search (rxb, startpos, range, stop, total_size,
break;
}
break;
-
+
case re_se_poppos:
POP(search_state.counter_stack,
sizeof (struct rx_counter_frame));
break;
-
-
+
+
case re_se_at_dot:
case re_se_syntax:
case re_se_not_syntax:
#ifdef emacs
- /*
+ /*
* this release lacks emacs support
*/
#endif
@@ -3147,10 +3147,10 @@ rx_search (rxb, startpos, range, stop, total_size,
switch (rxb->se_params [effect].se)
{
case re_se_win:
- /* This side effect indicates that we've
- * found a match, though not necessarily the
- * best match. This is a fancy assignment to
- * register 0 unless the caller didn't
+ /* This side effect indicates that we've
+ * found a match, though not necessarily the
+ * best match. This is a fancy assignment to
+ * register 0 unless the caller didn't
* care about registers. In which case,
* this stops the match.
*/
@@ -3159,7 +3159,7 @@ rx_search (rxb, startpos, range, stop, total_size,
((int)(search_state.test_pos.pos
- search_state.test_pos.string)
+ search_state.test_pos.offset);
-
+
if ( (search_state.best_last_r < 0)
|| (urhere + 1 > search_state.best_rparen[0]))
{
@@ -3175,7 +3175,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.best_rparen[0] = urhere + 1;
search_state.best_last_r = search_state.last_r;
}
- /* If we're not reporting the match-length
+ /* If we're not reporting the match-length
* or other register info, we need look no
* further.
*/
@@ -3192,7 +3192,7 @@ rx_search (rxb, startpos, range, stop, total_size,
((int)(search_state.test_pos.pos
- search_state.test_pos.string)
+ search_state.test_pos.offset);
-
+
int reg = rxb->se_params [effect].op1;
#if 0
if (reg > search_state.last_l)
@@ -3212,7 +3212,7 @@ rx_search (rxb, startpos, range, stop, total_size,
}
break;
}
-
+
case re_se_rparen:
{
int urhere =
@@ -3229,14 +3229,14 @@ rx_search (rxb, startpos, range, stop, total_size,
}
break;
}
-
+
case re_se_backref:
{
int reg = rxb->se_params [effect].op1;
if ( reg > search_state.last_r
|| search_state.rparen[reg] < 0)
goto test_do_return;
-
+
{
int backref_status;
check_backreference:
@@ -3343,7 +3343,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.ifr = &df->future_frame;
goto restart;
}
-
+
case rx_backtrack_point:
{
/* A backtrack point indicates that we've reached a
@@ -3353,18 +3353,18 @@ rx_search (rxb, startpos, range, stop, total_size,
* A backtracking strategy is used. We keep track of what
* registers are valid so we can erase side effects.
*
- * First, make sure there is some stack space to hold
+ * First, make sure there is some stack space to hold
* our state.
*/
-
+
struct rx_backtrack_frame * bf;
-
+
PUSH(search_state.backtrack_stack,
search_state.backtrack_frame_bytes);
#ifdef RX_DEBUG_0
++search_state.backtrack_depth;
#endif
-
+
bf = ((struct rx_backtrack_frame *)
search_state.backtrack_stack->sp);
{
@@ -3399,30 +3399,30 @@ rx_search (rxb, startpos, range, stop, total_size,
stk[x] = search_state.rparen[x];
}
}
-
+
/* Here is a while loop whose body is mainly a function
* call and some code to handle a return from that
* function.
*
* From here on for the rest of `case backtrack_point' it
- * is unsafe to assume that the search_state copies of
+ * is unsafe to assume that the search_state copies of
* variables saved on the backtracking stack are valid
* -- so read their values from the backtracking stack.
*
* This lets us use one generation fewer stack saves in
* the call-graph of a search.
*/
-
+
while_non_det_options:
#ifdef RX_DEBUG_0
++search_state.lines_found;
if (rx_debug_trace)
fprintf (stderr, "@@@ %d calls %d @@@\n",
search_state.line_no, search_state.lines_found);
-
+
search_state.line_no = search_state.lines_found;
#endif
-
+
if (bf->df->next_same_super_edge[0] == bf->first_df)
{
/* This is a tail-call optimization -- we don't recurse
@@ -3431,7 +3431,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.ifr = (bf->df->effects
? &bf->df->side_effects_frame
: &bf->df->future_frame);
-
+
rx_unlock_superstate (&rxb->rx, search_state.super);
POP(search_state.backtrack_stack,
search_state.backtrack_frame_bytes);
@@ -3453,14 +3453,14 @@ rx_search (rxb, startpos, range, stop, total_size,
cf->val = old_cf->val;
cf->inherited_from = old_cf;
cf->cdr = 0;
- }
+ }
/* `Call' this test-match block */
search_state.ifr = (bf->df->effects
? &bf->df->side_effects_frame
: &bf->df->future_frame);
goto recurse_test_match;
}
-
+
/* Returns in this block are accomplished by
* goto test_do_return. There are two cases.
* If there is some search-stack left,
@@ -3468,9 +3468,9 @@ rx_search (rxb, startpos, range, stop, total_size,
* If there is no search-stack left, then
* we should return to the fastmap/search loop.
*/
-
+
test_do_return:
-
+
if (!search_state.backtrack_stack)
{
#ifdef RX_DEBUG_0
@@ -3478,18 +3478,18 @@ rx_search (rxb, startpos, range, stop, total_size,
fprintf (stderr, "!!! %d bails returning %d !!!\n",
search_state.line_no, search_state.test_ret);
#endif
-
+
/* No more search-stack -- this test is done. */
if (search_state.test_ret != rx_test_internal_error)
goto return_from_test_match;
else
goto error_in_testing_match;
}
-
- /* Returning from a recursive call to
+
+ /* Returning from a recursive call to
* the test match block:
*/
-
+
bf = ((struct rx_backtrack_frame *)
search_state.backtrack_stack->sp);
#ifdef RX_DEBUG_0
@@ -3499,7 +3499,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.test_ret,
bf->stk_search_state.line_no);
#endif
-
+
while (search_state.counter_stack
&& (!bf->counter_stack_sp
|| (bf->counter_stack_sp
@@ -3508,7 +3508,7 @@ rx_search (rxb, startpos, range, stop, total_size,
POP(search_state.counter_stack,
sizeof (struct rx_counter_frame));
}
-
+
if (search_state.test_ret == rx_test_internal_error)
{
POP (search_state.backtrack_stack,
@@ -3516,8 +3516,8 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.test_ret = rx_test_internal_error;
goto test_do_return;
}
-
- /* If a non-longest match was found and that is good
+
+ /* If a non-longest match was found and that is good
* enough, return immediately.
*/
if ( (search_state.test_ret == rx_test_found_first)
@@ -3528,7 +3528,7 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.backtrack_frame_bytes);
goto test_do_return;
}
-
+
search_state.test_ret = bf->stk_test_ret;
search_state.last_l = bf->stk_last_l;
search_state.last_r = bf->stk_last_r;
@@ -3538,7 +3538,7 @@ rx_search (rxb, startpos, range, stop, total_size,
#ifdef RX_DEBUG_0
search_state.line_no = bf->stk_search_state.line_no;
#endif
-
+
if (rxb->match_regs_on_stack)
{
int x;
@@ -3550,7 +3550,7 @@ rx_search (rxb, startpos, range, stop, total_size,
for (x = 0; x <= search_state.last_r; ++x)
search_state.rparen[x] = stk[x];
}
-
+
{
int x;
try_burst_2:
@@ -3578,8 +3578,8 @@ rx_search (rxb, startpos, range, stop, total_size,
search_state.test_pos = bf->stk_test_pos;
goto while_non_det_options;
}
-
-
+
+
case rx_cache_miss:
/* Because the superstate NFA is lazily constructed,
* and in fact may erode from underneath us, we sometimes
@@ -3596,14 +3596,14 @@ rx_search (rxb, startpos, range, stop, total_size,
goto test_do_return;
}
goto restart;
-
+
case rx_backtrack:
/* RX_BACKTRACK means that we've reached the empty
* superstate, indicating that match can't succeed
* from this point.
*/
goto test_do_return;
-
+
case rx_next_char:
case rx_error_inx:
case rx_num_instructions:
@@ -3612,21 +3612,21 @@ rx_search (rxb, startpos, range, stop, total_size,
}
goto pseudo_while_1;
}
-
- /* Healthy exits from the test-match loop do a
- * `goto return_from_test_match' On the other hand,
+
+ /* Healthy exits from the test-match loop do a
+ * `goto return_from_test_match' On the other hand,
* we might end up here.
*/
error_in_testing_match:
test_state = rx_test_error;
goto test_returns_to_search;
-
+
/***** fastmap/search loop body
* considering the results testing for a match
*/
-
+
return_from_test_match:
-
+
if (search_state.best_last_l >= 0)
{
if (regs && (regs->start != search_state.best_lparen))
@@ -3656,7 +3656,7 @@ rx_search (rxb, startpos, range, stop, total_size,
test_state = rx_test_fail;
goto test_returns_to_search;
}
-
+
test_return_continuation:
search_state.test_match_resume_pt = test_pc;
test_state = rx_test_continuation;
@@ -3674,16 +3674,16 @@ rx_search (rxb, startpos, range, stop, total_size,
/* Integers are used to represent side effects.
*
* Simple side effects are given negative integer names by these enums.
- *
+ *
* Non-negative names are reserved for complex effects.
*
- * Complex effects are those that take arguments. For example,
+ * Complex effects are those that take arguments. For example,
* a register assignment associated with a group is complex because
* it requires an argument to tell which group is being matched.
- *
+ *
* The integer name of a complex effect is an index into rxb->se_params.
*/
-
+
RX_DEF_SE(1, re_se_try, = -1) /* Epsilon from start state */
RX_DEF_SE(0, re_se_pushback, = re_se_try - 1)
@@ -3699,15 +3699,15 @@ rx_search (rxb, startpos, range, stop, total_size,
RX_DEF_SE(1, re_se_begbuf, = re_se_not_syntax - 1) /* match beginning of buffer */
RX_DEF_SE(1, re_se_hat, = re_se_begbuf - 1) /* match beginning of line */
- RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1)
+ RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1)
RX_DEF_SE(1, re_se_wordbound, = re_se_wordbeg - 1)
RX_DEF_SE(1, re_se_notwordbound, = re_se_wordbound - 1)
RX_DEF_SE(1, re_se_wordend, = re_se_notwordbound - 1)
RX_DEF_SE(1, re_se_endbuf, = re_se_wordend - 1)
- /* This fails except at the end of a line.
- * It deserves to go here since it is typicly one of the last steps
+ /* This fails except at the end of a line.
+ * It deserves to go here since it is typicly one of the last steps
* in a match.
*/
RX_DEF_SE(1, re_se_dollar, = re_se_endbuf - 1)
@@ -3715,7 +3715,7 @@ rx_search (rxb, startpos, range, stop, total_size,
/* Simple effects: */
RX_DEF_SE(1, re_se_fail, = re_se_dollar - 1)
- /* Complex effects. These are used in the 'se' field of
+ /* Complex effects. These are used in the 'se' field of
* a struct re_se_params. Indexes into the se array
* are stored as instructions on nfa edges.
*/
@@ -3723,7 +3723,7 @@ rx_search (rxb, startpos, range, stop, total_size,
RX_DEF_CPLX_SE(1, re_se_lparen, = re_se_win + 1)
RX_DEF_CPLX_SE(1, re_se_rparen, = re_se_lparen + 1)
RX_DEF_CPLX_SE(0, re_se_backref, = re_se_rparen + 1)
- RX_DEF_CPLX_SE(0, re_se_iter, = re_se_backref + 1)
+ RX_DEF_CPLX_SE(0, re_se_iter, = re_se_backref + 1)
RX_DEF_CPLX_SE(0, re_se_end_iter, = re_se_iter + 1)
RX_DEF_CPLX_SE(0, re_se_tv, = re_se_end_iter + 1)