mirror of https://github.com/omar-polo/gmid.git
don't require the strict order macro > options > servers
This commit is contained in:
parent
f98e9045ae
commit
6b86655a10
|
@ -1,5 +1,7 @@
|
|||
2021-06-29 Omar Polo <op@omarpolo.com>
|
||||
|
||||
* parse.y (conf): don't require the strict order macro > options > servers
|
||||
|
||||
* gmid.c (main): add -D to define macros from the cmd line
|
||||
|
||||
* parse.y (yylex): allow to define macros in the config file
|
||||
|
|
16
parse.y
16
parse.y
|
@ -97,10 +97,10 @@ char *symget(const char *);
|
|||
|
||||
%%
|
||||
|
||||
conf : vars options vhosts ;
|
||||
|
||||
vars : /* empty */
|
||||
| vars var
|
||||
conf : /* empty */
|
||||
| conf var
|
||||
| conf option
|
||||
| conf vhost
|
||||
;
|
||||
|
||||
var : TSTRING '=' TSTRING {
|
||||
|
@ -120,10 +120,6 @@ var : TSTRING '=' TSTRING {
|
|||
}
|
||||
;
|
||||
|
||||
options : /* empty */
|
||||
| options option
|
||||
;
|
||||
|
||||
option : TCHROOT TSTRING { conf.chroot = $2; }
|
||||
| TIPV6 TBOOL { conf.ipv6 = $2; }
|
||||
| TMIME TSTRING TSTRING { add_mime(&conf.mime, $2, $3); }
|
||||
|
@ -136,10 +132,6 @@ option : TCHROOT TSTRING { conf.chroot = $2; }
|
|||
| TUSER TSTRING { conf.user = $2; }
|
||||
;
|
||||
|
||||
vhosts : /* empty */
|
||||
| vhosts vhost
|
||||
;
|
||||
|
||||
vhost : TSERVER TSTRING {
|
||||
host = new_vhost();
|
||||
TAILQ_INSERT_HEAD(&hosts, host, vhosts);
|
||||
|
|
Loading…
Reference in New Issue