mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-04 14:03:53 +01:00
Rename some variables to use English abbreviations
This commit is contained in:
parent
daa8b6d761
commit
05019d688c
@ -126,9 +126,9 @@ typedef struct {
|
||||
|
||||
reprule_t *current_rule;
|
||||
reprule_t *reprules; /* applied when drawing a box */
|
||||
size_t anz_reprules;
|
||||
size_t num_reprules;
|
||||
reprule_t *revrules; /* applied upon removal of a box */
|
||||
size_t anz_revrules;
|
||||
size_t num_revrules;
|
||||
} design_t;
|
||||
|
||||
extern design_t *designs;
|
||||
|
12
src/input.c
12
src/input.c
@ -95,7 +95,7 @@ static int get_indent(const line_t *lines, const size_t lines_size)
|
||||
|
||||
int apply_substitutions(input_t *result, const int mode)
|
||||
{
|
||||
size_t anz_rules;
|
||||
size_t num_rules;
|
||||
reprule_t *rules;
|
||||
size_t j, k;
|
||||
|
||||
@ -104,11 +104,11 @@ int apply_substitutions(input_t *result, const int mode)
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
anz_rules = opt.design->anz_reprules;
|
||||
num_rules = opt.design->num_reprules;
|
||||
rules = opt.design->reprules;
|
||||
}
|
||||
else if (mode == 1) {
|
||||
anz_rules = opt.design->anz_revrules;
|
||||
num_rules = opt.design->num_revrules;
|
||||
rules = opt.design->revrules;
|
||||
}
|
||||
else {
|
||||
@ -120,11 +120,11 @@ int apply_substitutions(input_t *result, const int mode)
|
||||
* Compile regular expressions
|
||||
*/
|
||||
#ifdef REGEXP_DEBUG
|
||||
fprintf(stderr, "Compiling %d %s rule patterns\n", (int) anz_rules, mode ? "reversion" : "replacement");
|
||||
fprintf(stderr, "Compiling %d %s rule patterns\n", (int) num_rules, mode ? "reversion" : "replacement");
|
||||
#endif
|
||||
errno = 0;
|
||||
opt.design->current_rule = rules;
|
||||
for (j = 0; j < anz_rules; ++j, ++(opt.design->current_rule)) {
|
||||
for (j = 0; j < num_rules; ++j, ++(opt.design->current_rule)) {
|
||||
rules[j].prog = u32_compile_pattern(rules[j].search->memory);
|
||||
if (rules[j].prog == NULL) {
|
||||
return 5;
|
||||
@ -140,7 +140,7 @@ int apply_substitutions(input_t *result, const int mode)
|
||||
*/
|
||||
for (k = 0; k < result->num_lines; ++k) {
|
||||
opt.design->current_rule = rules;
|
||||
for (j = 0; j < anz_rules; ++j, ++(opt.design->current_rule)) {
|
||||
for (j = 0; j < num_rules; ++j, ++(opt.design->current_rule)) {
|
||||
#ifdef REGEXP_DEBUG
|
||||
char *outtext = bxs_to_output(result->lines[k].text);
|
||||
char *outrepstr = bxs_to_output(rules[j].repstr);
|
||||
|
12
src/list.c
12
src/list.c
@ -239,12 +239,12 @@ static void print_design_details(design_t *d)
|
||||
}
|
||||
|
||||
fprintf(opt.outfile, "Replacement Rules: ");
|
||||
if (d->anz_reprules > 0) {
|
||||
for (int i = 0; i < (int) d->anz_reprules; ++i) {
|
||||
if (d->num_reprules > 0) {
|
||||
for (int i = 0; i < (int) d->num_reprules; ++i) {
|
||||
fprintf(opt.outfile, "%d. (%s) \"%s\" WITH \"%s\"%s", i + 1,
|
||||
d->reprules[i].mode == 'g' ? "glob" : "once",
|
||||
bxs_to_output(d->reprules[i].search), bxs_to_output(d->reprules[i].repstr), opt.eol);
|
||||
if (i < (int) d->anz_reprules - 1) {
|
||||
if (i < (int) d->num_reprules - 1) {
|
||||
fprintf(opt.outfile, " ");
|
||||
}
|
||||
}
|
||||
@ -253,12 +253,12 @@ static void print_design_details(design_t *d)
|
||||
fprintf(opt.outfile, "none%s", opt.eol);
|
||||
}
|
||||
fprintf(opt.outfile, "Reversion Rules: ");
|
||||
if (d->anz_revrules > 0) {
|
||||
for (int i = 0; i < (int) d->anz_revrules; ++i) {
|
||||
if (d->num_revrules > 0) {
|
||||
for (int i = 0; i < (int) d->num_revrules; ++i) {
|
||||
fprintf(opt.outfile, "%d. (%s) \"%s\" TO \"%s\"%s", i + 1,
|
||||
d->revrules[i].mode == 'g' ? "glob" : "once",
|
||||
bxs_to_output(d->revrules[i].search), bxs_to_output(d->revrules[i].repstr), opt.eol);
|
||||
if (i < (int) d->anz_revrules - 1) {
|
||||
if (i < (int) d->num_revrules - 1) {
|
||||
fprintf(opt.outfile, " ");
|
||||
}
|
||||
}
|
||||
|
@ -313,12 +313,12 @@ block: YSAMPLE STRING YENDSAMPLE
|
||||
|
||||
| YREPLACE rflag STRING YWITH STRING
|
||||
{
|
||||
invoke_action(action_add_regex_rule(bison_args, "rep", &curdes.reprules, &curdes.anz_reprules, $3, $5, $2));
|
||||
invoke_action(action_add_regex_rule(bison_args, "rep", &curdes.reprules, &curdes.num_reprules, $3, $5, $2));
|
||||
}
|
||||
|
||||
| YREVERSE rflag STRING YTO STRING
|
||||
{
|
||||
invoke_action(action_add_regex_rule(bison_args, "rev", &curdes.revrules, &curdes.anz_revrules, $3, $5, $2));
|
||||
invoke_action(action_add_regex_rule(bison_args, "rev", &curdes.revrules, &curdes.num_revrules, $3, $5, $2));
|
||||
}
|
||||
|
||||
| YPADDING '{' wlist '}'
|
||||
|
Loading…
Reference in New Issue
Block a user