mirror of
https://github.com/westes/flex.git
synced 2026-01-27 01:44:23 +00:00
refactor: Rename scinstal() 'xcluflg' parameter
It meant "exclusive flag" but was abbreviated poorly. We don't have tight constraints on variable naming now, so rename it to 'sc_is_exclusive'. Also use 'bool' type for the parameter.
This commit is contained in:
parent
b7d76db200
commit
3c97166fbd
@ -1041,7 +1041,7 @@ extern char *ndlookup(const char *); /* lookup a name definition */
|
||||
|
||||
/* Increase maximum number of SC's. */
|
||||
extern void scextend(void);
|
||||
extern void scinstal(const char *, int); /* make a start condition */
|
||||
extern void scinstal(const char *, bool); /* make a start condition */
|
||||
|
||||
/* Lookup the number associated with a start condition. */
|
||||
extern int sclookup(const char *);
|
||||
|
||||
10
src/parse.y
10
src/parse.y
@ -70,7 +70,7 @@
|
||||
int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
|
||||
static int currccl;
|
||||
bool trlcontxt;
|
||||
static bool xcluflg, cclsorted, varlength, variable_trail_rule;
|
||||
static bool sc_is_exclusive, cclsorted, varlength, variable_trail_rule;
|
||||
|
||||
int *scon_stk;
|
||||
int scon_stk_ptr;
|
||||
@ -174,17 +174,17 @@ sect1end : SECTEND
|
||||
;
|
||||
|
||||
startconddecl : SCDECL
|
||||
{ xcluflg = false; }
|
||||
{ sc_is_exclusive = false; }
|
||||
|
||||
| XSCDECL
|
||||
{ xcluflg = true; }
|
||||
{ sc_is_exclusive = true; }
|
||||
;
|
||||
|
||||
namelist1 : namelist1 NAME
|
||||
{ scinstal( nmstr, xcluflg ); }
|
||||
{ scinstal( nmstr, sc_is_exclusive ); }
|
||||
|
||||
| NAME
|
||||
{ scinstal( nmstr, xcluflg ); }
|
||||
{ scinstal( nmstr, sc_is_exclusive ); }
|
||||
|
||||
| error
|
||||
{ synerr( _("bad start condition list") ); }
|
||||
|
||||
10
src/sym.c
10
src/sym.c
@ -204,13 +204,9 @@ void scextend (void)
|
||||
}
|
||||
|
||||
|
||||
/* scinstal - make a start condition
|
||||
*
|
||||
* NOTE
|
||||
* The start condition is "exclusive" if xcluflg is true.
|
||||
*/
|
||||
/* scinstal - make a start condition */
|
||||
|
||||
void scinstal (const char *str, int xcluflg)
|
||||
void scinstal (const char *str, bool sc_is_exclusive)
|
||||
{
|
||||
|
||||
if (++lastsc >= current_max_scs)
|
||||
@ -224,7 +220,7 @@ void scinstal (const char *str, int xcluflg)
|
||||
|
||||
scset[lastsc] = mkstate (SYM_EPSILON);
|
||||
scbol[lastsc] = mkstate (SYM_EPSILON);
|
||||
scxclu[lastsc] = xcluflg;
|
||||
scxclu[lastsc] = sc_is_exclusive ? 1 : 0;
|
||||
sceof[lastsc] = false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user