mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
style: use midrule only, not mid-rule
The code was already using midrule only, never mid_rule. This is simpler to remember, and matches a similar change we made from look-ahead to lookahead. * NEWS, doc/bison.texi, src/reader.c, src/scan-code.h, src/scan-code.l * tests/actions.at, tests/c++.at, tests/existing.at: here.
This commit is contained in:
10
src/reader.c
10
src/reader.c
@@ -253,8 +253,8 @@ grammar_current_rule_begin (symbol *lhs, location loc,
|
||||
/*----------------------------------------------------------------------.
|
||||
| A symbol should be used if either: |
|
||||
| 1. It has a destructor. |
|
||||
| 2. The symbol is a mid-rule symbol (i.e., the generated LHS |
|
||||
| replacing a mid-rule action) that was assigned to or used, as in |
|
||||
| 2. The symbol is a midrule symbol (i.e., the generated LHS |
|
||||
| replacing a midrule action) that was assigned to or used, as in |
|
||||
| "exp: { $$ = 1; } { $$ = $1; }". |
|
||||
`----------------------------------------------------------------------*/
|
||||
|
||||
@@ -373,9 +373,9 @@ grammar_current_rule_end (location loc)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------.
|
||||
| The previous action turns out to be a mid-rule action. Attach it |
|
||||
| The previous action turns out to be a midrule action. Attach it |
|
||||
| to the current rule, i.e., create a dummy symbol, attach it this |
|
||||
| mid-rule action, and append this dummy nonterminal to the current |
|
||||
| midrule action, and append this dummy nonterminal to the current |
|
||||
| rule. |
|
||||
`-------------------------------------------------------------------*/
|
||||
|
||||
@@ -512,7 +512,7 @@ grammar_current_rule_merge_set (uniqstr name, location loc)
|
||||
}
|
||||
|
||||
/* Attach SYM to the current rule. If needed, move the previous
|
||||
action as a mid-rule action. */
|
||||
action as a midrule action. */
|
||||
|
||||
void
|
||||
grammar_current_rule_symbol_append (symbol *sym, location loc,
|
||||
|
||||
@@ -85,7 +85,7 @@ typedef struct code_props {
|
||||
/** Named reference. */
|
||||
named_ref *named_ref;
|
||||
|
||||
/** Type, for mid-rule actions. */
|
||||
/** Type, for midrule actions. */
|
||||
uniqstr type;
|
||||
} code_props;
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ show_sub_message (warnings warning,
|
||||
|
||||
if (var->err & VARIANT_NOT_VISIBLE_FROM_MIDRULE)
|
||||
obstack_printf (&msg_buf,
|
||||
_(", cannot be accessed from mid-rule action at $%d"),
|
||||
_(", cannot be accessed from midrule action at $%d"),
|
||||
midrule_rhs_index);
|
||||
|
||||
complain_indent (&id_loc, warning, &indent, "%s",
|
||||
@@ -494,7 +494,7 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
|
||||
variant *var = &variant_table[i];
|
||||
unsigned symbol_index = var->symbol_index;
|
||||
|
||||
/* Check visibility from mid-rule actions. */
|
||||
/* Check visibility from midrule actions. */
|
||||
if (midrule_rhs_index != 0
|
||||
&& (symbol_index == 0 || midrule_rhs_index < symbol_index))
|
||||
var->err |= VARIANT_NOT_VISIBLE_FROM_MIDRULE;
|
||||
|
||||
Reference in New Issue
Block a user