diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-01 18:52:58 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-01 18:52:58 +0200 |
commit | fa541af5778a78e148d3e4a43da7f0d34513ed82 (patch) | |
tree | a9489dacbb41271188e8ab12961948646921b88c | |
parent | 81c8658769962dcc988734b23e354dfb1e54fcb0 (diff) | |
download | rsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.tar.gz rsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.tar.xz rsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.zip |
implement "continue" RainerScript statement
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | grammar/grammar.y | 2 | ||||
-rw-r--r-- | grammar/lexer.l | 1 | ||||
-rw-r--r-- | grammar/rainerscript.c | 7 |
4 files changed, 10 insertions, 1 deletions
@@ -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 <cnfstmt> CALL %token <s> LEGACY_ACTION %token <s> 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; } @@ -2147,6 +2146,12 @@ cnfstmtNewUnset(char *var) } struct cnfstmt * +cnfstmtNewContinue(void) +{ + return cnfstmtNew(S_NOP); +} + +struct cnfstmt * cnfstmtNewPRIFILT(char *prifilt, struct cnfstmt *t_then) { struct cnfstmt* cnfstmt; |