/**
* oconfig - src/parser.y
- * Copyright (C) 2007 Florian octo Forster <octo at verplant.org>
+ * Copyright (C) 2007,2008 Florian octo Forster <octo at verplant.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
;
block_begin:
+ OPENBRAC identifier CLOSEBRAC EOL
+ {
+ memset (&$$, '\0', sizeof ($$));
+ $$.key = $2;
+ }
+ |
OPENBRAC identifier argument_list CLOSEBRAC EOL
{
memset (&$$, '\0', sizeof ($$));
statement_list statement
{
$$ = $1;
- if ($2.values_num > 0)
+ if (($2.values_num > 0) || ($2.children_num > 0))
{
$$.statement_num++;
$$.statement = realloc ($$.statement, $$.statement_num * sizeof (oconfig_item_t));
}
| statement
{
- if ($1.values_num > 0)
+ if (($1.values_num > 0) || ($1.children_num > 0))
{
$$.statement = malloc (sizeof (oconfig_item_t));
$$.statement[0] = $1;