summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/config.Y4
-rw-r--r--filter/test.conf13
2 files changed, 9 insertions, 8 deletions
diff --git a/filter/config.Y b/filter/config.Y
index 8ff2046..b9aa67f 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -305,11 +305,11 @@ switch_body: /* EMPTY */ { $$ = NULL; }
$$->data = $4;
$$->left = $1;
}
- | switch_body ELSE ':' cmds {
+ | switch_body ELSECOL cmds {
$$ = f_new_tree();
$$->from.type = T_VOID;
$$->to.type = T_VOID;
- $$->data = $4;
+ $$->data = $3;
$$->left = $1;
}
;
diff --git a/filter/test.conf b/filter/test.conf
index 40fff19..6d7a708 100644
--- a/filter/test.conf
+++ b/filter/test.conf
@@ -27,14 +27,15 @@ int local1;
int local2;
int i;
{
- printn "Function callme called arguments ", arg1, " and ", arg2, ":" ;
+ printn "Function callme called arguments ", arg1, " and ", arg2, ": " ;
i = arg2;
case arg1 {
- 2: print "dva"; print "jeste jednou dva";
- 3 .. 5: print "tri az pet";
- else: print "neco jineho";
- }
+ 2: printn "dva, "; printn "jeste jednou dva";
+ 3 .. 5: if arg2 < 3 then printn "tri az pet";
+ else: printn "neco jineho";
+ }
+ print;
}
function fifteen()
@@ -247,7 +248,7 @@ string s;
callme ( 2, 2 );
callme ( 2, 2 );
callme ( 3, 2 );
- callme ( 4, 2 );
+ callme ( 4, 4 );
callme ( 7, 2 );
i = fifteen();