summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e3895c)
raw | patch | inline | side by side (parent: 0e3895c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 23 Jan 2008 10:22:53 +0000 (11:22 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 23 Jan 2008 10:22:53 +0000 (11:22 +0100) |
This way the `<Threshold>' block doesn't need a bogus argument just to make the
parser happy.
parser happy.
src/liboconfig/parser.y | patch | blob | history |
index ea6ed0a099a2a822bd119dc6c16ebadcad594c25..837b6505bca2e22c530f5c5a3a7d104869a0dfcb 100644 (file)
--- a/src/liboconfig/parser.y
+++ b/src/liboconfig/parser.y
;
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;