Fix missing initializer warning in gcc

This commit is contained in:
Max Brunsfeld 2014-07-29 12:59:18 -07:00
parent f1eb9a92a3
commit 048a479b5f
2 changed files with 8 additions and 5 deletions

View file

@ -135,9 +135,9 @@ class ParseTableBuilder {
conflict_manager(ParseConflictManager(grammar, lex_grammar)) {}
pair<ParseTable, vector<Conflict> > build() {
auto start_symbol = grammar.rules.empty() ?
make_shared<Symbol>(0, rules::SymbolOptionToken) :
make_shared<Symbol>(0);
auto start_symbol = grammar.rules.empty()
? make_shared<Symbol>(0, rules::SymbolOptionToken)
: make_shared<Symbol>(0);
ParseItem start_item(rules::START(), start_symbol, 0);
add_parse_state(
item_set_closure(start_item, { rules::END_OF_INPUT() }, grammar));

View file

@ -8,12 +8,15 @@ struct TSDocument {
TSParser *parser;
const TSTree *tree;
TSInput input;
size_t error_count;
};
TSDocument *ts_document_make() {
TSDocument *document = malloc(sizeof(TSDocument));
*document = (TSDocument) { .input = (TSInput) {} };
*document = (TSDocument) {
.input = (TSInput) { .data = NULL, .read_fn = NULL, .seek_fn = NULL },
.parser = NULL,
.tree = NULL
};
return document;
}