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:
Explorer09 2024-04-30 18:44:38 +08:00
parent b7d76db200
commit 3c97166fbd
3 changed files with 9 additions and 13 deletions

View File

@ -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 *);

View File

@ -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") ); }

View File

@ -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;
}