summaryrefslogtreecommitdiffstats
path: root/ctok.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
commitf02d615052e325616d7042096cea6e5247a980dc (patch)
treefed57a226daf1f0e052ead727fe99b858c3f1331 /ctok.c
parent0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (diff)
downloadrsyslog-f02d615052e325616d7042096cea6e5247a980dc.zip
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.gz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.xz
- basic implementation of expression parser parsing done
- improved ABNF a bit
Diffstat (limited to 'ctok.c')
-rw-r--r--ctok.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctok.c b/ctok.c
index eca6daa..0cf1eeb 100644
--- a/ctok.c
+++ b/ctok.c
@@ -95,7 +95,8 @@ ctokGetCharFromStream(ctok_t *pThis, uchar *pc)
ISOBJ_TYPE_assert(pThis, ctok);
ASSERT(pc != NULL);
- if(*pThis->pp == '\0') {
+ /* end of string or begin of comment terminates the "stream" */
+ if(*pThis->pp == '\0' || *pThis->pp == '#') {
ABORT_FINALIZE(RS_RET_EOS);
} else {
*pc = *pThis->pp;
@@ -359,7 +360,7 @@ ctokGetToken(ctok_t *pThis, ctok_token_t **ppToken)
uchar szWord[128];
ISOBJ_TYPE_assert(pThis, ctok);
- ASSERT(pToken != NULL);
+ ASSERT(ppToken != NULL);
/* first check if we have an ungotten token and, if so, provide that
* one back (without any parsing). -- rgerhards, 2008-02-20
@@ -450,6 +451,8 @@ ctokGetToken(ctok_t *pThis, ctok_token_t **ppToken)
pToken->tok = ctok_OR;
} else if(!strcasecmp((char*)szWord, "not")) {
pToken->tok = ctok_NOT;
+ } else if(!strcasecmp((char*)szWord, "then")) {
+ pToken->tok = ctok_THEN;
} else {
/* finally, we check if it is a function */
CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a charater */