From fa541af5778a78e148d3e4a43da7f0d34513ed82 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 1 Oct 2012 18:52:58 +0200 Subject: implement "continue" RainerScript statement --- ChangeLog | 1 + grammar/grammar.y | 2 ++ grammar/lexer.l | 1 + grammar/rainerscript.c | 7 ++++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bab7e59e..643aa349 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --------------------------------------------------------------------------- Version 7.1.8 [devel] 2012-10-?? +- implemented "continue" RainerScript statement - bugfix: ruleset(){} directive errornously changed default ruleset much like the $ruleset legacy conf statement. This potentially lead to statements being assigned to the wrong ruleset. diff --git a/grammar/grammar.y b/grammar/grammar.y index 61878554..343daaaa 100644 --- a/grammar/grammar.y +++ b/grammar/grammar.y @@ -68,6 +68,7 @@ extern int yyerror(char*); %token STOP %token SET %token UNSET +%token CONTINUE %token CALL %token LEGACY_ACTION %token LEGACY_RULESET @@ -161,6 +162,7 @@ stmt: actlst { $$ = $1; } | PRIFILT block { $$ = cnfstmtNewPRIFILT($1, $2); } | PROPFILT block { $$ = cnfstmtNewPROPFILT($1, $2); } | CALL NAME { $$ = cnfstmtNewCall($2); } + | CONTINUE { $$ = cnfstmtNewContinue(); } block: stmt { $$ = $1; } | '{' script '}' { $$ = $2; } actlst: s_act { $$ = $1; } diff --git a/grammar/lexer.l b/grammar/lexer.l index f45dbc2a..76b1298c 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -156,6 +156,7 @@ int fileno(FILE *stream); "call" { BEGIN INCALL; return CALL; } "set" { BEGIN EXPR; return SET; } "unset" { BEGIN EXPR; return UNSET; } +"continue" { return CONTINUE; } /* line number support because the "preprocessor" combines lines and so needs * to tell us the real source line. */ diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index a72b4155..7e75326c 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2129,7 +2129,6 @@ struct cnfstmt * cnfstmtNewCall(es_str_t *name) { struct cnfstmt* cnfstmt; -dbgprintf("DDDD: got CALL\n"); if((cnfstmt = cnfstmtNew(S_CALL)) != NULL) { cnfstmt->d.s_call.name = name; } @@ -2146,6 +2145,12 @@ cnfstmtNewUnset(char *var) return cnfstmt; } +struct cnfstmt * +cnfstmtNewContinue(void) +{ + return cnfstmtNew(S_NOP); +} + struct cnfstmt * cnfstmtNewPRIFILT(char *prifilt, struct cnfstmt *t_then) { -- cgit v1.2.3