fix: Warning for no-missing-field-initializers

Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo
2022-04-23 01:45:14 +08:00
committed by Michael Hoffmann
parent d559c46ba1
commit 8a13647a4d
2 changed files with 4 additions and 4 deletions

View File

@@ -19,4 +19,4 @@ jobs:
uses: egor-tensin/setup-mingw@v2 uses: egor-tensin/setup-mingw@v2
- name: build - name: build
run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.cc run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.cc -Werror

View File

@@ -96,7 +96,7 @@ public:
} }
// manage quoted context // manage quoted context
if (valid_symbols[QUOTED_TEMPLATE_START] && !in_quoted_context() && lexer->lookahead == '"') { if (valid_symbols[QUOTED_TEMPLATE_START] && !in_quoted_context() && lexer->lookahead == '"') {
Context ctx = { QUOTED_TEMPLATE }; Context ctx = { QUOTED_TEMPLATE, "" };
context_stack.push_back(ctx); context_stack.push_back(ctx);
return accept_and_advance(lexer, QUOTED_TEMPLATE_START); return accept_and_advance(lexer, QUOTED_TEMPLATE_START);
} }
@@ -114,7 +114,7 @@ public:
) { ) {
advance(lexer); advance(lexer);
if (lexer->lookahead == '{') { if (lexer->lookahead == '{') {
Context ctx = { TEMPLATE_INTERPOLATION }; Context ctx = { TEMPLATE_INTERPOLATION, "" };
context_stack.push_back(ctx); context_stack.push_back(ctx);
return accept_and_advance(lexer, TEMPLATE_INTERPOLATION_START); return accept_and_advance(lexer, TEMPLATE_INTERPOLATION_START);
} }
@@ -142,7 +142,7 @@ public:
) { ) {
advance(lexer); advance(lexer);
if (lexer->lookahead == '{') { if (lexer->lookahead == '{') {
Context ctx = { TEMPLATE_DIRECTIVE }; Context ctx = { TEMPLATE_DIRECTIVE, "" };
context_stack.push_back(ctx); context_stack.push_back(ctx);
return accept_and_advance(lexer, TEMPLATE_DIRECTIVE_START); return accept_and_advance(lexer, TEMPLATE_DIRECTIVE_START);
} }