Changeset 313

Show
Ignore:
Timestamp:
04/28/2005 01:30:31 PM (3 years ago)
Author:
moo
Message:

change "|" to "else"

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/doc/configuration.txt

    r308 r313  
    7575    } 
    7676  } 
    77   | <field> <operator> <value> { 
    78     ... else if 
     77  else <field> <operator> <value> { 
     78    ... the "else if" block 
    7979  } 
    8080 
  • trunk/src/configfile.c

    r309 r313  
    596596                        break; 
    597597 
    598                 case '|': 
    599                         t->offset++; 
    600                         tid = TK_OR; 
    601                         buffer_copy_string(token, "|"); 
    602                         break; 
    603  
    604598                case '{': 
    605599                        t->offset++; 
     
    696690                                                tid = TK_INCLUDE; 
    697691                                        } 
     692                                        else if (strcmp(token->ptr, "else") == 0) { 
     693                                                tid = TK_ELSE; 
     694                                        } 
    698695                                        else { 
    699696                                                tid = TK_LKEY; 
     
    718715                *token_id = tid; 
    719716#if 0 
    720                 log_error_write(srv, __FILE__, __LINE__, "sbsdsdb",  
     717                log_error_write(srv, __FILE__, __LINE__, "sbsdsdbdd",  
    721718                                "file:", t->file, 
    722                                 "line:", t->line, "pos:", t->line_pos, token); 
     719                                "line:", t->line, "pos:", t->line_pos, 
     720                                token, token->used - 1, tid); 
    723721#endif 
    724722                 
  • trunk/src/configparser.y

    r307 r313  
    263263eols ::= . 
    264264 
    265 condlines(A) ::= condlines(B) eols OR condline(C). { 
     265condlines(A) ::= condlines(B) eols ELSE condline(C). { 
    266266  assert(B->context_ndx < C->context_ndx); 
    267267  C->prev = B; 
  • trunk/tests/condition.conf

    r307 r313  
    3535  url.redirect = ("^" => "/match_1") 
    3636} 
    37 | $HTTP["host"] == "test1.example.org" { 
     37else $HTTP["host"] == "test1.example.org" { 
    3838  server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" 
    3939  server.name = "test1.example.org" 
     
    4141} 
    4242# comments 
    43 | $HTTP["host"] == "test2.example.org" { 
     43else $HTTP["host"] == "test2.example.org" { 
    4444  server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" 
    4545  server.name = "test2.example.org" 
     
    4949         # comments 
    5050 
    51 | $HTTP["host"] == "test3.example.org" { 
     51else $HTTP["host"] == "test3.example.org" { 
    5252  server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" 
    5353  server.name = "test3.example.org"