checked | to 'else' (merged [316])

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@524 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 2005-08-08 16:34:49 +00:00
parent cd4c324ff2
commit d56f19c7d1
4 changed files with 11 additions and 14 deletions

View File

@ -75,8 +75,8 @@ Most options can be configured conditionally by using the following syntax
... nesting: match only when parent match
}
}
| <field> <operator> <value> {
... else if
else <field> <operator> <value> {
... the "else if" block
}
where <field> is one of one of the following:

View File

@ -654,12 +654,6 @@ static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *
}
break;
case '|':
t->offset++;
tid = TK_OR;
buffer_copy_string(token, "|");
break;
case '{':
t->offset++;
@ -753,6 +747,8 @@ static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *
if (strcmp(token->ptr, "include") == 0) {
tid = TK_INCLUDE;
} else if (strcmp(token->ptr, "else") == 0) {
tid = TK_ELSE;
} else {
tid = TK_LKEY;
}
@ -775,9 +771,10 @@ static int config_tokenizer(server *srv, tokenizer_t *t, int *token_id, buffer *
if (tid) {
*token_id = tid;
#if 0
log_error_write(srv, __FILE__, __LINE__, "sbsdsdb",
log_error_write(srv, __FILE__, __LINE__, "sbsdsdbdd",
"file:", t->file,
"line:", t->line, "pos:", t->line_pos, token);
"line:", t->line, "pos:", t->line_pos,
token, token->used - 1, tid);
#endif
return 1;

View File

@ -268,7 +268,7 @@ aelement(A) ::= STRING(B) ARRAY_ASSIGN expression(C). {
eols ::= EOL.
eols ::= .
condlines(A) ::= condlines(B) eols OR condline(C). {
condlines(A) ::= condlines(B) eols ELSE condline(C). {
assert(B->context_ndx < C->context_ndx);
C->prev = B;
B->next = C;

View File

@ -33,13 +33,13 @@ $HTTP["host"] == "www.example.org" {
server.name = "www.example.org"
url.redirect = ("^" => "/match_1")
}
| $HTTP["host"] == "test1.example.org" {
else $HTTP["host"] == "test1.example.org" {
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test1.example.org"
url.redirect = ("^" => "/match_2")
}
# comments
| $HTTP["host"] == "test2.example.org" {
else $HTTP["host"] == "test2.example.org" {
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test2.example.org"
url.redirect = ("^" => "/match_3")
@ -47,7 +47,7 @@ $HTTP["host"] == "www.example.org" {
# comments
| $HTTP["host"] == "test3.example.org" {
else $HTTP["host"] == "test3.example.org" {
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "test3.example.org"
url.redirect = ("^" => "/match_4")