diff --git a/src/cfgparse.y b/src/cfgparse.y index f212826e..8d980ced 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -368,7 +368,7 @@ new_container: ; workspace: - TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen workspace_name + TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen optional_workspace_name { int ws_num = $3; if (ws_num < 1) { @@ -380,7 +380,7 @@ workspace: workspace_set_name(ws, $8); } } - | TOKWORKSPACE WHITESPACE NUMBER workspace_name + | TOKWORKSPACE WHITESPACE NUMBER WHITESPACE workspace_name { int ws_num = $3; if (ws_num < 1) { @@ -392,10 +392,14 @@ workspace: } ; +optional_workspace_name: + /* empty */ { $$ = NULL; } + | workspace_name { $$ = $1; } + ; + workspace_name: - /* NULL */ { $$ = NULL; } - | WHITESPACE QUOTEDSTRING { $$ = $2; } - | WHITESPACE STR { $$ = $2; } + QUOTEDSTRING { $$ = $1; } + | STR { $$ = $1; } ; screen: