From a09409900f0442610a0e4612a06d2b252eb373e9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 5 Dec 2016 16:37:06 -0800 Subject: [PATCH] Silence missing intializer warnings in compiler unit tests --- .../build_tables/parse_item_set_builder_spec.cc | 4 ++-- .../prepare_grammar/expand_repeats_spec.cc | 12 ++++++------ .../prepare_grammar/extract_tokens_spec.cc | 16 ++++++++-------- .../prepare_grammar/intern_symbols_spec.cc | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/spec/compiler/build_tables/parse_item_set_builder_spec.cc b/spec/compiler/build_tables/parse_item_set_builder_spec.cc index dad0976b..6548f37a 100644 --- a/spec/compiler/build_tables/parse_item_set_builder_spec.cc +++ b/spec/compiler/build_tables/parse_item_set_builder_spec.cc @@ -46,7 +46,7 @@ describe("ParseItemSetBuilder", []() { {Symbol(15, Symbol::Terminal), 0, AssociativityNone}, }) }), - }, {}, {}}; + }, {}, {}, {}}; auto production = [&](int variable_index, int production_index) -> const Production & { return grammar.variables[variable_index].productions[production_index]; @@ -97,7 +97,7 @@ describe("ParseItemSetBuilder", []() { }), Production({}) }), - }, {}, {}}; + }, {}, {}, {}}; auto production = [&](int variable_index, int production_index) -> const Production & { return grammar.variables[variable_index].productions[production_index]; diff --git a/spec/compiler/prepare_grammar/expand_repeats_spec.cc b/spec/compiler/prepare_grammar/expand_repeats_spec.cc index c25ff47c..d8c93a41 100644 --- a/spec/compiler/prepare_grammar/expand_repeats_spec.cc +++ b/spec/compiler/prepare_grammar/expand_repeats_spec.cc @@ -13,7 +13,7 @@ describe("expand_repeats", []() { it("replaces repeat rules with pairs of recursive rules", [&]() { InitialSyntaxGrammar grammar{{ Variable("rule0", VariableTypeNamed, repeat1(i_token(0))), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); @@ -32,7 +32,7 @@ describe("expand_repeats", []() { i_token(10), repeat1(i_token(11)), })), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); @@ -54,7 +54,7 @@ describe("expand_repeats", []() { i_token(10), repeat1(i_token(11)) })), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); @@ -80,7 +80,7 @@ describe("expand_repeats", []() { i_token(3), repeat1(i_token(4)) })), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); @@ -106,7 +106,7 @@ describe("expand_repeats", []() { repeat1(i_token(10)), repeat1(i_token(11)), })), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); @@ -130,7 +130,7 @@ describe("expand_repeats", []() { InitialSyntaxGrammar grammar{{ Variable("rule0", VariableTypeNamed, repeat1(i_token(10))), Variable("rule1", VariableTypeNamed, repeat1(i_token(11))), - }, {}, {}}; + }, {}, {}, {}}; auto result = expand_repeats(grammar); diff --git a/spec/compiler/prepare_grammar/extract_tokens_spec.cc b/spec/compiler/prepare_grammar/extract_tokens_spec.cc index 613d31cc..30a731c8 100644 --- a/spec/compiler/prepare_grammar/extract_tokens_spec.cc +++ b/spec/compiler/prepare_grammar/extract_tokens_spec.cc @@ -29,7 +29,7 @@ describe("extract_tokens", []() { Variable("rule_B", VariableTypeNamed, pattern("ij+")), Variable("rule_C", VariableTypeNamed, choice({ str("kl"), blank() })), Variable("rule_D", VariableTypeNamed, repeat1(i_sym(3))) - }, {}, {}}); + }, {}, {}, {}}); InitialSyntaxGrammar &syntax_grammar = get<0>(result); LexicalGrammar &lexical_grammar = get<1>(result); @@ -92,7 +92,7 @@ describe("extract_tokens", []() { i_sym(0), str("ab"), })), - }, {}, {}}); + }, {}, {}, {}}); InitialSyntaxGrammar &syntax_grammar = get<0>(result); LexicalGrammar &lexical_grammar = get<1>(result); @@ -111,7 +111,7 @@ describe("extract_tokens", []() { Variable("rule_A", VariableTypeNamed, seq({ i_sym(1), str("ab") })), Variable("rule_B", VariableTypeNamed, str("cd")), Variable("rule_C", VariableTypeNamed, seq({ str("ef"), str("cd") })), - }, {}, {}}); + }, {}, {}, {}}); InitialSyntaxGrammar &syntax_grammar = get<0>(result); LexicalGrammar &lexical_grammar = get<1>(result); @@ -151,7 +151,7 @@ describe("extract_tokens", []() { }, { str("y"), pattern("\\s+"), - }, {}}); + }, {}, {}}); AssertThat(get<2>(result), Equals(CompileError::none())); @@ -168,7 +168,7 @@ describe("extract_tokens", []() { Variable("rule_B", VariableTypeNamed, str("y")), }, { str("y"), - }, {}}); + }, {}, {}}); AssertThat(get<2>(result), Equals(CompileError::none())); AssertThat(get<1>(result).separators.size(), Equals(0)); @@ -182,7 +182,7 @@ describe("extract_tokens", []() { Variable("rule_C", VariableTypeNamed, str("z")), }, { i_sym(2), - }, {}}); + }, {}, {}}); AssertThat(get<2>(result), Equals(CompileError::none())); @@ -197,7 +197,7 @@ describe("extract_tokens", []() { auto result = extract_tokens(InternedGrammar{{ Variable("rule_A", VariableTypeNamed, seq({ str("x"), i_sym(1) })), Variable("rule_B", VariableTypeNamed, seq({ str("y"), str("z") })), - }, { i_sym(1) }, {}}); + }, { i_sym(1) }, {}, {}}); AssertThat(get<2>(result), !Equals(CompileError::none())); AssertThat(get<2>(result), Equals( @@ -209,7 +209,7 @@ describe("extract_tokens", []() { auto result = extract_tokens(InternedGrammar{{ Variable("rule_A", VariableTypeNamed, str("x")), Variable("rule_B", VariableTypeNamed, str("y")), - }, { choice({ i_sym(1), blank() }) }, {}}); + }, { choice({ i_sym(1), blank() }) }, {}, {}}); AssertThat(get<2>(result), !Equals(CompileError::none())); AssertThat(get<2>(result), Equals(CompileError( diff --git a/spec/compiler/prepare_grammar/intern_symbols_spec.cc b/spec/compiler/prepare_grammar/intern_symbols_spec.cc index 4c417e57..4ec27149 100644 --- a/spec/compiler/prepare_grammar/intern_symbols_spec.cc +++ b/spec/compiler/prepare_grammar/intern_symbols_spec.cc @@ -17,7 +17,7 @@ describe("intern_symbols", []() { { "x", choice({ sym("y"), sym("_z") }) }, { "y", sym("_z") }, { "_z", str("stuff") } - }, {}, {}}; + }, {}, {}, {}}; auto result = intern_symbols(grammar); @@ -33,7 +33,7 @@ describe("intern_symbols", []() { it("returns an error", []() { Grammar grammar{{ { "x", sym("y") }, - }, {}, {}}; + }, {}, {}, {}}; auto result = intern_symbols(grammar); @@ -48,7 +48,7 @@ describe("intern_symbols", []() { { "z", str("stuff") } }, { sym("z") - }, {}}; + }, {}, {}}; auto result = intern_symbols(grammar);