Date: Wed, 29 Oct 2014 12:10:39 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273820 - head/usr.sbin/ctld Message-ID: <201410291210.s9TCAdOp001823@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Wed Oct 29 12:10:39 2014 New Revision: 273820 URL: https://svnweb.freebsd.org/changeset/base/273820 Log: 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; } } MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Oct 29 11:47:04 2014 (r273819) +++ head/usr.sbin/ctld/parse.y Wed Oct 29 12:10:39 2014 (r273820) @@ -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: Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Wed Oct 29 11:47:04 2014 (r273819) +++ head/usr.sbin/ctld/token.l Wed Oct 29 12:10:39 2014 (r273820) @@ -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; } %%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410291210.s9TCAdOp001823>