Avoid aggregate initialization syntax in places where C++11 doesn't allow it
This commit is contained in:
parent
56ecc8b602
commit
e932d09908
3 changed files with 15 additions and 14 deletions
|
|
@ -73,15 +73,14 @@ class ParseTableBuilder {
|
|||
Symbol start_symbol = grammar.variables.empty() ?
|
||||
Symbol::terminal(0) :
|
||||
Symbol::non_terminal(0);
|
||||
Production start_production{
|
||||
vector<ProductionStep>(1, ProductionStep{
|
||||
start_symbol,
|
||||
0,
|
||||
rules::AssociativityNone,
|
||||
rules::Alias{}
|
||||
}),
|
||||
0
|
||||
};
|
||||
|
||||
Production start_production;
|
||||
start_production.steps.push_back({
|
||||
start_symbol,
|
||||
0,
|
||||
rules::AssociativityNone,
|
||||
rules::Alias{}
|
||||
});
|
||||
|
||||
add_parse_state({}, ParseItemSet{{
|
||||
{
|
||||
|
|
|
|||
|
|
@ -208,16 +208,17 @@ const vector<Production> &ParseItemSetBuilder::inline_production(const ParseItem
|
|||
auto end = item.production->steps.end();
|
||||
auto step = begin + item.step_index;
|
||||
|
||||
Production production{
|
||||
vector<ProductionStep>(begin, step),
|
||||
item.production->dynamic_precedence
|
||||
};
|
||||
Production production;
|
||||
production.steps.assign(begin, step);
|
||||
production.dynamic_precedence = item.production->dynamic_precedence;
|
||||
|
||||
for (auto &step : *production_to_insert) {
|
||||
production.steps.push_back(step);
|
||||
if (!inlined_step.alias.value.empty()) {
|
||||
production.steps.back().alias = inlined_step.alias;
|
||||
}
|
||||
}
|
||||
|
||||
production.back().precedence = inlined_step.precedence;
|
||||
production.back().associativity = inlined_step.associativity;
|
||||
production.steps.insert(
|
||||
|
|
|
|||
|
|
@ -93,7 +93,8 @@ Metadata Metadata::main_token(const Rule &rule) {
|
|||
|
||||
Metadata Metadata::alias(string &&value, bool is_named, const Rule &rule) {
|
||||
MetadataParams params;
|
||||
params.alias = {move(value), is_named};
|
||||
params.alias.value = move(value);
|
||||
params.alias.is_named = is_named;
|
||||
return Metadata{rule, params};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue