PakfireParser parser = pakfire_calloc(1, sizeof(*parser));
if (parser) {
parser->pakfire = pakfire_ref(pakfire);
+ parser->nrefs = 1;
// Store a reference to the parent parser if we have one
if (parent)
{
$$ = merge_parsers($1, $2);
- //pakfire_parser_unref($1);
- //pakfire_parser_unref($2);
+ pakfire_parser_unref($1);
+ pakfire_parser_unref($2);
}
| item
;
if_stmt : if variable T_EQUALS variable T_EOL grammar else grammar end
{
$$ = make_if_stmt(parser, OP_EQUALS, $2, $4, $6, $8);
- //pakfire_parser_unref($6);
- //pakfire_parser_unref($8);
+ pakfire_parser_unref($6);
+ pakfire_parser_unref($8);
}
| if variable T_EQUALS variable T_EOL grammar end
{
$$ = make_if_stmt(parser, OP_EQUALS, $2, $4, $6, NULL);
- //pakfire_parser_unref($6);
+ pakfire_parser_unref($6);
};
block : block_opening grammar block_closing
else if (p2)
p = p2;
+ if (p)
+ p = pakfire_parser_ref(p);
+
return p;
}