summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/getusershell.c2
-rw-r--r--lib/group-member.c2
-rw-r--r--lib/rx.c436
-rw-r--r--lib/rx.h490
4 files changed, 465 insertions, 465 deletions
diff --git a/lib/getusershell.c b/lib/getusershell.c
index dfed7a6c41..2f167181cf 100644
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -177,7 +177,7 @@ readname (name, size, stream)
/* Skip blank space. */
while ((c = getc (stream)) != EOF && isspace (c))
/* Do nothing. */ ;
-
+
while (c != EOF && !isspace (c))
{
(*name)[name_index++] = c;
diff --git a/lib/group-member.c b/lib/group-member.c
index 9a079e2936..4ca8cb51a3 100644
--- a/lib/group-member.c
+++ b/lib/group-member.c
@@ -120,7 +120,7 @@ group_member (gid)
break;
}
}
-
+
free_group_info (gi);
return found;
diff --git a/lib/rx.c b/lib/rx.c
index 2de97e231b..2920974f2c 100644
--- a/lib/rx.c
+++ b/lib/rx.c
@@ -17,9 +17,9 @@ License along with this software; see the file COPYING.LIB. If not,
write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA
02139, USA. */
-/* NOTE!!! AIX is so losing it requires this to be the first thing in the
- * file.
- * Do not put ANYTHING before it!
+/* NOTE!!! AIX is so losing it requires this to be the first thing in the
+ * file.
+ * Do not put ANYTHING before it!
*/
#if !defined (__GNUC__) && defined (_AIX)
#pragma alloca
@@ -79,7 +79,7 @@ typedef char boolean;
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -105,7 +105,7 @@ char *alloca ();
#ifdef RX_WANT_RX_DEFS
#define RX_DECL extern
-#define RX_DEF_QUAL
+#define RX_DEF_QUAL
#else
#define RX_WANT_RX_DEFS
#define RX_DECL static
@@ -334,7 +334,7 @@ static char * efnames2[] =
"re_se_tv"
};
-static char * inx_names[] =
+static char * inx_names[] =
{
"rx_backtrack_point",
"rx_do_side_effects",
@@ -618,7 +618,7 @@ rx_bitset_hash (size, b)
}
-RX_DECL RX_subset rx_subset_singletons [RX_subset_bits] =
+RX_DECL RX_subset rx_subset_singletons [RX_subset_bits] =
{
0x1,
0x2,
@@ -695,13 +695,13 @@ static unsigned long rx_hash_masks[4] =
/* Hash tables */
#ifdef __STDC__
-RX_DECL struct rx_hash_item *
+RX_DECL struct rx_hash_item *
rx_hash_find (struct rx_hash * table,
unsigned long hash,
void * value,
struct rx_hash_rules * rules)
#else
-RX_DECL struct rx_hash_item *
+RX_DECL struct rx_hash_item *
rx_hash_find (table, hash, value, rules)
struct rx_hash * table;
unsigned long hash;
@@ -755,7 +755,7 @@ rx_hash_store (table, hash, value, rules)
long mask = rx_hash_masks[0];
int bucket = (hash & mask) % 13;
int depth = 0;
-
+
while (table->children [bucket])
{
table = table->children [bucket];
@@ -764,7 +764,7 @@ rx_hash_store (table, hash, value, rules)
bucket = (hash & mask) % 13;
++depth;
}
-
+
{
struct rx_hash_item * it = table->buckets[bucket];
while (it)
@@ -773,7 +773,7 @@ rx_hash_store (table, hash, value, rules)
else
it = it->next_same_hash;
}
-
+
{
if ( (depth < 3)
&& (table->bucket_size [bucket] >= 4))
@@ -848,7 +848,7 @@ rx_hash_free (it, rules)
: 0);
int bucket = (hash & rx_hash_masks [depth]) % 13;
struct rx_hash_item ** pos = &table->buckets [bucket];
-
+
while (*pos != it)
pos = &(*pos)->next_same_hash;
*pos = it->next_same_hash;
@@ -1238,7 +1238,7 @@ rx_free_rexp (rx, node)
case r_side_effect:
break;
-
+
case r_concat:
case r_alternate:
case r_2phase_star:
@@ -1258,11 +1258,11 @@ rx_free_rexp (rx, node)
#ifdef __STDC__
-RX_DECL struct rexp_node *
+RX_DECL struct rexp_node *
rx_copy_rexp (struct rx *rx,
struct rexp_node *node)
#else
-RX_DECL struct rexp_node *
+RX_DECL struct rexp_node *
rx_copy_rexp (rx, node)
struct rx *rx;
struct rexp_node *node;
@@ -1355,11 +1355,11 @@ rx_free_nfa_state (n)
* assigned after the nfa has been built.
*/
#ifdef __STDC__
-RX_DECL struct rx_nfa_state *
+RX_DECL struct rx_nfa_state *
rx_id_to_nfa_state (struct rx * rx,
int id)
#else
-RX_DECL struct rx_nfa_state *
+RX_DECL struct rx_nfa_state *
rx_id_to_nfa_state (rx, id)
struct rx * rx;
int id;
@@ -1373,18 +1373,18 @@ rx_id_to_nfa_state (rx, id)
}
-/* This adds an edge between two nodes, but doesn't initialize the
+/* This adds an edge between two nodes, but doesn't initialize the
* edge label.
*/
#ifdef __STDC__
-RX_DECL struct rx_nfa_edge *
+RX_DECL struct rx_nfa_edge *
rx_nfa_edge (struct rx *rx,
enum rx_nfa_etype type,
struct rx_nfa_state *start,
struct rx_nfa_state *dest)
#else
-RX_DECL struct rx_nfa_edge *
+RX_DECL struct rx_nfa_edge *
rx_nfa_edge (rx, type, start, dest)
struct rx *rx;
enum rx_nfa_etype type;
@@ -1419,14 +1419,14 @@ rx_free_nfa_edge (e)
/* This constructs a POSSIBLE_FUTURE, which is a kind epsilon-closure
* of an NFA. These are added to an nfa automaticly by eclose_nfa.
- */
+ */
#ifdef __STDC__
-static struct rx_possible_future *
+static struct rx_possible_future *
rx_possible_future (struct rx * rx,
struct rx_se_list * effects)
#else
-static struct rx_possible_future *
+static struct rx_possible_future *
rx_possible_future (rx, effects)
struct rx * rx;
struct rx_se_list * effects;
@@ -1505,17 +1505,17 @@ rx_free_nfa (rx)
-/* This page: translating a pattern expression into an nfa and doing the
+/* This page: translating a pattern expression into an nfa and doing the
* static part of the nfa->super-nfa translation.
*/
-/* This is the thompson regexp->nfa algorithm.
+/* This is the thompson regexp->nfa algorithm.
* It is modified to allow for `side-effect epsilons.' Those are
* edges that are taken whenever a similar epsilon edge would be,
- * but which imply that some side effect occurs when the edge
+ * but which imply that some side effect occurs when the edge
* is taken.
*
- * Side effects are used to model parts of the pattern langauge
+ * Side effects are used to model parts of the pattern langauge
* that are not regular (in the formal sense).
*/
@@ -1572,7 +1572,7 @@ rx_build_nfa (rx, rexp, start, end)
return 0;
}
return 1;
-
+
case r_opt:
return (rx_build_nfa (rx, rexp->params.pair.left, start, end)
&& rx_nfa_edge (rx, ne_epsilon, *start, *end));
@@ -1652,10 +1652,10 @@ rx_build_nfa (rx, rexp, start, end)
/* RX_NAME_NFA_STATES identifies all nodes with outgoing non-epsilon
- * transitions. Only these nodes can occur in super-states.
- * All nodes are given an integer id.
+ * transitions. Only these nodes can occur in super-states.
+ * All nodes are given an integer id.
* The id is non-negative if the node has non-epsilon out-transitions, negative
- * otherwise (this is because we want the non-negative ids to be used as
+ * otherwise (this is because we want the non-negative ids to be used as
* array indexes in a few places).
*/
@@ -1734,10 +1734,10 @@ rx_name_nfa_states (rx)
*/
#ifdef __STDC__
-static int
+static int
se_list_cmp (void * va, void * vb)
#else
-static int
+static int
se_list_cmp (va, vb)
void * va;
void * vb;
@@ -1761,10 +1761,10 @@ se_list_cmp (va, vb)
#ifdef __STDC__
-static int
+static int
se_list_equal (void * va, void * vb)
#else
-static int
+static int
se_list_equal (va, vb)
void * va;
void * vb;
@@ -1784,11 +1784,11 @@ static struct rx_hash_rules se_list_hash_rules =
#ifdef __STDC__
-static struct rx_se_list *
+static struct rx_se_list *
side_effect_cons (struct rx * rx,
void * se, struct rx_se_list * list)
#else
-static struct rx_se_list *
+static struct rx_se_list *
side_effect_cons (rx, se, list)
struct rx * rx;
void * se;
@@ -1840,7 +1840,7 @@ hash_cons_se_prog (rx, memo, car, cdr)
return (struct rx_se_list *)it->data;
}
}
-
+
#ifdef __STDC__
static struct rx_se_list *
@@ -1865,10 +1865,10 @@ hash_se_prog (rx, memo, prog)
}
#ifdef __STDC__
-static int
+static int
nfa_set_cmp (void * va, void * vb)
#else
-static int
+static int
nfa_set_cmp (va, vb)
void * va;
void * vb;
@@ -1891,10 +1891,10 @@ nfa_set_cmp (va, vb)
}
#ifdef __STDC__
-static int
+static int
nfa_set_equal (void * va, void * vb)
#else
-static int
+static int
nfa_set_equal (va, vb)
void * va;
void * vb;
@@ -1914,12 +1914,12 @@ static struct rx_hash_rules nfa_set_hash_rules =
#ifdef __STDC__
-static struct rx_nfa_state_set *
+static struct rx_nfa_state_set *
nfa_set_cons (struct rx * rx,
struct rx_hash * memo, struct rx_nfa_state * state,
struct rx_nfa_state_set * set)
#else
-static struct rx_nfa_state_set *
+static struct rx_nfa_state_set *
nfa_set_cons (rx, memo, state, set)
struct rx * rx;
struct rx_hash * memo;
@@ -1950,12 +1950,12 @@ nfa_set_cons (rx, memo, state, set)
#ifdef __STDC__
-static struct rx_nfa_state_set *
+static struct rx_nfa_state_set *
nfa_set_enjoin (struct rx * rx,
struct rx_hash * memo, struct rx_nfa_state * state,
struct rx_nfa_state_set * set)
#else
-static struct rx_nfa_state_set *
+static struct rx_nfa_state_set *
nfa_set_enjoin (rx, memo, state, set)
struct rx * rx;
struct rx_hash * memo;
@@ -1982,7 +1982,7 @@ nfa_set_enjoin (rx, memo, state, set)
/* This page: computing epsilon closures. The closures aren't total.
* Each node's closures are partitioned according to the side effects entailed
* along the epsilon edges. Return true on success.
- */
+ */
struct eclose_frame
{
@@ -1991,11 +1991,11 @@ struct eclose_frame
#ifdef __STDC__
-static int
+static int
eclose_node (struct rx *rx, struct rx_nfa_state *outnode,
struct rx_nfa_state *node, struct eclose_frame *frame)
#else
-static int
+static int
eclose_node (rx, outnode, node, frame)
struct rx *rx;
struct rx_nfa_state *outnode;
@@ -2060,7 +2060,7 @@ eclose_node (rx, outnode, node, frame)
break;
case ne_side_effect:
{
- frame->prog_backwards = side_effect_cons (rx,
+ frame->prog_backwards = side_effect_cons (rx,
e->params.side_effect,
frame->prog_backwards);
if (!frame->prog_backwards)
@@ -2085,10 +2085,10 @@ eclose_node (rx, outnode, node, frame)
#ifdef __STDC__
-RX_DECL int
+RX_DECL int
rx_eclose_nfa (struct rx *rx)
#else
-RX_DECL int
+RX_DECL int
rx_eclose_nfa (rx)
struct rx *rx;
#endif
@@ -2096,7 +2096,7 @@ rx_eclose_nfa (rx)
struct rx_nfa_state *n = rx->nfa_states;
struct eclose_frame frame;
static int rx_id = 0;
-
+
frame.prog_backwards = 0;
rx->rx_id = rx_id++;
bzero (&rx->se_list_memo, sizeof (rx->se_list_memo));
@@ -2119,10 +2119,10 @@ rx_eclose_nfa (rx)
*/
#ifdef __STDC__
-RX_DECL void
+RX_DECL void
rx_delete_epsilon_transitions (struct rx *rx)
#else
-RX_DECL void
+RX_DECL void
rx_delete_epsilon_transitions (rx)
struct rx *rx;
#endif
@@ -2160,16 +2160,16 @@ rx_delete_epsilon_transitions (rx)
*/
/* This is for qsort on an array of nfa_states. The order
- * is based on state ids and goes
+ * is based on state ids and goes
* [0...MAX][MIN..-1] where (MAX>=0) and (MIN<0)
* This way, positive ids double as array indices.
*/
#ifdef __STDC__
-static int
+static int
nfacmp (void * va, void * vb)
#else
-static int
+static int
nfacmp (va, vb)
void * va;
void * vb;
@@ -2186,10 +2186,10 @@ nfacmp (va, vb)
}
#ifdef __STDC__
-static int
+static int
count_hash_nodes (struct rx_hash * st)
#else
-static int
+static int
count_hash_nodes (st)
struct rx_hash * st;
#endif
@@ -2200,16 +2200,16 @@ count_hash_nodes (st)
count += ((st->children[x])
? count_hash_nodes (st->children[x])
: st->bucket_size[x]);
-
+
return count;
}
#ifdef __STDC__
-static void
+static void
se_memo_freer (struct rx_hash_item * node)
#else
-static void
+static void
se_memo_freer (node)
struct rx_hash_item * node;
#endif
@@ -2219,10 +2219,10 @@ se_memo_freer (node)
#ifdef __STDC__
-static void
+static void
nfa_set_freer (struct rx_hash_item * node)
#else
-static void
+static void
nfa_set_freer (node)
struct rx_hash_item * node;
#endif
@@ -2237,11 +2237,11 @@ nfa_set_freer (node)
*/
#ifdef __STDC__
-RX_DECL int
+RX_DECL int
rx_compactify_nfa (struct rx *rx,
void **mem, unsigned long *size)
#else
-RX_DECL int
+RX_DECL int
rx_compactify_nfa (rx, mem, size)
struct rx *rx;
void **mem;
@@ -2257,8 +2257,8 @@ rx_compactify_nfa (rx, mem, size)
unsigned long total_size;
/* This takes place in two stages. First, the total size of the
- * nfa is computed, then structures are copied.
- */
+ * nfa is computed, then structures are copied.
+ */
n = rx->nfa_states;
total_nodec = 0;
while (n)
@@ -2431,11 +2431,11 @@ rx_compactify_nfa (rx, mem, size)
/* The functions in the next several pages define the lazy-NFA-conversion used
- * by matchers. The input to this construction is an NFA such as
+ * by matchers. The input to this construction is an NFA such as
* is built by compactify_nfa (rx.c). The output is the superNFA.
*/
-/* Match engines can use arbitrary values for opcodes. So, the parse tree
+/* Match engines can use arbitrary values for opcodes. So, the parse tree
* is built using instructions names (enum rx_opcode), but the superstate
* nfa is populated with mystery opcodes (void *).
*
@@ -2508,16 +2508,16 @@ rx_cache_free (cache, freelist, mem)
}
-/* The partially instantiated superstate graph has a transition
+/* The partially instantiated superstate graph has a transition
* table at every node. There is one entry for every character.
* This fills in the transition for a set.
*/
#ifdef __STDC__
-static void
+static void
install_transition (struct rx_superstate *super,
- struct rx_inx *answer, rx_Bitset trcset)
+ struct rx_inx *answer, rx_Bitset trcset)
#else
-static void
+static void
install_transition (super, answer, trcset)
struct rx_superstate *super;
struct rx_inx *answer;
@@ -2585,14 +2585,14 @@ check_cache (cache)
check_cache (you_fucked_up);
}
-/* When a superstate is old and neglected, it can enter a
+/* When a superstate is old and neglected, it can enter a
* semi-free state. A semi-free state is slated to die.
* Incoming transitions to a semi-free state are re-written
* to cause an (interpreted) fault when they are taken.
* The fault handler revives the semi-free state, patches
* incoming transitions back to normal, and continues.
*
- * The idea is basicly to free in two stages, aborting
+ * The idea is basicly to free in two stages, aborting
* between the two if the state turns out to be useful again.
* When a free is aborted, the rescued superstate is placed
* in the most-favored slot to maximize the time until it
@@ -2669,11 +2669,11 @@ semifree_superstate (cache)
#ifdef __STDC__
-static void
+static void
refresh_semifree_superstate (struct rx_cache * cache,
struct rx_superstate * super)
#else
-static void
+static void
refresh_semifree_superstate (cache, super)
struct rx_cache * cache;
struct rx_superstate * super;
@@ -2683,7 +2683,7 @@ refresh_semifree_superstate (cache, super)
if (super->transition_refs)
{
- super->transition_refs->prev_same_dest->next_same_dest = 0;
+ super->transition_refs->prev_same_dest->next_same_dest = 0;
for (df = super->transition_refs; df; df = df->next_same_dest)
{
df->future_frame.inx = cache->instruction_table[rx_next_char];
@@ -2751,11 +2751,11 @@ rx_refresh_this_superstate (cache, superstate)
}
#ifdef __STDC__
-static void
+static void
release_superset_low (struct rx_cache * cache,
struct rx_superset *set)
#else
-static void
+static void
release_superset_low (cache, set)
struct rx_cache * cache;
struct rx_superset *set;
@@ -2780,11 +2780,11 @@ release_superset_low (cache, set)
}
#ifdef __STDC__
-RX_DECL void
+RX_DECL void
rx_release_superset (struct rx *rx,
struct rx_superset *set)
#else
-RX_DECL void
+RX_DECL void
rx_release_superset (rx, set)
struct rx *rx;
struct rx_superset *set;
@@ -2894,8 +2894,8 @@ rx_really_free_superstate (cache)
{
struct rx_distinct_future *dft = df;
df = df->next_same_super_edge[0];
-
-
+
+
if (dft->future && dft->future->transition_refs == dft)
{
dft->future->transition_refs = dft->next_same_dest;
@@ -2911,7 +2911,7 @@ rx_really_free_superstate (cache)
tc = tct;
}
}
-
+
if (it->contents->superstate == it)
it->contents->superstate = 0;
release_superset_low (cache, it->contents);
@@ -3049,10 +3049,10 @@ superset_allocator (rules, val)
}
#ifdef __STDC__
-static struct rx_hash *
+static struct rx_hash *
super_hash_allocator (struct rx_hash_rules * rules)
#else
-static struct rx_hash *
+static struct rx_hash *
super_hash_allocator (rules)
struct rx_hash_rules * rules;
#endif
@@ -3139,7 +3139,7 @@ rx_morecore (cache)
while (*pos)
pos = &(*pos)->next;
*pos = ((struct rx_blocklist *)
- malloc (size + sizeof (struct rx_blocklist)));
+ malloc (size + sizeof (struct rx_blocklist)));
if (!*pos)
return;
@@ -3151,7 +3151,7 @@ rx_morecore (cache)
}
}
-static struct rx_cache default_cache =
+static struct rx_cache default_cache =
{
{
supersetcmp,
@@ -3197,7 +3197,7 @@ static struct rx_cache default_cache =
/* This adds an element to a superstate set. These sets are lists, such
* that lists with == elements are ==. The empty set is returned by
- * superset_cons (rx, 0, 0) and is NOT equivelent to
+ * superset_cons (rx, 0, 0) and is NOT equivelent to
* (struct rx_superset)0.
*/
@@ -3253,7 +3253,7 @@ rx_superset_cons (rx, car, cdr)
#ifdef __STDC__
RX_DECL struct rx_superset *
rx_superstate_eclosure_union
- (struct rx * rx, struct rx_superset *set, struct rx_nfa_state_set *ecl)
+ (struct rx * rx, struct rx_superset *set, struct rx_nfa_state_set *ecl)
#else
RX_DECL struct rx_superset *
rx_superstate_eclosure_union (rx, set, ecl)
@@ -3310,14 +3310,14 @@ rx_superstate_eclosure_union (rx, set, ecl)
* This makes sure that a list of rx_distinct_futures contains
* a future for each possible set of side effects in the eclosure
* of a given state. This is some of the work of filling in a
- * superstate transition.
+ * superstate transition.
*/
#ifdef __STDC__
static struct rx_distinct_future *
include_futures (struct rx *rx,
struct rx_distinct_future *df, struct rx_nfa_state
- *state, struct rx_superstate *superstate)
+ *state, struct rx_superstate *superstate)
#else
static struct rx_distinct_future *
include_futures (rx, df, state, superstate)
@@ -3391,7 +3391,7 @@ include_futures (rx, df, state, superstate)
-/* This constructs a new superstate from its state set. The only
+/* This constructs a new superstate from its state set. The only
* complexity here is memory management.
*/
#ifdef __STDC__
@@ -3526,10 +3526,10 @@ rx_superstate (rx, set)
*/
#ifdef __STDC__
-static int
+static int
solve_destination (struct rx *rx, struct rx_distinct_future *df)
#else
-static int
+static int
solve_destination (rx, df)
struct rx *rx;
struct rx_distinct_future *df;
@@ -3550,7 +3550,7 @@ solve_destination (rx, df)
struct rx_nfa_edge *e;
/* Iterate over all edges of each NFA state. */
for (e = nfa_state->car->edges; e; e = e->next)
- /* If we find an edge that is labeled with
+ /* If we find an edge that is labeled with
* the characters we are solving for.....
*/
if (rx_bitset_is_subset (rx->local_cset_size,
@@ -3578,7 +3578,7 @@ solve_destination (rx, df)
}
}
}
- /* It is possible that the RX_DISTINCT_FUTURE we are working on has
+ /* It is possible that the RX_DISTINCT_FUTURE we are working on has
* the empty set of NFA states as its definition. In that case, this
* is a failure point.
*/
@@ -3623,20 +3623,20 @@ solve_destination (rx, df)
/* This takes a superstate and a character, and computes some edges
* from the superstate NFA. In particular, this computes all edges
- * that lead from SUPERSTATE given CHR. This function also
+ * that lead from SUPERSTATE given CHR. This function also
* computes the set of characters that share this edge set.
* This returns 0 on allocation error.
- * The character set and list of edges are returned through
+ * The character set and list of edges are returned through
* the paramters CSETOUT and DFOUT.
} */
#ifdef __STDC__
-static int
+static int
compute_super_edge (struct rx *rx, struct rx_distinct_future **dfout,
rx_Bitset csetout, struct rx_superstate *superstate,
- unsigned char chr)
+ unsigned char chr)
#else
-static int
+static int
compute_super_edge (rx, dfout, csetout, superstate, chr)
struct rx *rx;
struct rx_distinct_future **dfout;
@@ -3647,7 +3647,7 @@ compute_super_edge (rx, dfout, csetout, superstate, chr)
{
struct rx_superset *stateset = superstate->contents;
- /* To compute the set of characters that share edges with CHR,
+ /* To compute the set of characters that share edges with CHR,
* we start with the full character set, and subtract.
*/
rx_bitset_universe (rx->local_cset_size, csetout);
@@ -3719,7 +3719,7 @@ compute_super_edge (rx, dfout, csetout, superstate, chr)
static struct rx_super_edge *
rx_super_edge (struct rx *rx,
struct rx_superstate *super, rx_Bitset cset,
- struct rx_distinct_future *df)
+ struct rx_distinct_future *df)
#else
static struct rx_super_edge *
rx_super_edge (rx, super, cset, df)
@@ -3791,7 +3791,7 @@ install_partial_transition (super, answer, set, offset)
int end = start + 32;
RX_subset pos = 1;
struct rx_inx * transitions = super->transitions;
-
+
while (start < end)
{
if (set & pos)
@@ -3805,7 +3805,7 @@ install_partial_transition (super, answer, set, offset)
#ifdef __STDC__
RX_DECL struct rx_inx *
rx_handle_cache_miss
- (struct rx *rx, struct rx_superstate *super, unsigned char chr, void *data)
+ (struct rx *rx, struct rx_superstate *super, unsigned char chr, void *data)
#else
RX_DECL struct rx_inx *
rx_handle_cache_miss (rx, super, chr, data)
@@ -3882,7 +3882,7 @@ rx_handle_cache_miss (rx, super, chr, data)
}
else if (df->future) /* A cache miss on an edge with a future? Must be
* a semi-free destination. */
- {
+ {
if (df->future->is_semifree)
refresh_semifree_superstate (rx->cache, df->future);
return &df->future_frame;
@@ -3934,7 +3934,7 @@ __const__ char *re_error_msg[] =
-/*
+/*
* Macros used while compiling patterns.
*
* By convention, PEND points just past the end of the uncompiled pattern,
@@ -3945,7 +3945,7 @@ __const__ char *re_error_msg[] =
/*
- * Fetch the next character in the uncompiled pattern---translating it
+ * Fetch the next character in the uncompiled pattern---translating it
* if necessary. *Also cast from a signed character in the constant
* string passed to us by the user to an unsigned char that we can use
* as an array index (in, e.g., `translate').
@@ -3956,7 +3956,7 @@ __const__ char *re_error_msg[] =
c = translate[c]; \
} while (0)
-/*
+/*
* Fetch the next character in the uncompiled pattern, with no
* translation.
*/
@@ -4023,7 +4023,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -4040,7 +4040,7 @@ typedef struct
/* P points to just after a ^ in PATTERN. Return true if that ^ comes
* after an alternative or a begin-subexpression. We assume there is at
- * least one character before the ^.
+ * least one character before the ^.
*/
#ifdef __STDC__
@@ -4056,9 +4056,9 @@ at_begline_loc_p (pattern, p, syntax)
{
__const__ char *prev = p - 2;
boolean prev_prev_backslash = ((prev > pattern) && (prev[-1] == '\\'));
-
+
return
-
+
(/* After a subexpression? */
((*prev == '(') && ((syntax & RE_NO_BK_PARENS) || prev_prev_backslash))
||
@@ -4085,7 +4085,7 @@ at_endline_loc_p (p, pend, syntax)
__const__ char *next = p;
boolean next_backslash = (*next == '\\');
__const__ char *next_next = (p + 1 < pend) ? (p + 1) : 0;
-
+
return
(
/* Before a subexpression? */
@@ -4154,7 +4154,7 @@ inverse_translation (rxb, valid, cache, translate, c)
#endif
{
rx_Bitset cs
- = cache + c * rx_bitset_numb_subsets (rxb->rx.local_cset_size);
+ = cache + c * rx_bitset_numb_subsets (rxb->rx.local_cset_size);
if (!valid[c])
{
@@ -4174,7 +4174,7 @@ inverse_translation (rxb, valid, cache, translate, c)
/* More subroutine declarations and macros for regex_compile. */
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
false if it's not. */
#ifdef __STDC__
@@ -4189,8 +4189,8 @@ group_in_compile_stack (compile_stack, regnum)
{
int this_element;
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
this_element--)
if (compile_stack.stack[this_element].regnum == regnum)
return true;
@@ -4205,11 +4205,11 @@ group_in_compile_stack (compile_stack, regnum)
* starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
* Then we set the translation of all bits between the starting and
* ending characters (inclusive) in the compiled pattern B.
- *
+ *
* Return an error code.
- *
+ *
* We use these short variable names so we can use the same macros as
- * `regex_compile' itself.
+ * `regex_compile' itself.
*/
#ifdef __STDC__
@@ -4254,7 +4254,7 @@ compile_range (rxb, cs, p_ptr, pend, translate, syntax, inv_tr, valid_inv_tr)
inverse_translation (rxb, valid_inv_tr, inv_tr, translate, this_char);
rx_bitset_union (rxb->rx.local_cset_size, cs, it);
}
-
+
return REG_NOERROR;
}
@@ -4396,7 +4396,7 @@ is_anchored (rexp, se)
case r_opt:
case r_star:
return is_anchored (rexp->params.pair.left, se) ? 2 : 0;
-
+
case r_side_effect:
return ((rexp->params.side_effect == se)
? 1 : 2);
@@ -4410,7 +4410,7 @@ is_anchored (rexp, se)
/* This removes register assignments that aren't required by backreferencing.
* This can speed up explore_future, especially if it eliminates
* non-determinism in the superstate NFA.
- *
+ *
* NEEDED is an array of characters, presumably filled in by FIND_BACKREFS.
* The non-zero elements of the array indicate which register assignments
* can NOT be removed from the expression.
@@ -4618,7 +4618,7 @@ static char idempotent_complex_se[] =
#define RX_WANT_SE_DEFS 1
#undef RX_DEF_SE
#undef RX_DEF_CPLX_SE
-#define RX_DEF_SE(IDEM, NAME, VALUE)
+#define RX_DEF_SE(IDEM, NAME, VALUE)
#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE) IDEM,
#include "rx.h"
#undef RX_DEF_SE
@@ -4634,7 +4634,7 @@ static char idempotent_se[] =
#undef RX_DEF_SE
#undef RX_DEF_CPLX_SE
#define RX_DEF_SE(IDEM, NAME, VALUE) IDEM,
-#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE)
+#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE)
#include "rx.h"
#undef RX_DEF_SE
#undef RX_DEF_CPLX_SE
@@ -4667,7 +4667,7 @@ has_any_se (rx, rexp)
case r_side_effect:
return 1;
-
+
case r_2phase_star:
case r_concat:
case r_alternate:
@@ -4715,7 +4715,7 @@ has_non_idempotent_epsilon_path (rx, rexp, params)
!((long)rexp->params.side_effect > 0
? idempotent_complex_se [ params [(long)rexp->params.side_effect].se ]
: idempotent_se [-(long)rexp->params.side_effect]);
-
+
case r_alternate:
return
( has_non_idempotent_epsilon_path (rx,
@@ -4742,7 +4742,7 @@ has_non_idempotent_epsilon_path (rx, rexp, params)
-/* This computes rougly what it's name suggests. It can (and does) go wrong
+/* This computes rougly what it's name suggests. It can (and does) go wrong
* in the direction of returning spurious 0 without causing disasters.
*/
#ifdef __STDC__
@@ -4766,7 +4766,7 @@ begins_with_complex_se (rx, rexp)
case r_side_effect:
return ((long)rexp->params.side_effect >= 0);
-
+
case r_alternate:
return
( begins_with_complex_se (rx, rexp->params.pair.left)
@@ -4786,11 +4786,11 @@ begins_with_complex_se (rx, rexp)
}
-/* This destructively removes some of the re_se_tv side effects from
+/* This destructively removes some of the re_se_tv side effects from
* a rexp tree. In particular, during parsing re_se_tv was inserted on the
- * right half of every | to guarantee that posix path preference could be
- * honored. This function removes some which it can be determined aren't
- * needed.
+ * right half of every | to guarantee that posix path preference could be
+ * honored. This function removes some which it can be determined aren't
+ * needed.
*/
#ifdef __STDC__
@@ -4832,7 +4832,7 @@ speed_up_alt (rx, rexp, unposix)
speed_up_alt (rx, rexp->params.pair.left, unposix);
speed_up_alt (rx, rexp->params.pair.right->params.pair.right, unposix);
-
+
if ( unposix
|| (begins_with_complex_se
(rx, rexp->params.pair.right->params.pair.right))
@@ -4865,7 +4865,7 @@ speed_up_alt (rx, rexp, unposix)
`fastmap_accurate' is set to zero;
`re_nsub' is set to the number of groups in PATTERN;
`not_bol' and `not_eol' are set to zero.
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -4875,7 +4875,7 @@ speed_up_alt (rx, rexp, unposix)
RX_DECL reg_errcode_t
rx_compile (__const__ char *pattern, int size,
reg_syntax_t syntax,
- struct re_pattern_buffer * rxb)
+ struct re_pattern_buffer * rxb)
#else
RX_DECL reg_errcode_t
rx_compile (pattern, size, syntax, rxb)
@@ -4894,17 +4894,17 @@ rx_compile (pattern, size, syntax, rxb)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
__const__ char *p1;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
__const__ char *p = pattern;
__const__ char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
unsigned char *translate = (rxb->translate
? rxb->translate
@@ -4913,7 +4913,7 @@ rx_compile (pattern, size, syntax, rxb)
/* When parsing is done, this will hold the expression tree. */
struct rexp_node * rexp = 0;
- /* In the midst of compilation, this holds onto the regexp
+ /* In the midst of compilation, this holds onto the regexp
* first parst while rexp goes on to aquire additional constructs.
*/
struct rexp_node * orig_rexp = 0;
@@ -4922,7 +4922,7 @@ rx_compile (pattern, size, syntax, rxb)
/* This and top_expression are saved on the compile stack. */
struct rexp_node ** top_expression = &rexp;
struct rexp_node ** last_expression = top_expression;
-
+
/* Parameter to `goto append_node' */
struct rexp_node * append;
@@ -4932,7 +4932,7 @@ rx_compile (pattern, size, syntax, rxb)
regnum_t regnum = 0;
/* Place in the uncompiled pattern (i.e., the {) to
- * which to go back if the interval is invalid.
+ * which to go back if the interval is invalid.
*/
__const__ char *beg_interval;
@@ -4960,8 +4960,8 @@ rx_compile (pattern, size, syntax, rxb)
rxb->fastmap_accurate = 0;
rxb->not_bol = rxb->not_eol = 0;
rxb->least_subs = 0;
-
- /* Always count groups, whether or not rxb->no_sub is set.
+
+ /* Always count groups, whether or not rxb->no_sub is set.
* The whole pattern is implicitly group 0, so counting begins
* with 1.
*/
@@ -5004,7 +5004,7 @@ rx_compile (pattern, size, syntax, rxb)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -5171,7 +5171,7 @@ rx_compile (pattern, size, syntax, rxb)
goto add_side_effect;
}
}
- /* The old regex.c used to optimize `.*\n'.
+ /* The old regex.c used to optimize `.*\n'.
* Maybe rx should too?
*/
}
@@ -5204,36 +5204,36 @@ rx_compile (pattern, size, syntax, rxb)
rx_Bitset cs = rx_cset (&rxb->rx);
struct rexp_node * node = rx_mk_r_cset (&rxb->rx, cs);
int is_inverted = *p == '^';
-
+
if (!(node && cs))
return REG_ESPACE;
-
+
/* This branch of the switch is normally exited with
*`goto append_node'
*/
append = node;
-
+
if (is_inverted)
p++;
-
+
/* Remember the first position in the bracket expression. */
p1 = p;
-
+
/* Read in characters and ranges, setting map bits. */
for (;;)
{
if (p == pend) return REG_EBRACK;
-
+
PATFETCH (c);
-
+
/* \ might escape characters inside [...] and [^...]. */
if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
{
if (p == pend) return REG_EESCAPE;
-
+
PATFETCH (c1);
{
- rx_Bitset it = inverse_translation (rxb,
+ rx_Bitset it = inverse_translation (rxb,
validate_inv_tr,
inverse_translate,
translate,
@@ -5242,24 +5242,24 @@ rx_compile (pattern, size, syntax, rxb)
}
continue;
}
-
+
/* Could be the end of the bracket expression. If it's
not (i.e., when the bracket expression is `[]' so
far), the ']' character bit gets set way below. */
if (c == ']' && p != p1 + 1)
goto finalize_class_and_append;
-
+
/* Look ahead to see if it's a range when the last thing
was a character class. */
if (had_char_class && c == '-' && *p != ']')
return REG_ERANGE;
-
+
/* Look ahead to see if it's a range when the last thing
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
&& !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
&& *p != ']')
{
@@ -5268,33 +5268,33 @@ rx_compile (pattern, size, syntax, rxb)
inverse_translate, validate_inv_tr);
if (ret != REG_NOERROR) return ret;
}
-
+
else if (p[0] == '-' && p[1] != ']')
{ /* This handles ranges made up of characters only. */
reg_errcode_t ret;
-
+
/* Move past the `-'. */
PATFETCH (c1);
-
+
ret = compile_range (rxb, cs, &p, pend, translate, syntax,
inverse_translate, validate_inv_tr);
if (ret != REG_NOERROR) return ret;
}
-
+
/* See if we're at the beginning of a possible character
class. */
-
+
else if ((syntax & RE_CHAR_CLASSES)
&& (c == '[') && (*p == ':'))
{
char str[CHAR_CLASS_MAX_LENGTH + 1];
-
+
PATFETCH (c);
c1 = 0;
-
+
/* If pattern is `[[:'. */
if (p == pend) return REG_EBRACK;
-
+
for (;;)
{
PATFETCH (c);
@@ -5304,9 +5304,9 @@ rx_compile (pattern, size, syntax, rxb)
str[c1++] = c;
}
str[c1] = '\0';
-
+
/* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
+ undo the ending character, the letters, and leave
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
@@ -5323,15 +5323,15 @@ rx_compile (pattern, size, syntax, rxb)
boolean is_space = !strcmp (str, "space");
boolean is_upper = !strcmp (str, "upper");
boolean is_xdigit = !strcmp (str, "xdigit");
-
+
if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
-
+
/* Throw away the ] at the end of the character
class. */
- PATFETCH (c);
-
+ PATFETCH (c);
+
if (p == pend) return REG_EBRACK;
-
+
for (ch = 0; ch < 1 << CHARBITS; ch++)
{
if ( (is_alnum && isalnum (ch))
@@ -5348,7 +5348,7 @@ rx_compile (pattern, size, syntax, rxb)
|| (is_xdigit && isxdigit (ch)))
{
rx_Bitset it =
- inverse_translation (rxb,
+ inverse_translation (rxb,
validate_inv_tr,
inverse_translate,
translate,
@@ -5362,11 +5362,11 @@ rx_compile (pattern, size, syntax, rxb)
else
{
c1++;
- while (c1--)
+ while (c1--)
PATUNFETCH;
{
rx_Bitset it =
- inverse_translation (rxb,
+ inverse_translation (rxb,
validate_inv_tr,
inverse_translate,
translate,
@@ -5376,7 +5376,7 @@ rx_compile (pattern, size, syntax, rxb)
}
{
rx_Bitset it =
- inverse_translation (rxb,
+ inverse_translation (rxb,
validate_inv_tr,
inverse_translate,
translate,
@@ -5391,7 +5391,7 @@ rx_compile (pattern, size, syntax, rxb)
{
had_char_class = false;
{
- rx_Bitset it = inverse_translation (rxb,
+ rx_Bitset it = inverse_translation (rxb,
validate_inv_tr,
inverse_translate,
translate,
@@ -5466,7 +5466,7 @@ rx_compile (pattern, size, syntax, rxb)
rxb->re_nsub++;
regnum++;
if (COMPILE_STACK_FULL)
- {
+ {
((compile_stack.stack) =
(compile_stack_elt_t *) realloc (compile_stack.stack, ( compile_stack.size << 1) * sizeof (
compile_stack_elt_t)));
@@ -5487,14 +5487,14 @@ rx_compile (pattern, size, syntax, rxb)
/*
* These are the values to restore when we hit end of this
- * group.
+ * group.
*/
COMPILE_STACK_TOP.top_expression = top_expression;
COMPILE_STACK_TOP.last_expression = last_expression;
COMPILE_STACK_TOP.regnum = regnum;
-
+
compile_stack.avail++;
-
+
top_expression = last_expression;
break;
@@ -5608,10 +5608,10 @@ rx_compile (pattern, size, syntax, rxb)
break;
- case '{':
+ case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
+ /* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
@@ -5650,11 +5650,11 @@ rx_compile (pattern, size, syntax, rxb)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
- if (!(syntax & RE_NO_BK_BRACES))
+ if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') return REG_EBRACE;
PATFETCH (c);
@@ -5664,7 +5664,7 @@ rx_compile (pattern, size, syntax, rxb)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
@@ -5760,7 +5760,7 @@ rx_compile (pattern, size, syntax, rxb)
beg_interval = 0;
/* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
+ PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES))
{
@@ -5793,7 +5793,7 @@ rx_compile (pattern, size, syntax, rxb)
enum syntaxcode code = syntax_spec_code [c];
for (x = 0; x < 256; ++x)
{
-
+
if (SYNTAX (x) == code)
{
rx_Bitset it =
@@ -5833,7 +5833,7 @@ rx_compile (pattern, size, syntax, rxb)
/* With a little extra work, some of these side effects could be optimized
* away (basicly by looking at what we already know about the surrounding
- * chars).
+ * chars).
*/
case '<':
side = (rx_side_effect)re_se_wordbeg;
@@ -5859,7 +5859,7 @@ rx_compile (pattern, size, syntax, rxb)
side = (rx_side_effect)re_se_begbuf;
goto add_side_effect;
break;
-
+
case '\'':
side = (rx_side_effect)re_se_endbuf;
goto add_side_effect;
@@ -5959,7 +5959,7 @@ rx_compile (pattern, size, syntax, rxb)
} /* switch (c) */
} /* while p != pend */
-
+
{
int win_se = paramc;
params = (params
@@ -5986,7 +5986,7 @@ rx_compile (pattern, size, syntax, rxb)
/* Through the pattern now. */
- if (!COMPILE_STACK_EMPTY)
+ if (!COMPILE_STACK_EMPTY)
return REG_EPAREN;
free (compile_stack.stack);
@@ -6037,11 +6037,11 @@ rx_compile (pattern, size, syntax, rxb)
}
}
- /* At least one more optimization would be nice to have here but i ran out
- * of time. The idea would be to delay side effects.
+ /* At least one more optimization would be nice to have here but i ran out
+ * of time. The idea would be to delay side effects.
* For examle, `(abc)' is the same thing as `abc()' except that the
* left paren is offset by 3 (which we know at compile time).
- * (In this comment, write that second pattern `abc(:3:)'
+ * (In this comment, write that second pattern `abc(:3:)'
* where `(:3:' is a syntactic unit.)
*
* Trickier: `(abc|defg)' is the same as `(abc(:3:|defg(:4:))'
@@ -6055,7 +6055,7 @@ rx_compile (pattern, size, syntax, rxb)
/* What we compile is different than what the parser returns.
* Suppose the parser returns expression R.
- * Let R' be R with unnecessary register assignments removed
+ * Let R' be R with unnecessary register assignments removed
* (see REMOVE_UNECESSARY_SIDE_EFFECTS, above).
*
* What we will compile is the expression:
@@ -6063,8 +6063,8 @@ rx_compile (pattern, size, syntax, rxb)
* m{try}R{win}\|s{try}R'{win}
*
* {try} and {win} denote side effect epsilons (see EXPLORE_FUTURE).
- *
- * When trying a match, we insert an `m' at the beginning of the
+ *
+ * When trying a match, we insert an `m' at the beginning of the
* string if the user wants registers to be filled, `s' if not.
*/
new_rexp =
@@ -6119,7 +6119,7 @@ rx_compile (pattern, size, syntax, rxb)
else
{
rx_delete_epsilon_transitions (&rxb->rx);
-
+
/* For compatability reasons, we need to shove the
* compiled nfa into one chunk of malloced memory.
*/
@@ -6150,7 +6150,7 @@ rx_compile (pattern, size, syntax, rxb)
rx_bitset_null (rxb->rx.local_cset_size, rxb->fastset);
rxb->can_match_empty = compute_fastset (rxb, orig_rexp);
rxb->match_regs_on_stack =
- registers_on_stack (rxb, orig_rexp, 0, params);
+ registers_on_stack (rxb, orig_rexp, 0, params);
rxb->search_regs_on_stack =
registers_on_stack (rxb, fewer_side_effects, 0, params);
if (rxb->can_match_empty)
@@ -6245,7 +6245,7 @@ rx_blow_up_fastmap (rxb)
#define RE_S2_QUAL static
#else
#define RE_SEARCH_2_FN re_search_2
-#define RE_S2_QUAL
+#define RE_S2_QUAL
#endif
struct re_search_2_closure
@@ -6408,7 +6408,7 @@ re_search_2_fetch_char (pos, offset, app_closure, stop)
else
return pos->pos[1];
}
-
+
#ifdef __STDC__
RE_S2_QUAL int
@@ -6684,10 +6684,10 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
#ifdef __STDC__
-static int
+static int
cplx_se_sublist_len (struct rx_se_list * list)
#else
-static int
+static int
cplx_se_sublist_len (list)
struct rx_se_list * list;
#endif
@@ -6706,11 +6706,11 @@ cplx_se_sublist_len (list)
/* For rx->se_list_cmp */
#ifdef __STDC__
-static int
+static int
posix_se_list_order (struct rx * rx,
struct rx_se_list * a, struct rx_se_list * b)
#else
-static int
+static int
posix_se_list_order (rx, a, b)
struct rx * rx;
struct rx_se_list * a;
@@ -6724,7 +6724,7 @@ posix_se_list_order (rx, a, b)
return ((a == b)
? 0
: ((a < b) ? -1 : 1));
-
+
else if (!al)
return -1;
@@ -6740,7 +6740,7 @@ posix_se_list_order (rx, a, b)
struct rx_se_list * ap = a;
struct rx_se_list * bp = b;
int ai, bi;
-
+
for (ai = al - 1; ai >= 0; --ai)
{
while ((long)ap->car < 0)
@@ -6809,7 +6809,7 @@ re_compile_pattern (pattern, length, rxb)
/* Match anchors at newline. */
rxb->newline_anchor = 1;
-
+
rxb->re_nsub = 0;
rxb->start = 0;
rxb->se_params = 0;
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)