#696198 ferm: weird parsing failure when using domain (ip ip6) in functions

#696198#5
Date:
2012-12-17 23:01:51 UTC
From:
To:
Hi there!

Ferm fails to parse

@def &foo() = {
    domain (ip ip6) table filter chain FOO ACCEPT;
}
&foo();


with the following error message:

Error in foo.ferm line 2:
    (
        ip ip6
    )
    table filter chain FOO ACCEPT ;
    <--
Missing "}" at end of file



Which is kinda confusing and not pointing to the real problem (even
worse, if you call &foo much later, it points to a completely wrong
line...).

I'd expect it to work as
@def &foo() = {
    domain ip6 table filter chain FOO ACCEPT;
    domain ip table filter chain FOO ACCEPT;
}
&foo();

just works well:

# Generated by ferm 2.1.1 on Mon Dec 17 23:59:11 2012
*filter
:FOO - [0:0]
-A FOO --jump ACCEPT
COMMIT
# Generated by ferm 2.1.1 on Mon Dec 17 23:59:11 2012
*filter
:FOO - [0:0]
-A FOO --jump ACCEPT
COMMIT


Cheers,

Bernd