diff options
author | trasz <trasz@FreeBSD.org> | 2014-11-29 15:36:10 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-11-29 15:36:10 +0000 |
commit | 704c9e7b81dfd10f375111043b899948edf95739 (patch) | |
tree | 74d0ca9f90aabaa3ddbdfb3af439cc512769b218 /usr.sbin/ctld | |
parent | 077d08af55ff28734a05d3f5d6383a4b82c4c529 (diff) | |
download | FreeBSD-src-704c9e7b81dfd10f375111043b899948edf95739.zip FreeBSD-src-704c9e7b81dfd10f375111043b899948edf95739.tar.gz |
MFC r273820:
Make it possible to optionally use semicolon to separate statements.
This makes it possible to format stuff like this:
target xxx {
lun 0 { path /foo/bar; size 4G; }
}
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r-- | usr.sbin/ctld/parse.y | 12 | ||||
-rw-r--r-- | usr.sbin/ctld/token.l | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index 248d430..be95efb 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -60,7 +60,7 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP DISCOVERY_FILTER %token INITIATOR_NAME INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC -%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR +%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SEMICOLON SERIAL SIZE STR %token TARGET TIMEOUT ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %union @@ -75,6 +75,8 @@ extern void yyrestart(FILE *); statements: | statements statement + | + statements statement SEMICOLON ; statement: @@ -220,6 +222,8 @@ auth_group_name: STR auth_group_entries: | auth_group_entries auth_group_entry + | + auth_group_entries auth_group_entry SEMICOLON ; auth_group_entry: @@ -322,6 +326,8 @@ portal_group_name: STR portal_group_entries: | portal_group_entries portal_group_entry + | + portal_group_entries portal_group_entry SEMICOLON ; portal_group_entry: @@ -406,6 +412,8 @@ target_name: STR target_entries: | target_entries target_entry + | + target_entries target_entry SEMICOLON ; target_entry: @@ -653,6 +661,8 @@ lun_number: STR lun_entries: | lun_entries lun_entry + | + lun_entries lun_entry SEMICOLON ; lun_entry: diff --git a/usr.sbin/ctld/token.l b/usr.sbin/ctld/token.l index c411a64..b63ce42 100644 --- a/usr.sbin/ctld/token.l +++ b/usr.sbin/ctld/token.l @@ -83,6 +83,7 @@ timeout { return TIMEOUT; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; \n { lineno++; } +; { return SEMICOLON; } [ \t]+ /* ignore whitespace */; . { yylval.str = strdup(yytext); return STR; } %% |